JoBase Home Lessons Games Reference

Welcome! This lesson will help you to get familiar with the basics of JoBase. Run the code snippet below to get started.

Every project you make in JoBase needs the following line of code which imports the JoBase programming tools. When you run the code, a message will appear in the console. This means that it has worked.

If you want your app to continue running, you need to write run() at the bottom. Now we are ready to draw things on the screen.

How do we draw things on the screen? First, we need a loop - a block of code that runs over and over. Then we draw our things inside the loop.

Before we can draw something we need to create it first. The code below loads an image outside the loop. Then the image is drawn within the loop.

What if we want a different image? Change the image name from MAN to ENEMY.

Good job! Now we have a different image.

JoBase has a small selection of images. If you want your own, you can supply a file path instead. This will be explained later.

Now let's rotate our image by changing the angle.

What if we want the image to rotate with an animation instead? This is where we use the game loop. Each loop, we increment the angle of our image by 2 degrees.

Can you make it spin faster?

Now you know the basics of coding in JoBase!

In this lesson we used the game loop to draw and animate an image on the screen. The principle of a game loop is used in all modern games.