Results 1 to 7 of 7

Thread: Timer request for my game...

  
  1. #1
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    I made a timer to go with my game, now I'd like the timer to make collision detection go true when it reaches 0. Here's the code

    Code:
    --Timer, created by Zora 182
    red=Color.new(255,0,0)
    black=Color.new(0,0,0)
    
    proportional = Font.createProportional()
    proportional:setPixelSizes(0,25)
    
    
    --time for game
    gametimer=Timer.new()
    time=60
    gametimer:start()
    
    
    
    while true do
    --gets time
    gamestime=gametimer:time()
    -- take this out to use in game
    screen:clear(black)
    
    --tells it count down 1 second every second
    if gamestime>1000 then time=time - 1 gametimer:reset(0) gametimer:start()
    end
    
    screen:fontPrint(proportional, 220, 25, time, red)
    	screen.waitVblankStart()
    	screen.flip()
    	pad = Controls.read()
    	if pad:start() then
    		break
    	end
    end
    I'd really apreciate it if someone would tell me how to to it.
    Thanks in advance! :)


  2. #2
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    :| Come on! Anyone! My game is nearly finished for version 0.01, if you want the game, give me the timer!

  3. #3
    dracule's Avatar
    dracule is offline Senior Member -Hacks Veteran
    Join Date
    Oct 2005
    Posts
    1,447
    Rep Power
    17

    Default

    What do you mean? you want someone to die when it hits 0? or do you just want the people able to die when it hits zero?

    Fd! will forever be my hero. Please take the time to vote for my group for Ecomagination: here Thanks for voting FD., Jibbz, OGTiago, Scorpus, Jsamp, killaj

  4. #4
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    I just want it to go COLLISION DETECTION = TRUE, so that the guy in my game dies. (By the way, the guy is mario lol ;) )

  5. #5
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    I also need moving collision detections, I just want them to move back an fourth, kind of like the turtles in Super mario Bros.

  6. #6
    ST@TIC is offline -Hacks Newbie
    Join Date
    Nov 2006
    Location
    South Africa
    Posts
    39
    Rep Power
    14

    Default

    Dude not to sure what you want but from u want the guy to die when the timer hits 0 right???
    if so i think you just put this code in

    if gamestime = 0 then COLLISION DETECTION = TRUE end

    Hope it helps

    \"Death be not proud, some have called thee mighty and great, thou art not so\"

  7. #7
    Zora 182 is offline -Hacks Enthusiast
    Join Date
    Jun 2006
    Location
    Hyrule Rank:Hero
    Posts
    418
    Rep Power
    14

    Default

    ... Hmm, I think I tried that before, but I'll try it again. Thanks! ;)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •