From 5affd98436f04c0fcfca088abc54057977dc9d69 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 7 Mar 2025 13:59:22 +0100 Subject: [PATCH] add aseprite into the mix --- flake.nix | 3 +-- justfile | 5 ++--- src/img/level_01.aseprite | Bin 0 -> 1351 bytes src/main.lua | 9 +++------ 4 files changed, 6 insertions(+), 11 deletions(-) create mode 100644 src/img/level_01.aseprite diff --git a/flake.nix b/flake.nix index 76db40b..e3cc328 100644 --- a/flake.nix +++ b/flake.nix @@ -23,9 +23,8 @@ nativeBuildInputs = [ just lua-language-server - nushell - pixelorama playdate-sdk-pkg + tup ]; }; }; diff --git a/justfile b/justfile index 04d0f73..5ca317c 100644 --- a/justfile +++ b/justfile @@ -8,6 +8,5 @@ alias s := simu simu: build PlaydateSimulator {{ bin }} -alias pxl := pixelorama -pixelorama: - pixelorama +cook-assets: + @(which aseprite > /dev/null) || (echo "Missing aseprite program"; exit 1) diff --git a/src/img/level_01.aseprite b/src/img/level_01.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..0e0c3dc0b35fa5cafe44ba6a2d613c6f763e9516 GIT binary patch literal 1351 zcmZ=~Wng%)l#yWq;|B%-21W)3h7=%10*s6xL7QQ86(wadB}82?p;^z`(MjEv08%&e@e?Ck8EoSfX;+`PQJ{QUfaf`Y=r!lI(0;^N|xl9JNW z(z3F$^78VEii*n0%BrfW>gwv6nwr|$+Pb>B`uh5YhK9z*#-^sG=H}*>mX_Am*0#2` z_V)IUj*iaG&aSSm?(XiMo}S*`-oC!R{{H?66DCZYIC0XXNs}i}o-$?1)TvXaO`A4- z`t%tyX3U&9bJna`vuDqqGiT1+xpU{un>T;{`~?dZEL^y7(V|6*7cXA2WXaN{OP4KM zwtV^W6)RS(T)A@9s#U93uU@le&DynV*R5N(e*O9l8#Zj*xN*~_O`A7w-m+!O)~#E& zZQHhe`}Q3>cI@1_bJwn2yLa#2vuDrVy?giV+qZxJ{sRXN96WgN(4j+z4<9~qgPoF(|_Wb$t7cXACeEIU#t5>gIzkc)P&D*zc-@SYH{{8z8A3l8i`0>-HPoF=3 z{_^F^*RNl{ef#$P`}ZF|e*FCT^VhFmzkmP!^XJdszkmPz`}hC<|6pJSP*wnC4K^SK zh+>|l#?6AM71 tuYs6V0mNcp_zzbHDrqX_ygg_La`d4E|5m26)h_@k8JfV3Id{74F#z7mss8`~ literal 0 HcmV?d00001 diff --git a/src/main.lua b/src/main.lua index 2717867..98db2ae 100644 --- a/src/main.lua +++ b/src/main.lua @@ -19,10 +19,6 @@ function gameInit() atlas = gfx.imagetable.new("img/bg_atlas") end --- Now we'll call the function above to configure our game. --- After this runs (it just runs once), nearly everything will be --- controlled by the OS calling `playdate.update()` 30 times a second. - gameInit() function playdate.update() @@ -31,17 +27,18 @@ function playdate.update() -- Note that it is possible for more than one of these directions -- to be pressed at once, if the user is pressing diagonally. + local speed = 5 if playdate.buttonIsPressed(playdate.kButtonUp) then playerSprite:moveBy(0, -2) end if playdate.buttonIsPressed(playdate.kButtonRight) then - playerSprite:moveBy(2, 0) + playerSprite:moveBy(speed, 0) end if playdate.buttonIsPressed(playdate.kButtonDown) then playerSprite:moveBy(0, 2) end if playdate.buttonIsPressed(playdate.kButtonLeft) then - playerSprite:moveBy(-2, 0) + playerSprite:moveBy(-speed, 0) end -- Call the functions below in playdate.update() to draw sprites and keep