0 Favourites

# 360 controller

• 17 posts
• i am trying to make an over the top shooter game, similar to geometry wars, using the xbox controller. i have tried a few different things like:

left analog X axis > 0 then move right

and the same for up left and down, this works great, the character moves in the correct directions.

but now i tried the same thing with looking,

gamepad right analog x axis rotate 90 degrees and toward 0

90 for up, 180 for left, and 270 for down. then went to even say,

If right xaxis > 0 AND right yaxis > 0, then rotate 90 toward 45 degrees.

unfortunately, some of these work, and some do not. and i only think some work because up down left and right worked just fine, but the character sometimes starts looking at a 45 degree angle... im just wondering if theres an easier way for xbox controls? its taken 12 code bunches just to use the move and aiming and its not close to perfected.

picture of my broken coding

• The problem is that you're rotating the object like that, probably to have a "smooth" feeling to the rotation, right? You should just set the angle degree directly to what you want using "Set Angle" instead of "rotate to angle".

And to make diagonals works, you gotta check if it's between 0 and 50, I think. For instance, when you press up on the analog, the Y goes to -100 and X is 0, but if you press it UP + RIGHT, the Y is -50 and the X is 50.

If you press it to the right, Y is 0 and X is 100.

Probably you could translate these numbers directly to angles, but I wouldn't know how to do that..

• This question came up earlier today, and I answered it already, but here's an example capx that includes movement controls.

It's pretty rough, but it functions well enough.

• you can use the angle the stick is at to move things around

after this you just need to add a "move forward" action when "something"

• im gunna be honest and say i have no idea what a (0,1) would even represent. 0 no and 1 for yes? meaning if it being moved? please describe a bit more.

• Thanks Geo, that looks awesome, im going to try it out now

• sxespanky The manual and tutorials will teach you what the different numbers are.

• So i've tried Both Geometrix, and sargas, your methods, but when i go to look, now its stuck at - Looking at the top left area, indefinitely, moving the stick around it will try and look about 1-2 degrees differently, but thats it. ill go find the controller tutorial, wherever this may be.

• Actually, oddly enough, there is no tutorial for using the gamepad object. The manual entry, however, does explain exactly what the 0 and 1 means. If you're not willing to do at least a modicum of research on your own, then you're going to have a lot more trouble than just getting gamepad movement to work.

i think you'll should get what you need from that. ( I actually made that capx originally to test how messed up were the sticks on my controller xD)

• GeometriX - ive done a ton of searches to get this to work, and gamepad stuff that ive seen goes into brief descriptions what each outcome is of statements, i just haven't found the correct text on a thorough description on the gamepad object. after plugging the code into the RIght control stick, and disabling mouse function, it works.

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• I don't see how the mouse object would interfere - that's a little odd - but I'm glad it's at least working now.

• because one line was Sprite always look at mousex, mousey. so i need to make an actual menu before the game starts up and pick mouse and key or controller. right now the mouse was disabled, so if you wanna try out this so far, be my guest.

~B Resets game

~Right trigger fires

~when dual wielding left trigger fires other weapon.

~killing the larger green enemies spawns more enemies and also drops a weapon upgrade kit after death.

i have more weapons and levels and eventually animating every enemy but for now its all just place holders. ill prolly end up buying the personal version within a few months when i get extra cash in pocket.