S
Spin Attaxx
Guest
So I have a 2D platformer with eight-way shooting. Shooting up/down/left/right while moving works fine, but when it comes to shooting diagonally while moving, it looks a little awkward. It's kind of hard to explain, but when the view is moving, it makes it look like the shots are moving at a higher angle than they actually are (and that they're coming out of my head and not my hand). Playing a game with a similar setup, Super Metroid, I notice that it doesn't have this issue - even if the screen is moving, the bullets still look like they're travelling on the same angle and aren't curving upwards/being fired out of my head.
So what should I do about this? I feel like the answer lies in affecting the way my bullets fire, but I tried making my bullets' x move based on my player's speed when it was created, but that made it actually curve up at a different angle as opposed to simply looking like it. Here's my code:
Player shooting code:
obj_bullet Create event:
Apologies if I'm asking a stupid question that has a simple answer, or if I didn't quite do a good job of explaining the problem.
So what should I do about this? I feel like the answer lies in affecting the way my bullets fire, but I tried making my bullets' x move based on my player's speed when it was created, but that made it actually curve up at a different angle as opposed to simply looking like it. Here's my code:
Player shooting code:
Code:
//xx and yy are the player's hand.
if (key_shoot) && (can_shoot == true)
{
inst = instance_create(xx,yy,obj_bullet);
inst.direction = dir; //dir is decided in a different script; 45, 135, 225 and 315 are my "aim diagonally" values
}
Code:
speed = 25;