JIT
Make QIX (1981)
make QIX (1981)

Okay, let's start building a simplified version of the game QIX using HTML Canvas and JavaScript. This initial version will focus on the player movement, drawing lines (Stix), and a basic Qix entity. Area filling and Sparx enemies will come later.

This sets up the basic HTML structure, styles the canvas, and includes the initial JavaScript for:

  1. Canvas Setup: Creates the drawing surface.
  2. Game Objects: Defines player and qix objects with basic properties (position, speed, color).
  3. Drawing: Functions to draw the border, player marker, the Qix (as connected lines), and the Stix being drawn.
  4. Player Movement: Handles keyboard input (arrow keys) to move the player. It restricts movement to the border initially.
  5. Stix Drawing: Detects when the player leaves the border to start drawing and when they return to finish (though area filling isn't implemented yet). It stores the path points.
  6. Qix Movement: Implements simple Qix behavior where its points move towards random target locations.
  7. Basic Collision: Includes rudimentary checks for the player marker hitting the Qix lines, and the Stix hitting the Qix lines while drawing.
  8. Game Loop: Uses requestAnimationFrame for continuous updates and rendering.
  9. Game Over: A simple game over state triggered by collisions.

You can run this now. Use the arrow keys to move the marker along the border. Move off the border to start drawing a red line (Stix). Return to the border to complete the line (it will disappear for now). Avoid touching the green Qix lines with your marker or your drawing Stix.

Updated files
v1