Page 3 of 3

Re: Tutorial - Setting up a controller

PostPosted: Sat Nov 08, 2014 8:46 pm
by Zivouhr
This looks great, thanks RipperR for typing that up! I'll give that a try soon.
Thanks for trying out Tomb of Twelve also. 8)

Re: Tutorial - Setting up a controller

PostPosted: Mon Dec 08, 2014 1:10 am
by mog440
Hi RippeR, that is exactly what I was looking for thanks! Just one question, how do you add the up and down movements to that? I have been trying for three days and I just can't get it to work.

Re: Tutorial - Setting up a controller

PostPosted: Wed Dec 10, 2014 1:12 am
by RippeR7420
It's the same concept, except use "Yaxis" instead of "Xaxis".

Code: Select all
if(Xaxis > 2500) //Joystick is pushed right
{
    Player.x += 5;
}
else
if(Xaxis < 2500) //Joystick is pushed Left
{
    Player.x -= 5;
}
else
if(Yaxis > 2500) //Joystick is pushed down
{
    Player.y += 5;
}
else
if(Yaxis < 2500) //Joystick is pushed up
{
    Player.y -= 5;
}


Hope it helps!