Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Trying to make sprite turn to the direction of a Xbox 360 controller joystick

Author
Message
Robbee101
18
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 23rd Jun 2010 02:02
Hiya Forum!
I am trying to translate the reading of the right joystick on a 360 controller into the relative 360 angle of a 2D sprite i.e. move the analogue stick right and the sprite angle turns to 90 degrees/move the A/stick left and the sprites turns to 270 degrees.
Achieving 8 directions is quite feasible, however, I can't quite fathom how to achieve all 360 degrees of directions...?
Help is greatly appreciated!
All the best.
Rob
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 24th Jun 2010 16:48
I'm not sure if your question is about how to read the XBOX controller or if it is how to rotate a sprite. I don't have an XBOX 360 controller, so I cannot help you with the reading of it. If that is the case, perhaps you could search for 'XBOX 360' and see if someone else has asked the question.

I assume you have the dll for the XBOX 360 controller. If not, you can find it here:

http://forum.thegamecreators.com/?m=forum_view&t=155264&b=8


smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 9th Jul 2010 19:26 Edited at: 9th Jul 2010 19:47
never tried using a controler what kind of data are u getting from the controler at the top bottom left and right positions

rotating a sprite should be simple enough moving+ rotating is a different story however. u only need to read data from 1 axis
going to be one of the following commands depending on what ur using and how windows/dark basic interprets ur controller i spose

joystick hat angle()
joystick twist()
joystick x or y
rotate sprite 1,((variable))

A child's dream never dies.

Login to post a reply

Server time is: 2024-11-23 14:06:59
Your offset time is: 2024-11-23 14:06:59