Need help with making proper onscreen controls
![Pennez-Games](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
for ages now iv been trying to make on screen controlls, it never works!! please help, i am trying to do this
you have two onscreen controlls, right and left, you hold down left and the actor on the screen moves left, but you have to hold it down to move the actor, please can anyone help me?
you have two onscreen controlls, right and left, you hold down left and the actor on the screen moves left, but you have to hold it down to move the actor, please can anyone help me?
Comments
In the left button:
When touch is pressed, change attribute direction to 1
Otherwise, change attribute direction to 0
In the right button:
When touch is pressed, change attribute direction to 2
Otherwise, change attribute direction to 0
In the object that moves left or right:
If attribute direction = 1 move left
If attribute direction = 2 move right
i did this, but when i click it or hold the arrow key down, the character will move like half an inch then stop, i click again same thing?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Hope that helps! In my game, I did that and it works.
Hey! Can u ell me out with my problem? http://forums.gamesalad.com/discussion/47173/ball-problem#latest
i did that,. except i want onscreen controlls, not pc keyboard controlls.
wait, it worked!!! thanks man so much, ill have a look at your problem now ;D
This is the easiest way (for me) to have left and right controls...
Make 3 blank actors and name them this:
Player
Left
Right
(put a color or display text for the left and right actors, this way you can determine which is which)
Then make 2 game attributes (these will both be integer attributes)
Name them:
MoveLeft
MoveRight
(leave them at 0)
Then go into your Player actor...
Create 2 Rules
In your first rule do:
When attribute game.MoveLeft = 1
(Drag in your Move behavior)
Move -
Direction 180 (180 is left)
Relative to actor
Second Rule:
When attribute game.MoveRight = 1
Move -
Direction 0 (0 is right)
Relative to actor
Your player actor is finished!
Now for your controls.
Go into your Left actor
Create 2 rules
First Rule:
When touch is pressed
Change attribute -
game.MoveLeft = 1
Second Rule:
When touch is released
Change attribute -
game.MoveLeft = 0
Your left actor is finished!
Go into your Right actor
Create 2 rules
First Rule
When touch is pressed
Change attribute -
game.MoveRight = 1
Second Rule:
When touch is released
Change attribute -
game.MoveRight = 0
YOUR FINISHED!!
Now hit preview... you will see your left and right actors will move your "player" left when held down... when you let go of the left button the player will stop... When you hold down right, your player will move right.
Hope this helps you!
thanks for your help, this does work aswell as what gsroxs told me, thanks!