Cauldron2D.GameMaker.Step (Cauldron2D.GameMaker v0.2.1)

Copy Markdown View Source

One step of a running game, in GameMaker's order:

  1. every instance's xprevious and yprevious become its position
  2. begin step events
  3. alarms: each alarm above zero counts down, and one reaching zero turns off and runs its alarm event
  4. keyboard events: a held key's keyboard event, a pressed key's key press event, a released key's key release event, each also as "any key" (1) when there is one, and the keyboard event "no key" (0) when nothing is held; then mouse events
  5. step events
  6. built-in motion: friction slows speed towards zero, gravity adds to hspeed and vspeed, then the position moves by them; an instance that is now wholly outside the room, and was not before, runs the outside room event
  7. collision events (Cauldron2D.GameMaker.Collide)
  8. end step events, then views that follow an object move, then every room layer with a speed scrolls by it (World's scroll) (Cauldron2D.GameMaker.Views)
  9. animation: image_index advances by image_speed times the sprite's own speed, wrapping at the sprite's frame count, and an instance that wrapped runs the animation end event
  10. a room change asked for during the step happens

Within each stage instances act in creation order; an instance destroyed partway through a stage takes no further part in it.

input has the GameMaker key codes held, pressed this step and released this step, and may have :mouse: %{position: {x, y}, held: buttons, pressed: buttons, released: buttons}, buttons being sets of :left, :right and :middle, position in room pixels.

Summary

Functions

The world one step on, with input as the players' input this step.

Functions

run(world, input)

The world one step on, with input as the players' input this step.