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<-Az{m&^WDsBwKoO=E=Qs-k!>^AVU|TsD7#PGD z7#P?Uz*Ztz!NttLzyfw10|NsiBO?ief`WpgqN0+LlCrY0ii(P=s;Zirn!38WhK7cwrlyvbmbSLGj*gD5uCAV* zp1!`mfq{Xcp`nqHk+HF{iHV7+si~QnnYp>Sg@uKsrKOdXm9@3Cjg5`1t*xD%oxQ!i zgM)*kqob3Ple4q4i;Ih^tE-!vo4dQahlhu!r>B>fm$$dKkB^V9udkn*CP;hW?NJvO%XlPhiSa^7NL_|bnWMouSRCIK7OiWB{Y;0UyTzq_dLPA1fVq#KK zQgU)~N=iygCvu5quwd>ZcTfct&h7B7wZrr$O)27XvH*eXp zW$V_h+qP}nzJ2?S9XodJ+_`JluHCzL@7c3w@7}%p_U+rhfB%642M!)Qc<9if!-o$a zIdbIa(WA$X9Xo#f_=yuIPM$n@>eQ*zr%#_bbLQ;Xv**s8JAeNCg$oxhUc7ke(xuCn zFJHNGeZ{)uV24;^XBc_x9{G)d;k9ZhYuez81B0>x zC~L5RvH}AGg93vBEN6g(!B~JHBr_+qIJHC}C$%g!N5Q~QoPmL%Voq{`1nc4ik)EbN z11`6N9?T3J3=E81AVa`LB3Mcc3=Av^{9wZ%#D4|`1}+At#N_PsqWsdl6lJgqW(FpR zGy?+zNCi9C;@rdnkmzd$1_oBJ!3+%l;p#voO~stI2Ms}){Lq4bE7RHP7l4!xO>D=U IJKgpe0N%=}{{R30 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