score question
Hi all,
I'm working on a game where you score points when you land on a platform,but I need it to only register once,so if you land on it again it doesn't score again. I tried with a boolean but it registers the score twice.
I know this is basic stuff but my brain isn't working today.
Cheers.
I'm working on a game where you score points when you land on a platform,but I need it to only register once,so if you land on it again it doesn't score again. I tried with a boolean but it registers the score twice.
I know this is basic stuff but my brain isn't working today.
Cheers.
It’s not a bug – it’s an undocumented feature
Comments
if actor collides with Player
if self.touchingPlayer is false then
increase the score
change self.touchingPlayer to true
otherwise set self.touchingPlayer to false.
Haven't tested this...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You could add a self.touchingPlayer boolean to the platform actor and then in its rules do:
if actor collides with Player
----->if self.touchingPlayer is false then
---------->increase the score
---------->change self.touchingPlayer to true
otherwise set self.touchingPlayer to false.
Haven't tested this...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah this is kinda what I have and the platforms keep duplicate scoring.
It’s not a bug – it’s an undocumented feature
when player overlaps/collides with platform … works
in this scenario, it should be when platform overlaps/collide with player
thus the platform should change the score
on platformActor … add attribute booleanType
Attribute: scoreDone (leave unchecked)
Rule: when
Event: overlaps/collides with player
--Rule: when
--Attribute: self.scoreDone = false
--changeAttribute: game.Score To: game.Score+1
--changeAttribute: self.scoreDone To: true
@};- MH
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User