Wiki

Clone wiki

Core / kidmd

After we made X mark the spot Spritey's code look like this:

-- Use this function to perform your initial setup
function setup()
    spx = 100 -- Spritey x
    spy = 100 -- Spritey y
    print("Hello World!")
end

-- This function gets called once every frame
function draw()
    -- This sets the background color to black
    background(0, 0, 0)
    -- Do your drawing here
    sprite("SpaceCute:Background",374,374)
    sprite("Planet Cute:Character Boy",spx,spy)
end

Now add this line

sprite("SpaceCute:Background",374,374)
spx = spx + 1
sprite("Planet Cute:Character Boy",spx,spy)

Spritey is moving!

If you let him go he will go right off the screen and keep going.

You can make him go faster if you make the number bigger.

spx = spx + 2

You can also make him fly like this:

spy = spy + 1

Spritey now wants to say something.

Updated