Wiki

Clone wiki

Core / kidprint

After we got Spritey to move I left my code 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)
    spx = spx + 1
    spy = spy + 1
    sprite("Planet Cute:Character Boy",spx,spy)
end

To have Spritey speak add this:

print("Hello World!")
print("Look at me go!")
end

Print can also do math like this:

print("Hello World!")
print("Look at me go!")
print(1+1)
end

Now this will slow things down but you can print in draw() as well.

spy = spy + 1
print(spy)
    sprite("Planet Cute:Character Boy",spx,spy)
end

This shows how high Spritey is.

Time to make Spritey Grow

Updated