In the "Lua" folder is the super basics, each with their own example "in a vacuum" (drawing text, getting button presses, drawing an image, etc.) - and same for the "C" folder, though I have fewer examples there.
In the "Demos_Lua" folder I have some bigger examples, such as a sample Brick Breaker game, a Pickin' Sticks game, a Space Invaders style game, and an example of a state changer / menus.
All of it is free to use for whatever reason. Just thought I'd post it here!
Hi!
Thanks for all these examples, they are great! I am using the Panorama example and I would like to toggle between two images by pressing A and B. Here is my code but it doesn't work, do you have any idea what the problem is? Thanks a lot!
Returns true for just one update cycle if button was pressed.
So what you could do is set a variable in your button checking if statements and then draw the background outside of those if statements.
I'd even go so far as setting a current background variable to the one that corresponds to the button that was just pressed.
Kind of thing
if playdate.buttonJustPressed("B") then
activebackground = background
end
if playdate.buttonJustPressed("A") then
activebackground = background2
end
activebackground:draw(0, 0)
Hi @matt
thank you very much for your answer! I'm not sure I understand your example. I replaced my code with yours but it doesn't work. I think I didn't understand how to adapt it.
thank you very much for your help! Your code works, I just adapted it a little bit because the crank was not scrolling the image correctly anymore. I put here the final code that works as I want
Thanks! Sorry I missed these replies and thanks to Matt for the responses. I've been busy with the semester beginning and making sure my students are getting all set up correctly. ^_^;;