Question regarding scores
firstofjune
Member Posts: 12
Hi everyone, I'm new to Gamesalad and I'm facing a lil problem hope that you people can help me sort things out.
Here's the story. I have my ActorA accelerating on +X, which means it moves faster and faster towards right hand side of the scene. I wanted the scores to update according to how many distance my ActorA travelled (remember the travelling speed is accelerating, not at constant speed), how should I do it?
What i tried is :
if self.motion.linearVelocityX > 0
change attribute
Set: scene.scores
To: self.motion.linearVelocityX*10
but the scores doesn't change at all... Please help me, thanks.
EDIT: The score actually showed up, but only at the initial (which is a random number and stucked there), and it doesn't update as the ActorA moves...
Here's the story. I have my ActorA accelerating on +X, which means it moves faster and faster towards right hand side of the scene. I wanted the scores to update according to how many distance my ActorA travelled (remember the travelling speed is accelerating, not at constant speed), how should I do it?
What i tried is :
if self.motion.linearVelocityX > 0
change attribute
Set: scene.scores
To: self.motion.linearVelocityX*10
but the scores doesn't change at all... Please help me, thanks.
EDIT: The score actually showed up, but only at the initial (which is a random number and stucked there), and it doesn't update as the ActorA moves...
Best Answer
-
TesseractEngine Posts: 180Before ActorA starts moving, grab his pos.X, for example into a new attribute called self.StartX. Then constrain scene.scores to his current (pox.X - StartX) * 10 (or whatever multiple gives you the kind of score range you are after).
Answers
Have a nice day