Page 2 of 2

Re: Pac-man like Lives System

PostPosted: Sun Dec 25, 2011 12:25 am
by GuybrushThreepwood
Ok, for the random choice picking part, I just directly copied that code. Now my ghost moves to the node, with the sw_intersection animation, but when the ghost gets there, he still goes in any direction. What am I doing wrong?

Re: Pac-man like Lives System

PostPosted: Sun Dec 25, 2011 12:32 am
by skydereign
Two possible things. One, you need to make sure the direction that the ghost is moving is set with dir. I forgot to add that, but essentially something like this.
ghost -> Create Actor -> Script Editor
Code: Select all
dir=0;
directional_velocity=2;
angle=0;

That way the intersection code will know what direction the ghost was actually moving in. Another possible problem is that the speed of the actor does not align the nodes but the symptoms would be slightly different. One other adjustment you need to do is make dir an actor variable, instead of a global variable. That way you can have clones, instead of just a single ghost.

Re: Pac-man like Lives System

PostPosted: Sun Dec 25, 2011 3:22 am
by GuybrushThreepwood
Yup. That did it. I changed the velocity to 2, and it worked just fine :mrgreen:
Thanks for all your help!