This is a post about doing homing missiles in GameMaker!
Continue readingTag Archives: motion
GameMaker: Angular motion
It's like drifting. On a spaceship. In space.
In turn, that means having angular speed with acceleration, friction, and limitation.
Such can be particularly useful for simulating a more 'smooth' rotation behaviour, when object will not start or stop rotating instantly.
If combined with relatively properly written code for linear motion, this can grant pretty nice behaviour for space games.
Also there's a "trail" effect added, originally just to demonstrate how it works.
Everything is pretty nice and simple.
GameMaker: Turret rotation (with limits)
It's actually pretty hard to describe what this does without an image.
Basic use for this would be to create units that cannot shoot backwards without rotating towards angle entirely.
GameMaker: Orbiting
Interactive demo. Mouseover to activate, drag planets around.
This is an example of making an instance orbit around other instance in GameMaker.
In contrast to other similar examples (and commonly given advice of the kind), it allows to define orbiting speed in a common way (pixels/frame instead of degrees/frame).
This is accomplished by calculating the distance to orbit' center (from current position), calculating the orbit' length, and thus converting pixel speed to degree speed.
New position is then calculated and instance' speed is adjusted for it to reach it the next frame.
This allows to use direction in collision calculations as per usual.
Overall, the code is simple enough but documented regardless.
Code follows,
Continue readingGameMaker: 8-way shooting with 4 keys
Example is simple, well commented, and would be rather easy to implement.