Give Stars On Time
In my game I dont have any stars which my actor have to collect. I want to give maximum 3 stars.
How do I give stars on time base? if yes how do I calculate that? Please let me know.
How do I give stars on time base? if yes how do I calculate that? Please let me know.
Comments
Suppose Car coming from left side and its collide with petrol tank and blast.
1) Duration on car with collide with petrol tank is less then 5 seconds that time I want to give 1 star, and between 5-10 seconds I want to give 2 stars and more then 10 seconds I want to give 3 stars
2) After level complete I want to display those stars on level complete screen and in levels screen.
3) Also suppose first time I got 3 stars in 1st level and when I am playing that level again and if I got 2 stars it will consider best game play only means display 3 stars in levels and showing 2 stars in level complete screen.
Please help me out.
I would make 2 real attributes (game.LevelTime, game.FinalTime). When the player starts do a change attribute;
Change Attribute game.LevelTime to game.Time
When level is over, Change attribute Game.FinalTime to game.Time-game.LevelTime
This will give you the amount of time it took the player to finish the level or scene.
If you're wanting this to be based on each actor that it collides with, then put that change attribute on each actor.
------------------------------------------------------------------------------
How do I create this rules.
Suppose Car coming from left side and its collide with petrol tank and blast.
1) Duration on car with collide with petrol tank is less then 5 seconds that time I want to give 1 star, and between 5-10 seconds I want to give 2 stars and more then 10 seconds I want to give 3 stars
2) After level complete I want to display those stars on level complete screen and in levels screen.
3) Also suppose first time I got 3 stars in 1st level and when I am playing that level again and if I got 2 stars it will consider best game play only means display 3 stars in levels and showing 2 stars in level complete screen.
Please help me out.
We'll do it slightly differently.
Create a game.attribute that's an integer; call it game.Level1Stars
Use two real attributes on the car. One called self.LevelTime and one called self.FinishTime (or call it whatever you want).
Have a change attribute on the car;
Change Attribute self.LevelTime to game.Time
Use a rule;
When car collides/overlaps with petrol tank
Change Attribute; game.FinishTime to game.Time-self.LevelTime
Rule (within the above rule)
If self.LevelTime is < 5 then DO BEHAVIORS FOR GIVING ONE STAR.
Change Attribute game.Level1Stars to 1
Rule: above top rule, but not within above rule;
If self.levelTime is > 5 & < 10 then DO BEHAVIORS FOR GIVING TWO STARS
Change Attribute game.Level1Stars to 2
Rule: in top rule, but not within above two rules;
If self.LevelTime > 10 then DO BEHAVIORS FOR GIVING THREE STARS
Change Attribute game.Level1Stars to 3
The BEHAVIORS FOR STARS are up to you. They could be display image, the could actually relate specifically to a game.attribute (as I've detailed above).
If you want to drop some money, go over to gshelper.com and TShirtBooth is selling a template specifically for the "Star awards"
Based on above, for number 3), put in additional rules. On the Rules add a line in the rule identifier such as; If self.levelTime > 5 & < 10 & game.Level1Stars is NOT < 2