diff --git a/Source/Player.lua b/Source/Player.lua index 79d0485..b775323 100644 --- a/Source/Player.lua +++ b/Source/Player.lua @@ -61,7 +61,7 @@ end function updatePlayer() if active == true then - if playdate.buttonIsPressed(playdate.kButtonUp) then + if playdate.buttonIsPressed(playdate.kButtonUp) or playdate.buttonIsPressed(playdate.kButtonDown) or playdate.buttonIsPressed(playdate.kButtonLeft) or playdate.buttonIsPressed(playdate.kButtonRight) or playdate.buttonIsPressed(playdate.kButtonA) or playdate.buttonIsPressed(playdate.kButtonB) then velocity.x = velocity.x + math.sin(math.rad(playdate.getCrankPosition())) /2 velocity.y = velocity.y - math.cos(math.rad(playdate.getCrankPosition())) /2 end @@ -81,7 +81,7 @@ function updatePlayer() end elseif exists == true then - if playdate.buttonIsPressed(playdate.kButtonUp) then + if playdate.buttonIsPressed(playdate.kButtonUp) or playdate.buttonIsPressed(playdate.kButtonDown) or playdate.buttonIsPressed(playdate.kButtonLeft) or playdate.buttonIsPressed(playdate.kButtonRight) or playdate.buttonIsPressed(playdate.kButtonA) or playdate.buttonIsPressed(playdate.kButtonB) then active = true end local cx, cy = gfx.getDrawOffset() diff --git a/Source/Saws.lua b/Source/Saws.lua index dce2491..bbb01d8 100644 --- a/Source/Saws.lua +++ b/Source/Saws.lua @@ -77,7 +77,18 @@ function updateSaws() end end - printTable(spinblades) + for spinner = 1, #spinblades, 1 do + for arm = 1, #spinblades[spinner].arms do + for blade = 1, #spinblades[spinner].arms[arm] do + spinblades[spinner].time += spinblades[spinner].speed + local degrees = (360 / #spinblades[spinner].arms + spinblades[spinner].time) + print(degrees) + local position = {x=math.sin(math.rad(degrees)) * 20 * blade,y=math.cos(math.rad(degrees)) * 20 * blade} + + spinblades[spinner].arms[arm][blade]:moveTo(spinblades[spinner].mid.x + position.x, spinblades[spinner].mid.y + position.y) + end + end + end end function killBlades() diff --git a/Source/levels/PRECISION b/Source/levels/PRECISION new file mode 100644 index 0000000..339d1e4 --- /dev/null +++ b/Source/levels/PRECISION @@ -0,0 +1 @@ +{"bigrocket":{"x":152.083333,"y":53.846154},"dimensions":{"x":8,"y":13},"rocket":{"x":92.55814,"y":160.930233},"saws":[{"ends":{"x":79.262694,"y":-4.60831},"speed":2,"start":{"x":-7.373272,"y":-7.373272}},{"ends":{"x":66.359461,"y":66.359461},"speed":2,"start":{"x":7.373272,"y":7.373272}}],"tiles":[{"t":2,"x":0,"y":0},{"t":2,"x":0,"y":1},{"t":2,"x":1,"y":1},{"t":2,"x":5,"y":5},{"t":2,"x":8,"y":5},{"t":2,"x":1,"y":13},{"t":2,"x":8,"y":13},{"t":3,"x":2,"y":1},{"t":3,"x":3,"y":1},{"t":3,"x":4,"y":1},{"t":3,"x":5,"y":1},{"t":3,"x":6,"y":1},{"t":3,"x":7,"y":1},{"t":3,"x":8,"y":1},{"t":3,"x":6,"y":5},{"t":3,"x":7,"y":5},{"t":3,"x":2,"y":13},{"t":3,"x":3,"y":13},{"t":3,"x":4,"y":13},{"t":3,"x":5,"y":13},{"t":3,"x":6,"y":13},{"t":3,"x":7,"y":13},{"t":4,"x":1,"y":2},{"t":4,"x":1,"y":3},{"t":4,"x":1,"y":4},{"t":4,"x":1,"y":5},{"t":4,"x":1,"y":6},{"t":4,"x":8,"y":6},{"t":4,"x":1,"y":7},{"t":4,"x":8,"y":7},{"t":4,"x":1,"y":8},{"t":4,"x":8,"y":8},{"t":4,"x":1,"y":9},{"t":4,"x":8,"y":9},{"t":4,"x":1,"y":10},{"t":4,"x":8,"y":10},{"t":4,"x":1,"y":11},{"t":4,"x":8,"y":11},{"t":4,"x":1,"y":12},{"t":4,"x":8,"y":12}]} \ No newline at end of file diff --git a/Source/levels/rotate.json b/Source/levels/rotate.json index 4d1ac22..3d77086 100644 --- a/Source/levels/rotate.json +++ b/Source/levels/rotate.json @@ -1 +1 @@ -{"bigrocket":{"x":73.333333,"y":144.79638},"dimensions":{"x":22,"y":17},"rocket":{"x":300,"y":120},"rotators":[{"x":200,"y":200,"arms":5,"armlen":2,"speed":20,"middle":true}],"tiles":[{"t":2,"x":2,"y":1},{"t":2,"x":14,"y":1},{"t":2,"x":14,"y":5},{"t":2,"x":22,"y":5},{"t":2,"x":8,"y":6},{"t":2,"x":2,"y":12},{"t":2,"x":8,"y":12},{"t":2,"x":8,"y":17},{"t":2,"x":22,"y":17},{"t":3,"x":3,"y":1},{"t":3,"x":4,"y":1},{"t":3,"x":5,"y":1},{"t":3,"x":6,"y":1},{"t":3,"x":7,"y":1},{"t":3,"x":8,"y":1},{"t":3,"x":9,"y":1},{"t":3,"x":10,"y":1},{"t":3,"x":11,"y":1},{"t":3,"x":12,"y":1},{"t":3,"x":13,"y":1},{"t":3,"x":15,"y":5},{"t":3,"x":16,"y":5},{"t":3,"x":17,"y":5},{"t":3,"x":18,"y":5},{"t":3,"x":19,"y":5},{"t":3,"x":20,"y":5},{"t":3,"x":21,"y":5},{"t":3,"x":3,"y":12},{"t":3,"x":4,"y":12},{"t":3,"x":5,"y":12},{"t":3,"x":6,"y":12},{"t":3,"x":7,"y":12},{"t":3,"x":9,"y":17},{"t":3,"x":10,"y":17},{"t":3,"x":11,"y":17},{"t":3,"x":12,"y":17},{"t":3,"x":13,"y":17},{"t":3,"x":14,"y":17},{"t":3,"x":15,"y":17},{"t":3,"x":16,"y":17},{"t":3,"x":17,"y":17},{"t":3,"x":18,"y":17},{"t":3,"x":19,"y":17},{"t":3,"x":20,"y":17},{"t":3,"x":21,"y":17},{"t":4,"x":2,"y":2},{"t":4,"x":14,"y":2},{"t":4,"x":2,"y":3},{"t":4,"x":14,"y":3},{"t":4,"x":2,"y":4},{"t":4,"x":14,"y":4},{"t":4,"x":2,"y":5},{"t":4,"x":2,"y":6},{"t":4,"x":22,"y":6},{"t":4,"x":2,"y":7},{"t":4,"x":8,"y":7},{"t":4,"x":22,"y":7},{"t":4,"x":2,"y":8},{"t":4,"x":8,"y":8},{"t":4,"x":22,"y":8},{"t":4,"x":2,"y":9},{"t":4,"x":8,"y":9},{"t":4,"x":22,"y":9},{"t":4,"x":2,"y":10},{"t":4,"x":8,"y":10},{"t":4,"x":22,"y":10},{"t":4,"x":2,"y":11},{"t":4,"x":8,"y":11},{"t":4,"x":22,"y":11},{"t":4,"x":22,"y":12},{"t":4,"x":8,"y":13},{"t":4,"x":22,"y":13},{"t":4,"x":8,"y":14},{"t":4,"x":22,"y":14},{"t":4,"x":8,"y":15},{"t":4,"x":22,"y":15},{"t":4,"x":8,"y":16},{"t":4,"x":22,"y":16}]} \ No newline at end of file +{"bigrocket":{"x":73.333333,"y":144.79638},"dimensions":{"x":22,"y":17},"rocket":{"x":300,"y":120},"rotators":[{"x":200,"y":200,"arms":5,"armlen":2,"speed":2,"middle":true}],"tiles":[{"t":2,"x":2,"y":1},{"t":2,"x":14,"y":1},{"t":2,"x":14,"y":5},{"t":2,"x":22,"y":5},{"t":2,"x":8,"y":6},{"t":2,"x":2,"y":12},{"t":2,"x":8,"y":12},{"t":2,"x":8,"y":17},{"t":2,"x":22,"y":17},{"t":3,"x":3,"y":1},{"t":3,"x":4,"y":1},{"t":3,"x":5,"y":1},{"t":3,"x":6,"y":1},{"t":3,"x":7,"y":1},{"t":3,"x":8,"y":1},{"t":3,"x":9,"y":1},{"t":3,"x":10,"y":1},{"t":3,"x":11,"y":1},{"t":3,"x":12,"y":1},{"t":3,"x":13,"y":1},{"t":3,"x":15,"y":5},{"t":3,"x":16,"y":5},{"t":3,"x":17,"y":5},{"t":3,"x":18,"y":5},{"t":3,"x":19,"y":5},{"t":3,"x":20,"y":5},{"t":3,"x":21,"y":5},{"t":3,"x":3,"y":12},{"t":3,"x":4,"y":12},{"t":3,"x":5,"y":12},{"t":3,"x":6,"y":12},{"t":3,"x":7,"y":12},{"t":3,"x":9,"y":17},{"t":3,"x":10,"y":17},{"t":3,"x":11,"y":17},{"t":3,"x":12,"y":17},{"t":3,"x":13,"y":17},{"t":3,"x":14,"y":17},{"t":3,"x":15,"y":17},{"t":3,"x":16,"y":17},{"t":3,"x":17,"y":17},{"t":3,"x":18,"y":17},{"t":3,"x":19,"y":17},{"t":3,"x":20,"y":17},{"t":3,"x":21,"y":17},{"t":4,"x":2,"y":2},{"t":4,"x":14,"y":2},{"t":4,"x":2,"y":3},{"t":4,"x":14,"y":3},{"t":4,"x":2,"y":4},{"t":4,"x":14,"y":4},{"t":4,"x":2,"y":5},{"t":4,"x":2,"y":6},{"t":4,"x":22,"y":6},{"t":4,"x":2,"y":7},{"t":4,"x":8,"y":7},{"t":4,"x":22,"y":7},{"t":4,"x":2,"y":8},{"t":4,"x":8,"y":8},{"t":4,"x":22,"y":8},{"t":4,"x":2,"y":9},{"t":4,"x":8,"y":9},{"t":4,"x":22,"y":9},{"t":4,"x":2,"y":10},{"t":4,"x":8,"y":10},{"t":4,"x":22,"y":10},{"t":4,"x":2,"y":11},{"t":4,"x":8,"y":11},{"t":4,"x":22,"y":11},{"t":4,"x":22,"y":12},{"t":4,"x":8,"y":13},{"t":4,"x":22,"y":13},{"t":4,"x":8,"y":14},{"t":4,"x":22,"y":14},{"t":4,"x":8,"y":15},{"t":4,"x":22,"y":15},{"t":4,"x":8,"y":16},{"t":4,"x":22,"y":16}]} \ No newline at end of file