How do games generally make enemies move in really curvy ways like in Blazing Lazers?
dangerous curves
Sin and cosine functions will give you the nice curvy waves. Just check out trigonometric functions.
If they are on a set pattern, trigonometric functions are useful. If their movement is not on a set course, such as if they are reacting to the player, then there are a few methods to achieve those smooth curves. The main way is to model their movement as vectors and change an object's movement using velocity and accelerating vectors.
eg: If an object's velocity is (3,0) and its acceleration is (-1,2) for 3 seconds, then it will smoothly change course from east to north while accelerating. In the case of a game like blazing lazers, this is like simulating thrust.
eg: If an object's velocity is (3,0) and its acceleration is (-1,2) for 3 seconds, then it will smoothly change course from east to north while accelerating. In the case of a game like blazing lazers, this is like simulating thrust.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement