(click to interact)(mouseover/click to play GIF)Interactive demo (if JavaScript is enabled)
This is a small post about how to convert key codes to key names and/or convert key names to key codes. Comes with sample code for GameMaker and a generic version.
Mostly published because it covers majority of common and semi-common buttons.
Mouseover to activate, click to reposition the clipping star.
This is a tutorial about pretty much everything related to clipping drawn graphics in GameMaker.
That is, having drawn graphics only display inside a certain ("clip") area, be that a rectangle (UI regions, minimaps, etc.), circle, or a completely arbitrary shape (pictured above).
Also I'm trying new things so this post is nicely stuffed with interactive demos and snippets.
This is a blog post about handling circle-rectangle collisions.
For some reason, these seem to be generally regarded as something complicated, even though they aren't.
A little while ago, I was asked about what would be a good approach to creating an effect for a top-down game where coins would fly out of a smashed object. Not recalling any tutorials on the matter, I've made an example of this exact thing, and this is a post detailing everything related to such an effect.
Angular rotation is rotation of one angle (normally a numeric value) towards other angle. This can be considered interpolation and has many applications ranging from gradual rotation towards angle to turrets, homing missiles, and procedural bone animations.
This post is about how these internally work and implementation.
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.