add aseprite into the mix

This commit is contained in:
Fabien Freling 2025-03-07 13:59:22 +01:00
parent e75cc60376
commit 5affd98436
4 changed files with 6 additions and 11 deletions

View file

@ -23,9 +23,8 @@
nativeBuildInputs = [ nativeBuildInputs = [
just just
lua-language-server lua-language-server
nushell
pixelorama
playdate-sdk-pkg playdate-sdk-pkg
tup
]; ];
}; };
}; };

View file

@ -8,6 +8,5 @@ alias s := simu
simu: build simu: build
PlaydateSimulator {{ bin }} PlaydateSimulator {{ bin }}
alias pxl := pixelorama cook-assets:
pixelorama: @(which aseprite > /dev/null) || (echo "Missing aseprite program"; exit 1)
pixelorama

BIN
src/img/level_01.aseprite Normal file

Binary file not shown.

View file

@ -19,10 +19,6 @@ function gameInit()
atlas = gfx.imagetable.new("img/bg_atlas") atlas = gfx.imagetable.new("img/bg_atlas")
end 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() gameInit()
function playdate.update() function playdate.update()
@ -31,17 +27,18 @@ function playdate.update()
-- Note that it is possible for more than one of these directions -- Note that it is possible for more than one of these directions
-- to be pressed at once, if the user is pressing diagonally. -- to be pressed at once, if the user is pressing diagonally.
local speed = 5
if playdate.buttonIsPressed(playdate.kButtonUp) then if playdate.buttonIsPressed(playdate.kButtonUp) then
playerSprite:moveBy(0, -2) playerSprite:moveBy(0, -2)
end end
if playdate.buttonIsPressed(playdate.kButtonRight) then if playdate.buttonIsPressed(playdate.kButtonRight) then
playerSprite:moveBy(2, 0) playerSprite:moveBy(speed, 0)
end end
if playdate.buttonIsPressed(playdate.kButtonDown) then if playdate.buttonIsPressed(playdate.kButtonDown) then
playerSprite:moveBy(0, 2) playerSprite:moveBy(0, 2)
end end
if playdate.buttonIsPressed(playdate.kButtonLeft) then if playdate.buttonIsPressed(playdate.kButtonLeft) then
playerSprite:moveBy(-2, 0) playerSprite:moveBy(-speed, 0)
end end
-- Call the functions below in playdate.update() to draw sprites and keep -- Call the functions below in playdate.update() to draw sprites and keep