Skip to content

Initial Design Plan

Paul Jarrow edited this page May 8, 2017 · 11 revisions

Written after tech decisions and proof of concept prototype have been created, as of v0.1.0-prototype.

General Plan

  • A frog you can control.
    • Move around the map, "attack" with tongue to eat an insect.
    • Game ends when you are hit by a wasp or eat a wasp.
  • Insects spawn randomly and fly around randomly.
  • Points are awarded for successfully eating non-harmful insects.
  • The back-end server maintains a scoreboard of high scores.

Tech Decisions

  1. Node.js: chosen because it is a requirement. In future, may choose to develop over socket.io for real-time communication.

  2. Express: Express is the ideal framework for server data. Most of the game is designed to work with WebGL or canvas client-side, but the server-side application will be handled by Express.

  3. WebGL: The best way to render quickly in modern browsers.

  4. Pixi.js: A framework to build on WebGL. Makes it easy to build a 2D sprite game. Also falls back to plain Canvas in the event the browser doesn't support WebGL.

  5. MongoDB/CassandraDB: As a pure storage medium for JSON, this suits us. We don't need much if anything for relational structure.

Desired Features

Note: P# is the priority ToDo number. MVP marked items are part of the Minimum Viable Product.

  1. Moving player, ARROW KEY or WASD control. Rotation to match direction. [P1 - MVP]

    • Constraint to within play area.
    • Tongue attacking, limited range. Hit-scan or projectile? (Apply hit detection.)
  2. Custom or freely available sprites for frog, low-points insect, high-points insect, and danger insect. [P1 - MVP]

  3. Interesting backdrop for game field. [P2]

  4. Spawn-able insects. [P1 - MVP]

    • Primitive AI control.
  5. Score system. [P1 - MVP]

  6. High score tracking. [P1 - MVP]

    • Entry of username for high scores.
  7. Sprite animation. [P3]

  8. Sound. [P3]

    • Sound effects.
    • Background music.

Potential Challenges

  1. Obtaining art & sound. Licensing is the primary challenge here.

  2. Hit-detection. A little bit of geometry. The main concern is how to handle firing: projectile is probably better for game challenge, but hitscan is easier to program.

  3. Handling unique usernames (does it matter?) Likely this won't be addressed, as the high score system will be similar to arcade name entry. Incentive to not use another's name is to use your own to reflect your high score.

  4. AI control system. This won't follow advanced AI principles, it will likely be a simple randomness system with constraints.

  5. Spawning system. Building the proper object-oriented system and ensuring it is performant.

Game Systems

Player Attacking System

  1. Player presses attack. attack() is called.
  2. Attack toggles attacking variable, which disables movement.
  3. Tongue proceeds, hit detection is run on each "step" of the tongue.
    1. HIT: call eat(insect) on Player. Restore player movement.
    2. MISS: Restore player movement.

Wasp Attacking System

  1. play() runs hit detection on player and all wasps. If hit detected, game ends.

Insect Movement System

  1. Call moveRandom() on Insect.
    1. Generate random direction and turn that way.
    2. Set velocity based on own property velocity.
  2. If period of time for pathing passes, or insect becomes constrained, call moveRandom() again.

Clone this wiki locally