Ive been having this problem for awhile but was just hopping it would go away as i finished the game but it didnt. It seems that if you aim close to the character it doesnt aim correctly. If you aim far away from the character is works fine but if you try to shoot a short distance in front of you then the bullet goes off in a different direction which isnt good. Could it be where the origin of the player is or how the bullet spawns?
the game
aiming in 2d offset
Started by Listro, Feb 28 2012 06:27 PM
2 replies to this topic
#1
Posted 28 February 2012 - 06:27 PM
#2
Posted 28 February 2012 - 07:58 PM
Anyone Know?
#3
Posted 29 February 2012 - 12:16 PM
It has to do with how the Move Towards Point works it takes the x, and y of the calling object (in this case the bullet) and checks in what direction the second x, y point is from it (in this case mouse_x, mouse_y) and doesn't take ANYTHING else into account so I'm sure if you think about it you can figure out where the issue comes from, especially since you practically hit it on the head already...
Anyhow, a fix or at least a way to make it work how I assume you want it to is in your obj_man where the bullets are created drop the + 50 and - 50 offset from the X's (but Keep the Y's offset), and in the create of the bullets AFTER the Move Towards Point, put in
to reapply that offset.
It's hard for me to explain how this works, aside from understanding what's posted above. but I tested it and it seems to work how I assume you want it to.
Hope this Helps
how the bullet spawns
Anyhow, a fix or at least a way to make it work how I assume you want it to is in your obj_man where the bullets are created drop the + 50 and - 50 offset from the X's (but Keep the Y's offset), and in the create of the bullets AFTER the Move Towards Point, put in
if (mouse_x > obj_man.x)
{
x += 50;
};
if (mouse_x < obj_man.x)
{
x -= 50;
};to reapply that offset.
It's hard for me to explain how this works, aside from understanding what's posted above. but I tested it and it seems to work how I assume you want it to.
Hope this Helps
Edited by Sev, 29 February 2012 - 12:25 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











