Infinity2Dbata1.0

Infinity2D游戏引擎,卡顿

适配设备:Pro

作者:infinity_man

下载量:36 · 点赞:0

可信源码风险提示:保存或下载前请阅读源码和权限声明。
SHA-2566bd0da951d55ac94a7e4addfab600987fd8afd46227dff4476006dfd1a93f8c2
let g='#006600'
function s(m,M){
return Math.floor(Math.random()*(M-m+1))+m
}
var u

function k(q,q1){
//f(q1==u) q1=100
return ui.stack(q,q1)//{padding:3,background:'#000000',width:q1})
}



function d(q,e){
xr()
if(q==0){xx+=e;zx=e;zy=0}
if(q==1){yy+=e;zy=e;zx=0}
let qs=0
for (let i = 0; i < r.length; i += 1) {
if(r[i][0]==yy&r[i][1]==xx&r[i][2]==false) qs=1
}
for (let i = 0; i < 9; i += 1) {
if(qs==0){
setTimeout(() => {
if(q==0){x+=e*4}
if(q==1){y+=e*4}
},i*50)
}}
if(qs==1){
if(q==0){xx-=e}
if(q==1){yy-=e}
}}



let $={c:'333333',g:false}
let _=u
let z={c:'aaaaaa',g:true}


let t=[
[_],
[$,$,z,$,$],
[$,z,z,z,$],
[$,z,z,z,$],
[$,z,z,z,$],
[$,$,$,$,$]
]
let r=[]
let w=[]

function xr(){
w=[]
for (let i = 0; i < t.length; i += 1) {
for (let o = 0; o < t[i].length; o += 1) {
if(t[i][o]!==u&a+(i*36-y)>0&a+(i*36-y)<300&c+(o*36-x)>-0&c+(o*36-x)<320){
w.push(ui.column(ui.column('',{
background:'#'+t[i][o].c}),
{
background:'#000000',
padding:3,
width:36,
height:38,
y:a+(i*36-y),
x:c+(o*36-x)
}))
r.push([i,o,t[i][o].g])
}else{
//t[i][o]={g:true}



}
}
}}





ui.showHeader(false)
let b=(q,q1)=>{
return {
size:16,
height:10,
radius:0,
width:'19%',
x:q,
y:q1,
background:'#666666'
}
}

let a=300/2
let c=160
let y=-10
let x=10
let xx=0
let yy=0
let zx=1
let zy=0
ui.render(()=>ui.column([
//ui.text('     '+x+','+y,{color:'#000000'}),
ui.stack([
ui.column(ui.column('',{background:g,height:40}),{padding:3,width:'14%',height:0,background:'#00ff00',x:a+(zx*36)-3,y:c+(zy*36)-4}),
ui.stack([
ui.stack(w),
ui.column(ui.column('',
{radius:16,width:'100%',background:'#aaaaaa',height:2}),
{radius:16,height:10,padding:3,background:'#000000',width:26,align:'center',x:a+5,y:c}),
ui.stack('',{y:300,background:'#000000',height:250}),
ui.stack('',{y:0,background:'#000000'})
]),





ui.stack([
ui.button('right',()=>d(0,1),b(130,60)),
ui.button('reft',()=>d(0,-1),b(0,60)),
ui.button('up',()=>d(1,-1),b(65,6)),
ui.button('down',()=>d(1,1),b(65,60)),
],
{y:320}),
ui.spacer(100)]),
//ui.spacer(100),
//ui.spacer(100),
],{radius:36,padding:0,background:g}))







setInterval(() =>{
ui.scrollTop()
xr()
ui.refresh()
},250)