Howdy, Stranger!

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

Question

Hello.
How can I make, that when „h“ is 1000 that h=h-h and t=t+1 turns?

Thats my code for this Question:

-- Clicker


displayMode(FULLSCREEN)
-- Use this function to perform your initial setup
function setup()
    fontSize(100)
    fill(0, 200, 255, 255)
    z=0
    h=0
    t=0
end

-- This function gets called once every frame
function draw()

    -- This sets a dark background color 
    sprite("SpaceCute:Background",512,384,1024,768)

    -- This sets the line thickness
    strokeWidth(5)

    z = z + DeltaTime

    text("Hundert: "..math.ceil(h), 500, 200)

    text("Tausend: "..math.ceil(t), 500, 300)

    text("Time: "..math.ceil(z), WIDTH/2, HEIGHT - 75)

    if h % 100 then
        h=h-h
        t=t+1
        end

end

function touched(touch)
    if touch.state==BEGAN then
        h=h+1
        end
    end
Tagged:

Comments

  • Ok... i have understand it... :)

  • Posts: 623
    @Biberjumper - run your code, suggest you put a background() colour in so that you can see the time at the top. Could you explain what your project is hoping to achieve. When h is 1000 but yet zero as h=h-h, I take it t is just a counter for the loop.
  • The Projekt is just avariable Test Projekt for me to learn it...

Sign In or Register to comment.