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
General discussion about LÖVE, Lua, game development, puns, and unicorns.
2 posts • Page 1 of 1
It depends on how you actually want it to be exactly. Does it have to check only once, i.e. when the bullet is fired, or should it update it's direction when travelling?