Actor comes after a particular score
deepanshi gupta
Member Posts: 63
Hello Everyone , I want to add a functionality in my game that an actor which will come after 200 points and then dissapears . It will come in the same way after every 200 points like on 200 then 400 etc and dissapears every time . My score is saved at every minute in game . How should I do this ?
Comments
How does the score increase in your game? By ones, by tens, by random numbers? The solution to this depends somewhat on your answer to that. Will the player always reach every multiple of 200.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes player reaches every multiple of 200 then it comes @tatiang . How?
The way I would do that is create another attribute called control for example than set it to 200 and make a rule saying when score = control spawn actor and change control to control + 200
@deej011 Thankyou but its not working. I set an attribute named control to 200 and when game.score=game.control then my actor changes random position .
my second rule is when another actor collide with my this actor so it should be dissapeared and comes after 400 points but it is not disspaering it appears after ever second randomly
Are you using a Mac or PC? There are slightly different ways to do this on each but both involve using the mod() function to determine multiples of 200.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I am using mac @tatiang
I'll move this to the Working with GS (Mac) subforum since it's not a Tech Support question. Here's the rule you would use:
When Numeric Expression mod(game.score,200) = 0
Spawn Actor
The mod() function returns the remainder of a division problem. So that rule will trigger when game.score/200=0 with 0 remainder (e.g. 0, 200, 400, 600, etc.). If you don't want it to trigger when game.score=0, add a rule condition that says When Attribute game.score > 0.
You said you want the actor to disappear so you have a few options for that (Destroy, Move off screen, Interpolate self.Color.Alpha to 0, etc.) but you'll probably want a Timer in that actor to handle that.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang thankyou for this i did the same but when i test my game the actor sometimes comes on multiple of 200 and sometimes it is not coming at all . can you help me regarding this ?