Need some help with Score/time keeping
MichaelSilliman
Member Posts: 31
So I'm making a shoot em up game, and I have a few questions about score/time keeping.First, I made a working timer, but when my guy dies and the game resets, the timer is still going. I need to know how to make the timer reset every time the game/scene resets. I would also like to know how to keep score of how many guys he hits, which leads me to my last question. How do I make it so it counts how many bullets he has left, and when he runs out he can't shoot anymore? Thanks for taking the time to read my questions and hopefully someone can answer them. Thanks
Comments
So far as resetting the score, you need to have a game attribute which is an integer. Set it to 0 and in your game rule where you die, do a change attribute of game.Score to 0
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
In my opinion, you should read the cookbook. (http://cookbook.gamesalad.com/tutorials)
Then read the descriptions of the behaviors in the creator.
Download and look at how things are done in free templates.
Learn the basics first as it will save you a lot of time.
Posting to the forums and waiting for responses will take longer than if you "know" how to do it.
Once you have learned enough to have a reasonable place to start experimenting, and answering your own questions, you will be able to pick up the pace...
I mean no offense... it's just... teach a man to fish... ya know.
In your actor that shoots bullets, add the condition When attribute game.bulletCount < game.maxBullets to whatever rule condition you already have.
In your bullet actor, add a Change Attribute behavior at the top of its rules and change game.bulletCount to game.bulletCount + 1. When you destroy a bullet (in that actor or another actor, such as when a collision happens), change game.bulletCount to game.bulletCount - 1. You may also need to create a rule for when the bullet is off-screen (either based on self.Time or self.positionX/Y) and subtract one from the bullet count there are well.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User