Space AI Game
Originally the idea was to have two or more players write some AI-like scripts and their ships would battle each other in space with additional obstacles like asteroids and planets. But for now the game is just a series of single-player challenges to complete.
A live demo of the latest version of the code is available at https://fotino.me/static/spaceship.codes.
Building the code requires Webpack and UglifyJS for bundling the source into one file and then compressing that file. You can install these dependencies with:
npm install -g webpack npm install -g uglify-js
Once you have Webpack and UglifyJS installed, you can build the code
make (requires CMake). Other build commands include:
make watch # Webpack watches source and rebuilds as needed make bundle # Only runs Webpack make minify # Only runs UglifyJS make clean # Removes already built files
The built files are
are the bundled code and the bundled + minified code, respectively. There are
two HTML files that can be viewed in the browser to run the game:
index-dev.html, which uses the unminified version of the code; and
index.html, which uses the minified version.
- Add health() and bounds() diagnostic functions for the user
- Explosion animations
- Viewport interactions like pan/zoom/focus
- Immobile enemy ships
- Mobile enemy ships
- Mines that follow the player if they are within a certain proximity and explode on impact.
- Be able to hover over objects and see information about them
- Togglable debug mode where you see a 100px grid, info on all game objects, etc.
- About dialog
- Menu dropdown for changing the view
- Loading/saving of user code using local storage
- Z-index for controlling drawing order of game objects
- Some way to give a level description via initial comments, or have some initial code the user has to modify.
- Weapon drops
- CodeMirror theme selector
- Clicking on game objects pops up a dialog with more information
- Add examples to the docs
- Add keyboard shortcuts to the docs
- Add game object descriptions to the docs
- Level design
- Improved menu/button graphics
- Mobile support
- More weapon types
- Powerups like shields, health
- Parallax movement of stars
- Quad trees for efficient collision detection
- More efficient scene rendering
- Maximum radar distance on a per-level basis
- Planets with gravity mechanics
- Better styling for docs
- Multiplayer versus mode