for every 10 attribute add 1 attribute
sveideinc
Member Posts: 14
i have made a game where you fly up. and i made a hight score keeper. So for ever 10 attribute of height add 1 to money ?
is this possible ?
please help me
is this possible ?
please help me
Best Answers
-
MotherHoose Posts: 2,456you want the computer to store the last Y position where you added to the money
add an attribute to the flyingPlayer … index … name last$Y (or anything you like)
1st behavior in flyingPlayer … changeAttribute: self.last$Y To: self.Position.Y
Rule: when
Attribute: self.Position.Y ≥ self.last$Y+10
-changeAttribute: game.Money To: game.Money+1
-changeAttribute: self.last$Y To: self.Position.Y
MH -
tatiang Posts: 11,949You could also use Constrain Attribute game.money to floor(game.height/10).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
MotherHoose Posts: 2,456@tatiang … that will subtract from game.money when flying downward
… which may be what @ sveideinc wants
MH -
tatiang Posts: 11,949
@tatiang … that will subtract from game.money when flying downward
Yep, two good ways to set it up, depending on how it's intended to work.
… which may be what @ sveideinc wants
MH
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User