Score keeping help
Hi all,
I have been trying to add score in my game that makes sense. I have an actor that goes across the scene. The scene is 3000 pixels in width, I want the score to account for the distance travelled by my actor.
For e.g. If my actor travels 400 pixels across within the scene, I want the score to change to 40 metres.
I have used constrain attribute game.score to scene.camera.orign.x. The problem I am having is that when my actor goes across to 400 pixels, the score will change to 400 but when my actor goes back in the scene to 200 pixels, the score will change to 200. I don't want the score to decrease.
Hope this makes sense
Thanks in advance
I have been trying to add score in my game that makes sense. I have an actor that goes across the scene. The scene is 3000 pixels in width, I want the score to account for the distance travelled by my actor.
For e.g. If my actor travels 400 pixels across within the scene, I want the score to change to 40 metres.
I have used constrain attribute game.score to scene.camera.orign.x. The problem I am having is that when my actor goes across to 400 pixels, the score will change to 400 but when my actor goes back in the scene to 200 pixels, the score will change to 200. I don't want the score to decrease.
Hope this makes sense
Thanks in advance
Comments
for the forward motion:
you will need an actorAttribute: to track lastForward X
on the >button you will need to change:
Rule for touch is pressed
add after your forward motion behaviors
--Rule: when
---Attribute: self.Position.X ≥ lastForwardX
----constrain score behavior
then add new Rule: when
Actor receives event: touch is released
--changeAttribute: lastForwardX To: self.Position.X
this will hopefully keep the
<</code>button and backward motion from messing with the score! Good Luck! @};- MH