Actor movement

joey2ejoey2e Member Posts: 99
edited November -1 in Working with GS (Mac)
Hello all

Have spent hours trying to figure this out myself (lol, sad I know)

I am making a game where the character moves from the bottom of the screen to the top when touch is released.

I want to move the actor left and right and for this I have created two invisible actors called LeftButton1 and RightButton1 (well I have made the alpha 0), one covers the majority of the right hand side of the screen and the other the left hand side of the screen.

I have set up three attributes, called, usertouch, left, right all are integers and set to 0.

For the two invisible actors I have set up the following rules:

LeftButton1
When user touch then left attribute = 1
When user release touch then left attribute = 0

RightButton1
When user touch then right = 1
when user release then left = 1

I have set a rule for the actor moving up the screen that when touch is released usertouch = 1, then I have set up the following rule:

When touch = 1 allow the following
when left = 1 move actor left
when right = 1 move actor right

This works fine sometimes and other times it does really unexpected things such as when I press left then right the actor will just keep moving without me touching anything or the actor will just freeze.

In total there will be 5 actors one at a time (when selected by the user) moving up the screen, the above mentioned problem gets worse the more actors there are.

Any help/guidance anyone can offer would be GREATLY appreciated

Joe
Sign In or Register to comment.