Tshirtbooth Template Time Based Score
Hey there everyone,
So in my latest game, I got Tshirtbooth's "Awesome Cool Menu Template." However, instead of having how many stars you get based off of how many stars you collect, I want it to be based off of how quickly you can beat the level.
I can think of a few different ways to do this, but I would like to know the most memory efficient way....
1) I could say every 0.1 seconds change attribute game.suggtime to game.suggtime-0.1
When game.suggtime ≥ x get 3 stars
When game.suggtime is xy>z get 2 stars
When game.suggtime is ≥ z get 1 star
3)Any other ideas!!
Which one would be the most memory efficient?
Thanks a bunch guys,
-Henry
So in my latest game, I got Tshirtbooth's "Awesome Cool Menu Template." However, instead of having how many stars you get based off of how many stars you collect, I want it to be based off of how quickly you can beat the level.
I can think of a few different ways to do this, but I would like to know the most memory efficient way....
1) I could say every 0.1 seconds change attribute game.suggtime to game.suggtime-0.1
When game.suggtime ≥ x get 3 stars
When game.suggtime is xy>z get 2 stars
When game.suggtime is ≥ z get 1 star
3)Any other ideas!!
Which one would be the most memory efficient?
Thanks a bunch guys,
-Henry
Comments
I would use sceneAttributes to track the starCount for each level
add a starCount attribute index type =1
add a greatTime attribute and make it = what you think should be worth 2 stars
add a goodTime attribute and make it = what you think should be worth 1 stars
then Rules on your actor that shows level completed
when:
Attribute: scene.Time < scene.goodTime
--changeAttribute: scene.starCount To: 2
Rule: when
Attribute: scene.Time/2< scene.greatTime {or mayhap scene.Time -(scene.Time/3) }
--changeAttribute: scene.starCount To: 3
changeAttribute: game.Level#Stars To: scene.starCount
show starCount
changeScene
@};- MH
However I only want the time to be counted from when touch is pressed until it collides with the goal.
Sorry I left that out in my first post...
then you do an attribute real-type … myTime
and on the thingy the Player touches:
Rule: when (All)
touch is pressed
Attribute: self.Position.X < scene.goal.Position.X-(scene.goal.Size.Width/2) …or if you want to keep this unlocked prototype … put in the number)
--Timer: Every 1 second
--changeAttribute: game.myTime To: game.myTime+1
@};- MH