i want to control my actor by tapping the left or right part of the screen

cedricdhaenens

  • Posts: 7
the title says it all...  :)

linai

  • *
  • Posts: 28
There are several ways you could do this, but i would probably simply create two regions in the scene editor, and then use the "when the mouse is pressed on region" event (it works for touches as well) to determine presses... Depends on the game though.

cedricdhaenens

  • Posts: 7
I already tried making 2 regions in the past, but then i get an error when the game launches....   :-\

gfalcaor

  • Posts: 279
Create two invisible actors.
Each actor with the same size. Which means half of the screen.
Put them on front layer.

And you do a "When clicked" on that invisible actor it will move your actor.

Follow Me

cedricdhaenens

  • Posts: 7
thanks gfalcaor! i will try it out now!  :D

cedricdhaenens

  • Posts: 7
again an error...;   :-\

infinitum3d

  • Posts: 89
You could try something like this pseudocode;

Always
If mouse X > (scene width/2) AND mouse is pressed
move right
If mouse X < (scene width/2) AND mouse is pressed
move left


cedricdhaenens

  • Posts: 7
You could try something like this pseudocode;

Always
If mouse X > (scene width/2) AND mouse is pressed
move right
If mouse X < (scene width/2) AND mouse is pressed
move left



I just can't find out how to do this....
Can you help me out by explaining a little more specific? thx! :D

Tharaa

  • Posts: 125
again an error...;   :-\

this with the invisible actors works dude
maybe there is something wrong in your code and thats becouse you get the error