Java Arena

Module 53

Project: an Asteroids-style game

A larger project: a small game built step by step, a yellow submarine that dodges jellyfish and fires bubbles. Shapes in a Pane of fixed size, moving and turning them, keys kept in a map, a game loop with AnimationTimer, movement with Point2D, one base class for everything that moves, collisions with Shape.intersect, jellyfish from a seeded Random, wrapping at the edges, bubbles, points in a Text and a game over. MOOC section 14.3.

Steps

  1. The sea and the submarine
  2. Steering with the keys
  3. Engines on: moving with vectors
  4. Submarine and jellyfish share a class
  5. Bumping into jellyfish
  6. Around the edges of the sea
  7. Firing bubbles
  8. Points, new jellyfish and the end of the dive