Wiki

Clone wiki

Core / kidfill

After blowing bubbles our code looked like this:

-- Use this function to perform your initial setup
function setup()
    spx = 100 -- Spritey x
    spy = 100 -- Spritey y
    print("Hello World!")
    print("Look at me go!")
    parameter.watch("spx")
    parameter.watch("spy")
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 + Gravity.x
    spy = spy + Gravity.y
    tint(0, 255, 0, 255)
    sprite("Planet Cute:Character Boy",spx,spy,101/2,171/2)
    ellipse(200,100,100,100)
end

function touched(touch)
    spx = touch.x
    spy = touch.y
end

Just like when we made zombie Spritey, we are going to add some color in the bubble.

Add this line here:

    sprite("Planet Cute:Character Boy",spx,spy,101/2,171/2)
    fill(0,0,255,255)
    ellipse(200,100,100,100)
end

Those numbers make it blue, and just like with tint, you can pick any color you want by touching the yellow part of those numbers.

Should we try a square bubble?

Updated