How to make coins attribute ?
ofekez
Member, PRO Posts: 95
Hello everyone ...
I'm making a game right now and I need to know how to make a coins actor that present the all coins that ever collected ...
Something like (Constrain attribute : Game.Coins to Game.EachGameCoins + ???? maybe ..
If someone can help me on this it will be very nice Thanks for all the nice community in this forum ...
BR,
Ofek Ezon
Comments
Instead of constraining it, why not just add the value to game.Coins whenever coins are collected?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Can you please give me example ? Because I don't know how to add a value this way ...
Hi @ofekez Yes, you've almost suggested your own solution:
Just use this when you need to update the total amount of coins:
Change Attribute game.Coins to game.Coins + game.EachGameCoins
Edit: a suggestion: make your EachGameCoins attribute a scene attribute, that way it'll always be zero at the start of each new level (presuming you mean EachSceneCoins)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Change attribute or Constrain attribute ?
Nvm ...
Basically i think it's work, but if the EachgameCoins and the Coins are in different scene?
How to make it work ?
Game attributes can be used by any actor on any scene and keep their values throughout each run of the app. If you are resetting the value of game.eachGameCoins to 0 at the start of each scene/level then you're just adding that value at some point (e.g. the end of the level) to game.Coins which retains its value throughout the game.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I've just tasted it and it doesn't worked , the reason can be the fact that i use a costume fonts to the game.Coins actor and to the game.eachGameCoins actor ?
Costume fonts or custom fonts? If you are using custom fonts then the mathematical expression may be incorrect.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'm using custom fonts ...
Can you please help me with this problem ?
Post a screenshot of your code and the error you see
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
I don't see anything ... That's the problem ...
I've make an Change attribute behavior
(game.Coins to game.Coins + game.EachgameCoins).
After that I've played the game and i looked at the Coins actor and nothing was in it ...
Here is a quick video that i just uploaded :
It looks like you have the Change Attribute and Save Attribute behaviors (at 0:37 in the video) outside of a rule. They need to be inside of a rule. If they are in a rule (I can't tell from the video and I'm not as familiar with the Windows version of Creator), what is the condition for that rule?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
There are 2 rules ...
1. The move behaviors, Particles, collision with enemy= game.gameover to 1 .
2. attribute- if game.gameover is 1 then change scene ...