BlocosIA Wiki Editor

8-direction movement (Construct 3 style)

Arrows with acceleration, braking and wall collision, no "forever" needed.

  1. Add the 8-Direction Movement extension.
  2. On the flag: use 8-direction movement: yes. Done: the arrows already move the sprite.
  3. Tune max speed, acceleration and deceleration (steps per second). High acceleration = snappy; low deceleration = spaceship inertia.
  4. allowed directions: 8, 4 (mazes), up/down only or left/right only.
  5. turn the sprite to where it moves: free, every 45°, every 90° or don't turn.
  6. controls: arrows, WASD or none. With "none", use simulate key inside a "forever" for AI enemies or on-screen buttons.

The sprite does not pass through barriers or solid map blocks, and the when I hit a wall hat reports collisions. See the examples Ghost Maze (4 directions) and Space Hunt (8 directions with inertia).

Open in the editor