forked from FOSS/BangleApps
Split functions in preparation.
parent
e5493caa9d
commit
f09532d6f7
|
@ -143,24 +143,32 @@ function gameStep() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bangle.setUI();
|
function rotate() {
|
||||||
Bangle.on("touch", (e) => {
|
|
||||||
t = rotateTile(ct, 3);
|
t = rotateTile(ct, 3);
|
||||||
if (moveOk(t, 0, 0)) {
|
if (moveOk(t, 0, 0)) {
|
||||||
drawTile(ct, ctn, ox+px*8, oy+py*8, true);
|
drawTile(ct, ctn, ox+px*8, oy+py*8, true);
|
||||||
ct = t;
|
ct = t;
|
||||||
drawTile(ct, ctn, ox+px*8, oy+py*8, false);
|
drawTile(ct, ctn, ox+px*8, oy+py*8, false);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
Bangle.on("swipe", (x,y) => {
|
function move(x, y) {
|
||||||
if (y<0) y = 0;
|
|
||||||
if (moveOk(ct, x, y)) {
|
if (moveOk(ct, x, y)) {
|
||||||
drawTile(ct, ctn, ox+px*8, oy+py*8, true);
|
drawTile(ct, ctn, ox+px*8, oy+py*8, true);
|
||||||
px += x;
|
px += x;
|
||||||
py += y;
|
py += y;
|
||||||
drawTile(ct, ctn, ox+px*8, oy+py*8, false);
|
drawTile(ct, ctn, ox+px*8, oy+py*8, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Bangle.setUI();
|
||||||
|
Bangle.on("touch", (e) => {
|
||||||
|
rotate();
|
||||||
|
});
|
||||||
|
|
||||||
|
Bangle.on("swipe", (x,y) => {
|
||||||
|
if (y<0) y = 0;
|
||||||
|
move(x, y);
|
||||||
});
|
});
|
||||||
|
|
||||||
drawBoundingBox();
|
drawBoundingBox();
|
||||||
|
|
Loading…
Reference in New Issue