• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Moving a view from a fixed point with a gamepad? (studio 1.4)

Joe

Member
Hey there everyone, this one has me a little stumped. (been a minute)

First, I'll explain the best I can. Think of a 3 point camera system with the player being the fixed point and the camera allowed a certain amount of travel dynamically away from the player or fixed point.

(small elaboration)
Player ------------------- camera(view center) ------------------ mouse(crosshair)

Well, the plan is to do this with a gamepad. Similar to what this code below is drawing(the crosshair) when the right analog is moved passed a set deadzone.

Code:
draw_sprite_ext(crosshair_spr,0,x+gamepad_axis_value(pad_num,gp_axisrh)*256/2,y+gamepad_axis_value(pad_num,gp_axisrv)*256/2,1,1,image_angle,global.view_color,1);
I tried this little bit down here to see if I could get the view to move dynamically, but.... it only works if I disable the view object, and as soon as the analog stick moves, the view is transported somewhere in the room far away from the player.

Code:
var hraxis = gamepad_axis_value(pad_num, gp_axisrh);
var vraxis = gamepad_axis_value(pad_num, gp_axisrv);
view_xview[pad_num] = x - view_wview[view_current]/2 - (x-hraxis)*200;
view_yview[pad_num] = y - view_hview[view_current]/2 - (y-vraxis)*200;
What am i doing wrong?
Does view_object need to be disabled?
How can i get the view to act like the crosshair?
Do I have to make another object for a view camera?
The idea is to not have a camera object (since it would be dealing with 4 players)

I hope this helps anyone help me. Thanks to all in advance.
 
Top