[OUTDATED] Make Your Own Arduboy Game: Part 6 - Graphics!

You can do a dirty delay with delay(milliseconds);

Search for the arduino and Arduboy2 reference for help

1 Like

You could use the delay() function, but instead, what you should do is create an if statement that that changes based on a variable. We could call that variable, gamestate. If gamestate is 0 (gamestate == 0), then we want to show the text. If gamestate is 1 (gamestate == 1), then we want to display all the code that draws and handles player movement. We could also incorporate a way to change the value of gamestate with a button press. Of course, we’ll do all this inside of the loop section. Remember, the setup section is only run once and nothing stops the Arduboy from continuing on to the loop section.

Lemme know if this helps or if you need more explicit directions.

Would you mind expanding? or you can direct message

Check out my code for my super simple Rick and Morty Game: https://github.com/celinebins/RickandMortyGame

It uses the Case function to tell the code what to do next… So you get kinda like a title screen until a button (of your choice) is pressed.

A little more information in this article: https://issuu.com/arduboymag/docs/13524906647515680366/31

1 Like

GOT IT! Thank you!!!

1 Like

Make sure you check out the next tutorial. I include a bit more info about the switch keyword and how to implement this. :slight_smile:

Glad you were able to figure it out. :smiley:

1 Like

@crait Thank you very much for taking the time to post these with my ArduBoy arriving today and having little coding experience I am sure I will find the a valuable resource and point of reference.

I made a small tribute/animation game to my favorite rapper MF DOOM, called ‘DOOM BOTS’ :slight_smile:

I have no clue how to use GitHub to share it lol.

Thanks for the help!

Awesome! I hope it helps!

I don’t like GitHub because of how confusing it can be for n00bs. (I’m also a n00b. :wink:) You can always upload it with PasteBin or some other similar site.


Mmmm was going to write a simple tutorial on how to use Github for uploading your game… thought no one might want to read it… might include in Arduboy Magazine Vol 5?


Could be helpful. I am trying to figure out how I can learn music/tones at the moment

Maybe out of scope but I noticed in your list you didn’t explain what Progmem was? My understanding is that it’s the flash memory for the device?


I changed the player movement to the background movement.
Now, on the left and upper sides of the screen, sometimes some (1~7) pixels are empty. How do I solve this problem?
for( int backgroundx =playerx%8 ; backgroundx < 128; backgroundx = backgroundx + 8 ) {
//For each row in the column
for( int backgroundy = playery%8; backgroundy < 64; backgroundy = backgroundy + 8 ) {
//Draw a background tile
arduboy.drawBitmap( backgroundx, backgroundy, background, 8, 8, WHITE );

Your code has introduced this:

int backgroundx = playerx % 8

Says ‘set backgroundx to the remainder of playerx divided by 8’. I think you want:

int backgroundx = playerx / 8

which is ‘set backgroundx to the integer part of playerX divided by 8’. Likewise for backgroundy.

Great post! I found it perfect as fresh Arduboy user. Btw. it seems there is small bug in the section Control The Sprite. There are often references to palyerx instead of playerx. Not sure if it was @crait intention or not :slight_smile:

1 Like

Thanks @crait for the image converter. I had a chance to experiment with tiles and sprites of my own.

1 Like

:+1: Hope part 10’s on its way! Loving the lessons so far!

:rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light:


:rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light:

THIS TUTORIAL IS OUT OF DATE! Please check out the UPDATED version, here: Make Your Own Arduboy Game: Part 6 - Graphics!

:rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: