Fire's Time demo - errr. how to countdown instead of up
Stormtrix
Member Posts: 256
Trying to work with Firemaplegames's Time demo - http://gamesalad.com/game/play/34021
and using the custom font. But looking to just countdown from either 2min, 3min, or 5min as options and when you reach 0:00 then end game.
never worked with the 'floor' option and game.time any thoughts?
thx.
and using the custom font. But looking to just countdown from either 2min, 3min, or 5min as options and when you reach 0:00 then end game.
never worked with the 'floor' option and game.time any thoughts?
thx.
Comments
ClockAndRandom(Demo)
i can change that demo to countdown from like 2min but still not sure how to incorporate a custom font/graphic with it having seperate images for the digit locations.
hmmm.
then if there are seperate graphic digits how to make the rule of when you hit 0:00 then do something..
CodeMonkey's ClockAndRandom(Demo) will show you how to countdown from a set length of time. I think that you will need to separate out each digit and save them individually to game attributes.
So, in the equation, the part that reads:
floor(( self.MaxSeconds - game.Time )/3600)
represents the hour. The next two parts represents the minutes; and the final pair of numbers represents the seconds. You will have five game attributes.
Then, you can use Firemaplegames's Custom Font DEMO to apply a custom font to the time counting down. He provides a very good explanation of how to use it in the score_glyphs actor. You will have five glyphs on the screen, and pair up each with one of the five game attributes you created in the first step.
Good luck!
I know the answer lies in combining CodeMonkey's ClockAndRandom(Demo) and Firemaplegames's Custom Font DEMO but I'm so tired now that I won't even attempt another explanation. (I wanted to delete my last post but couldn't.)
Anybody else want to give it a try? Off to bed for me.
made a "clock" attribute that is set to 30.
made a "clock" actor that has a timer set to "every 0.01" second, change attribute of game.clock
to game.clock-0.1
try that and thanks to FMG!
Countdown Timer with Custom Fonts
Have fun!
going to may switch mine to yours nice work.
Hoping you'll get this... implemented your version of the countdown in my game and now just trying to figure when i hit pause the game.timer is still running in the background and unpausing the time just jumps to what it really is while it was paused.
trying to figure out how to capture what the game.time was at paused state and which actor to put the statement into.. after i can get that done it's submit to apple time
trying to decipher it now
He has 2 'real' attributes StartCaptureTime and CapturedTime
Pause Actor has -
For unPaused ... Change Attribute -
game.capturedtime to game.capturedtime+(game.time - game.startcapturetime)
For Paused ... Change Attribute -
game.startcapturedtime to game.time
What gets me is on the rolling time actor he has.
Display Text
floor((floor(( game.Time - game.capturedTime )%3600)/60)%10)..":"..floor((( game.Time - game.capturedTime )%60)/10)..floor(( game.Time - game.capturedTime )%10
but do i add in the 2 attributes to your demo and put instead of maxseconds, put captured time on each of the scoring_glyphs
like your first digit shows
"Scoring_"..floor(( game.maxSeconds -( game.Time - game.timestart ))%10)..".png"
hmmmm.
You need to create and capture the game.startcapturedtime attribute.
I don't think that you need to change anything in the glyphs.
In Firemaplegames's example, changing game.capturedtime to game.capturedtime+(game.time - game.startcapturetime) should make the countdown continue seemlessly afterwards. (You should make the necessary edits to conform the attribute names to what you have.)
Hope this helps
JackBQuick and FMG is my credits now.. lol.. HUGE help.. Thanks so much !!
so... pause actor
If game.pause = 0
Change Attribute --
game.timestart to game.Time +( game.timestart - game.startcapturedtime )
if game.pause = 1
Change Attribute --
game.startcapturedtime to game.time
I won't be back to my computer for another six hours. Factor in another hour for delays, etc. So, if you can wait seven hours, I'll try to update my demo.
If you have figured it out by then, please post an update.