From 10d4683c4f3004222c21c4a65481366dba586e92 Mon Sep 17 00:00:00 2001 From: PossiblyAxolotl Date: Sat, 14 May 2022 10:40:45 -0600 Subject: [PATCH] base anims done --- Source/Player.lua | 10 +++++----- Source/gfx/fire-table-28-42.png | Bin 0 -> 377 bytes Source/gfx/fire-table-8-6.png | Bin 137 -> 0 bytes 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 Source/gfx/fire-table-28-42.png delete mode 100644 Source/gfx/fire-table-8-6.png diff --git a/Source/Player.lua b/Source/Player.lua index 3674f34..66b15c2 100644 --- a/Source/Player.lua +++ b/Source/Player.lua @@ -15,7 +15,6 @@ local imgFire = gfx.imagetable.new("gfx/fire") assert(imgRocket) local sprRocket = gfx.sprite.new(imgRocket) local loopFire = gfx.animation.loop.new(200,imgFire) -local sprFire = gfx.sprite.new(loopFire:image()) sprRocket:setCollideRect(7, 7, 14, 14) local startpos = {x=0,y=0} @@ -39,7 +38,6 @@ function addPlayer(_x,_y,__x,__y) sprBigRocket:add() sprRocket:moveTo(_x,_y) sprRocket:add() - sprFire:add() sprRocket:setVisible(true) end @@ -69,7 +67,7 @@ local function die() end function updatePlayer() - sprFire:setImage(loopFire:image()) + sprRocket:setImage(imgRocket) if active == true then if playdate.buttonIsPressed(playdate.kButtonUp) or playdate.buttonIsPressed(playdate.kButtonA) then velocity.x = velocity.x + math.sin(math.rad(playdate.getCrankPosition())) /2 @@ -105,12 +103,14 @@ function updatePlayer() end updateExit() + if playdate.buttonIsPressed(playdate.kButtonA) or playdate.buttonIsPressed(playdate.kButtonUp) then + sprRocket:setImage(loopFire:image()) + end + sprRocket:setScale(scale,scale) - sprFire:moveTo(sprRocket.x-math.sin(math.rad(playdate.getCrankPosition())*10),sprRocket.y+math.cos(math.rad(playdate.getCrankPosition()))*10) sprRocket:setRotation(playdate.getCrankPosition()) - sprFire:setRotation(playdate.getCrankPosition()) end function updateExit() diff --git a/Source/gfx/fire-table-28-42.png b/Source/gfx/fire-table-28-42.png new file mode 100644 index 0000000000000000000000000000000000000000..46759bf1eee3ac990060d8db0e31908ab33047ec GIT binary patch literal 377 zcmV-<0fzpGP)zuu zp68gp_ujkD^Y?@-)Y7}3gVIP6^t{zcZ9Vf2 z{)LGm0bn)pq}JW@GamMUe-(mZWF`wo_BzYaFf zDdH?W`wnsy1ed*}S&geWh_m#}JLqV~wb_b8nl;bTGwr)x5V;!n}ho X?0_L@@&Fu(00000NkvXXu0mjf+1RN* literal 0 HcmV?d00001 diff --git a/Source/gfx/fire-table-8-6.png b/Source/gfx/fire-table-8-6.png deleted file mode 100644 index 2e9617900adc4c786c4fc1aad98b89b9dddbb34b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~h!3HEx)yO>uQURVWjv*3Lm-ZdxJz&7Wd_L6t zl+Mgasu2w{@AwC~2L3+v*FtAQj$sR|Sj2eRj mbE@APD>s~ZqFsLH0psUDRrjyI1GfUrX7F_Nb6Mw<&;$T7dohIo