Question: Bullet flying towards the player, how ?
Posted: Tue Mar 19, 2019 3:05 pm
Hey guys,
im pretty new to löve and my code is always long and sometimes makes no sense, however, I'm currently making a game and mostly done with it, but I've came up across a problem, wich I don't know how to solve. On paper it is clear but I can't code it like that. Hope someone can help me out:
Imagine There comes a bullet from the top of the screen and it targets the players x coordinate and flys towards it, untill the bullet has reached a certain y coordinate, then the bullet looks on the coordinate in wich the player has been when the bullet passed taht certain y coordinate.
A friend of mine said that i should do it with vectors and the bullet targets (as updates) the player.x until it reaches the certain y coordinate, then it stop updating so the vector keeps flying towards that locked point.
Does anyone know how to solve this problem ? (And sorry for my bad english)
Thanks in advance
im pretty new to löve and my code is always long and sometimes makes no sense, however, I'm currently making a game and mostly done with it, but I've came up across a problem, wich I don't know how to solve. On paper it is clear but I can't code it like that. Hope someone can help me out:
Imagine There comes a bullet from the top of the screen and it targets the players x coordinate and flys towards it, untill the bullet has reached a certain y coordinate, then the bullet looks on the coordinate in wich the player has been when the bullet passed taht certain y coordinate.
A friend of mine said that i should do it with vectors and the bullet targets (as updates) the player.x until it reaches the certain y coordinate, then it stop updating so the vector keeps flying towards that locked point.
Does anyone know how to solve this problem ? (And sorry for my bad english)
Thanks in advance