GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Question regarding scores

firstofjunefirstofjune Posts: 12Member
edited September 2012 in Working with GS (PC)
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...

Best Answer

  • TesseractEngineTesseractEngine Posts: 180Member
    edited September 2012 Accepted Answer
    Before 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).

    Quire Graphics - Graphics for Games

Answers

This discussion has been closed.