I really need help [learning to code]! >-<

So I want to create an mini rpg battle-style game (sort of like EBF), but being new to the language used for Arduboy (it’s C++, right?) I can’t really do much. I was wondering if anyone is up for helping a newbie get used to this new coding language?

1 Like

Let’s do it!

Can you tell us first of all if you have an Arduboy and what Operating System you are using? If you do have an Arduboy, start by downloading the Arduino IDE and following our Quick Start Guide to get setup.


OK! I am using a Windows 7 (might update it to Windows 10 soon), and I am not 100% sure what my Arduboy version is, but if this helps it’s Kickstarter edition.

1 Like

Creating RPG? It’s cool!

Please try this. You can describe a painting for Arduboy easily :smiley:

Please refer to this as a reference article for developers.

1 Like

Have you installed the IDE @Cyndelia?

Yes I have, and I’ve begun fiddling with some of the functions and such so I know what some things do already.

Thanks so much! This has helped me kickstart (lol sorry I love that word) my development! The only thing is, I still need to know how to draw the sprites in, but I’m sure that isn’t to hard, right?

I’ve also got a picture of my first sprite! I can’t decide if I want him to be the player character, or an enemy…

I hope he looks ok; :stuck_out_tongue:


Hello, Please check this! :smiley:

1 Like

Thanks! The thing is, how do I get the bitmaps (or sprites) into the sketch?

I did a display test. please try it! :smiley:
…I made a mistake. Not enough one dot

#include “Arduboy.h”

Arduboy arduboy;

PROGMEM const unsigned char f[] =
0x00, 0x00, 0x00, 0x80, 0x00, 0x78, 0x78, 0x68,
0x78, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x73, 0x4b, 0x67, 0x14, 0x0c,
0x14, 0x67, 0x4b, 0x70, 0x40, 0x00, 0x00, 0x00,

void setup() {
//arduboy.drawBitmap(0, 0, f, 8, 8, WHITE);
arduboy.drawBitmap(0, 0, f, 16, 16, WHITE);
//arduboy.drawBitmap(0, 0, f, 32, 32, WHITE);
//arduboy.drawBitmap(0, 0, f, 64, 64, WHITE);
//arduboy.drawBitmap(0, 0, f, 128, 64, WHITE);

void loop() {


Oohhh, that’s how you do that. Thx so much! this will help a lot!

1 Like

Hey, I’m having trouble with variables. I can’t seem to completely understand how they work. Could you help me out?

Also, how do you convert an integer to a string?

Hey! Looks like you’re jumping into coding the same way that I did. I wrote a post describing the very basics of variables for you. I know it’s a lot of reading, but I made sure to explain them as simple as possible. :slight_smile:

Variables are way to ‘hold’ data for your program. In many languages, certain variables are restricted to what kind of data they can hold. In C/C++, you can store numbers into integers (int), for instance, or letters into characters (char). You can make it hold data, then retrieve it later to manipulate things with. Lemme give you an example.

int firstvalue = 10;
int secondvalue = 20;
int thirdvalue = 30;
firstvalue = 2;
thirdvalue = 52 + 5 - 9;
firstvalue = thirdvalue + secondvalue;
firstvalue = firstvalue + 1;

In the example above, I initiated the variables named firstvalue, secondvalue, and thirdvalue. Initiating variables is pretty much creating them and telling the computer what to store into them. For instance, firstvalue holds the number 10.

If I didn’t want it to be 10, I could assign it another value. Assigning a value means that you are storing new data into it. You can see that I store 2 into firstvalue using the equal sign.

You can also evaluate mathematical values and store those into variables. Notice how I store 52 + 5 - 9 into thirdvalue. If I were to ask the computer how much thirdvalue has, it would tell me 48!

Next, take a look at the next line… In firstvalue, I store the value of thirdvalue plus secondvalue. If I were to ask the computer what the value of firstvalue is, it would tell me 68 since 48 + 20 is 68!

You can even use the same variable when assigning values! Notice the last line uses firstvalue on both the left-hand and right-hand side of the equal sign. This line of code is actually increasing the value of firstvalue by 1. The computer looks at the right-side of the equal sign and figures out what firstvalue + 1 is equal to. After that, it stores it into firstvalue.

Besides just storing data into variables, you can also ask the computer to evaluate them. There are several types of ways to do this, but let me just give you the most basic example… Let’s say that you have a video game that is like Galiga. You might have some code like this:

if( level < 4 ) {
	speed = 1;

if( level == 4 ) {
	speed = 3;

if( level > 4 ) {
	speed = 5;

Whenever code is being run by the computer, it can check the data inside of variables. This code would change the speed of your rocket ship that is stored in the variable called speed by checking which level you are on, which is stored in a variable called level. The way you can do this is by running certain lines of code, depending on the value of variables.

In C/C++, and many other languages, you can use the if statement to check the value of something. If the value is correct, then you run the code, but if it isn’t, then you skip the code. The lines of code that will be run are inside of the { braces } right after the if statement. The value that you are checking to be true or not is inside of of the ( parentheses ).

The first line of code says, if the value inside of level is less than 4, then make speed equal to 1.

That means if you’re on the first few levels, your ship will be moving with a speed of 1.

If you want to see if the player is on level 4, then you need to compare level and 4, you have to use the double-equal sign (==) since the single equal sign is what we use to save a value. Look at the next if statement. It says, if the value of level is equal to 4, then we will set speed to 3.

This means that once you get to level 4, you’ll be moving a bit fast!

Take a look at the last if statement. What do you think that means? if the value inside of level is greater than 4, then make speed equal to 5. This means once you get past level 4, your ship will be moving a lot faster.


Thank you! The thing is, I can’t seem to get the variables to work the way I want them to. I need to convert an integer to a character for an animation, but there doesn’t seem to be a simple or working way for Arduboy. Do you know how I could do that?

1 Like

Because I do not have an Arduboy, I cannot give you a guaranteed answer of how the best way to handle string manipulation… But… A string is a collection of characters, so it can be used to form a sentence and some words and put them onto the screen. Technically speaking, characters are integers. This means that anything you are wanting to do with a character, you can do with an integer. Do you mind telling me why you would need a string to handle animation? Maybe you can do it with integers instead.

What I’m doing is I’m just having the animation on a loop, and to determine which frame of the animation to draw I have set up a variable that changes by one every 3 frames and then resets after a number of frames, and so I just add the frame variable to the name of the animation. But it can’t just convert int to str, so I thought I needed to do that. Any ideas on how to fix it or change it?

Hmmm… It’s hard to visualize what you mean without seeing the code, but if I’m understanding correctly, you definitely would want to use integers for this instead of strings. String manipulation can slow your code down and uses a lot of memory. (Normally, this wouldn’t be too bad, but the Arduboy is very limited.)

I imagine just having a counter variable that checks the frames. Every frame, increase it by 1. If the integer is 3, then set the counter to 0 and increase a frame variable. The code could look something like this…

counter = counter + 1;
if( counter == 3 ) {
	counter = 0;
	frame = frame + 1;
	if( frame > 4 ) {
		frame = 0;

the thing is, I don’t know how to make “frame” actually be my frames, I was just using “frame” as a counter.