Tutorial - Setting up a controller

Learn how to make certain types of games and use gameEditor.

Re: Tutorial - Setting up a controller

Postby Zivouhr » Sat Nov 08, 2014 8:46 pm

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)
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 545
Joined: Sat May 17, 2014 2:12 pm
Score: 58 Give a positive score

Re: Tutorial - Setting up a controller

Postby mog440 » Mon Dec 08, 2014 1:10 am

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.
mog440
 
Posts: 12
Joined: Mon May 24, 2010 11:02 am
Score: 0 Give a positive score

Re: Tutorial - Setting up a controller

Postby RippeR7420 » Wed Dec 10, 2014 1:12 am

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!
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest