V
Vargas
Guest
Introduction:
So I've gone through the basic tutorial on Youtube for GMS2 before but I wanted to try something a little more ambitious this time around. Instead of making a small game where you have one objects that flies around, I'm making one where you drive a warship and use multiple turrets on one vehicle at a time.
What I'm Struggling With:
I would like it if all the turrets on the ship would automatically turn (slowly) to face where the mouse is pointing (to a limited extent). Meaning that they are limited to about 220 degrees of freedom each.
While I can currently get one turret to stay centered on the ship by using this code:
If I want this ship to have multiple turrets, they will need to be locked to different positions along the length of the hull itself and not just to its center. The points where I'd like to mount the turrets are indicated with a red square:
Here's what I'm currently using for the turret sprite:
Does anyone have any advice?
So I've gone through the basic tutorial on Youtube for GMS2 before but I wanted to try something a little more ambitious this time around. Instead of making a small game where you have one objects that flies around, I'm making one where you drive a warship and use multiple turrets on one vehicle at a time.
What I'm Struggling With:
Getting a moving sprite of the ship's hull on screenGetting the camera to follow the ship's hull around
Multiple speed settingsTurning speed proportional to directional speed- Mounting multiple moving turrets on the hull sprite.
I would like it if all the turrets on the ship would automatically turn (slowly) to face where the mouse is pointing (to a limited extent). Meaning that they are limited to about 220 degrees of freedom each.
While I can currently get one turret to stay centered on the ship by using this code:
Code:
//Keep Turret on ship
x = obj_player.x;
y = obj_player.y;
Here's what I'm currently using for the turret sprite:
Does anyone have any advice?