Creating a coin counter
I am trying to make a coin meter so that when the player touches a coin, the coin meter will go up +1
Can anyone help me with this?
Can anyone help me with this?
Comments
rule:
in actor of coin:
when touch is pressed change attribute to +1...
---------
Have a separate actor.. a coin image... then but eth "replicate" behavior into the coin image and ask it to replicate the coin meter attribute..
Here I made ya a cool template: http://www.mediafire.com/?9cr4j01y8mf14iq
Thanks,
Hope this helps,
Jack
Which actor should I set up the attribute in?
I think when he says: "when the player touches a coin" he means "when the ACTOR touches a coin" . . . . ?
http://www.mediafire.com/?9cr4j01y8mf14iq
http://e.gamesalad.com/play/75279
If that makes sense.
Just realized other people already gave you this advice. What are you having trouble with?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
What I want to happen is that when the Coin actor is touched by the player's actor, then the # of coins on the homepage goes up +1
BTW you guys have some awesome advice, but I'm not quite sure how to implement them in my project
(2) In the Coin actor's rules, add a rule that says If actor overlaps or collides with Player then Change attribute game.Coins to game.Coins+1. Optionally, add a Destroy actor behavior.
(3) Create a new actor called CoinMeter. Change its size to 20 width and 20 height. Choose a color for the actor. On the homepage, add the CoinMeter actor to the scene (for example, at the bottom near the center).
(4) In the CoinMeter actor's rules, add a Replicate behavior with a direction of 0, copies equal to game.Coins (select this from the expression editor by clicking the small e button), and spacing equal to 20.
(5) Preview your game, collect a few coins, and then take a look at the CoinMeter actor on the homepage to see if it has grown larger. If not, go back and add a Display Text behavior to the CoinMeter actor with Text set to game.Coins (again, use the expression editor). Be sure to set the text color to something other than the actor's color. Preview again, collect some coins, and check to see what number is appearing on the CoinMeter.
If you still can't get it to work, tell me which numbered step above you don't understand and what happened when you tried that step. Also, how are you getting from the play scene (with the Player and Coins) to the homepage? Are you doing a Change Scene behavior, a Pause behavior, or a Reset Game behavior? And have you tried following the steps above but adding the CoinMeter to the play scene and seeing if it works correctly when your player collides with a coin? Finally, if you click on the Home button while editing your game, how many scenes do you have? What are they called?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You can also post a link to your game project file (use a Dropbox public link or mediafire or another upload site) so I can take a look at it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have the "Start game" icon on the homepage with the "Change Scene" behavior set to the Game/play screen
I currently have 6 Scenes (Title/homepage, Game screen, Options screen, Shop screen, Languages, and My items.
And to get the "Display text" behavior visible, do I need to add a text box?
Sorry if I got you frustrated, I'm just trying to get everything to work right.
the computer runs the rules/behaviors in a linear flow
it will NOT process anything in an actor … after an actor us destroyed
@};- MH
/Users/timtoccalino/Desktop/DDS.gameproj
Also we cant download a project off your desktop
THANK YOU EVERYONE FOR YOUR HELP AND BEING PAITIENT WITH ME
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User