Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help, I'm new

edited July 2013 in General Posts: 29

I'm new to codea and I'm trying to test things out, I'm currently trying to get this script to work. Can someone help?

--# Main
-- Space

-- Use this function to perform your initial setup
function setup()
    print("Game Loaded")
    Heath = 100
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    if heath == 100 then
        sprite("Space Art:Red Ship",100,100)
    else
        sprite("Space Art:Red Ship Damaged",100,100)
end
end

Comments

  • edited July 2013 Posts: 391

    Hi @Mason and welcome! You made a simple mistake here. Variables are case-sensitive, so either change heath in draw to Heath or change Heath in setup to heath.

    Edit: also looks like you commented out the setup() function and the start of the draw() function.

  • Posts: 29

    Thanks, it works now!

Sign In or Register to comment.