CheeseMyBaby
Member
Hello GML gurus.
Background:
I've got a state based turret coming up from the floor when the player object is within range. When walking even closer it shoots at the player. When stepping away it stops shooting and when walking farther away, it drops back down into the floor.
This all works well except for one thing that's driving me crazy.
I'm checking if the player is in range with
... and this is what I need help with:
If the player jumps while within reach the turret goes down. In a way I guess that mean it's working correctly but I want the collision line to be... thicker, so to speak.
I want the player to be in range even when airborn and when directly over the turret.
The things I've tried so far is variations of:
... but without making it work. I'm sure it's possible to fix it with one or more of the above (or something completely different) I just don't know how to.
All help will be greatly appreciated!
Background:
I've got a state based turret coming up from the floor when the player object is within range. When walking even closer it shoots at the player. When stepping away it stops shooting and when walking farther away, it drops back down into the floor.
This all works well except for one thing that's driving me crazy.
I'm checking if the player is in range with
Code:
if (state == turretstate.inactive) {
#region INACTIVE
sprite_index = sprTurret;
image_speed = 0;
image_index = 0;
//Transition trigger - raise the turret
if (collision_line(x-200, y, x+200, y, objPlayer, false, false)){
state = turretstate.goingup;
}
Code:
//Transition trigger - raise the turret
if (collision_line(x-200, y, x+200, y, objPlayer, false, false)){
I want the player to be in range even when airborn and when directly over the turret.
The things I've tried so far is variations of:
Code:
collision_line
point_distance
collision_ellipse //although I'd rather not use this one
All help will be greatly appreciated!