JoBase Lessons Demos Games Reference Download
Back Next

First Steps

Welcome to JoBase! In this lesson you will learn how to create your first program. If you haven't done it already, click here to set up JoBase on your computer.

Create a file and write the following code.

import JoBase

Add some more lines, then write the code below.

import JoBase

run()

That's it for the setup! When you run the code above, a blank window should appear. Let's create an image for the content of our game.

import JoBase

image = Image(MAN)

run()

Now we can display the image. The block called def loop() is where we draw things.

import JoBase

image = Image(MAN)

def loop():
    image.draw()

run()

What if we want to give the image a tint? We can do this by changing the color attribute.

import JoBase

image = Image(MAN, color = GREEN)

def loop():
    image.draw()

run()

Finally, let's animate our image. Each loop we increase the angle by .

import JoBase

image = Image(MAN, color = GREEN)

def loop():
    image.angle += 1
    image.draw()

run()

Now we have a rotating green image! You can learn more about the Image class in the JoBase reference. Of course, you will want more than images in your games. In the next tutorial, we will see how to draw other shapes.

Back Next