Skip to content
This repository was archived by the owner on Mar 4, 2022. It is now read-only.
Wen Junhua edited this page Jul 27, 2020 · 4 revisions

Welcome to the Space Defenders Wiki!

How to play:

Generic shortcut keys

  • 'P' key to pause and resume the game during play
  • 'x' key to screenshot during the game

Player 1 (The main key bindings for 1 player mode):

  • 'A' key to move left
  • 'D' key to move right
  • 'Spacebar' key to shoot

Player 2 (For the 2 player modes):

  • Left arrow key to move left
  • Right arrow key to move right
  • '0' key to shoot

Goals

  • Shoot enemies and score as high as possible

How to change settings:

Go to the settings menu of the screen and tune the settings there

Complete Features

  1. AI for the game
  2. Better GUI
  3. Settings Menu
  4. High Scoreboard
  5. Power-ups for the person to collect
  6. Two player mode for the player and AI to collaborate
  7. Local 2 player multiplayer
  8. Add a database to keep track of the high scores
  9. Story mode with cutscenes for the player to play

Expert features

Expert features are found in the settings.cfg file Feel free to tune the parameters to suit your game play There are also AI related expert features in Gym invaders folder. Clone that folder for more information

AI Modification

Feel that the AI is not strong enough? You can train your own AI and put the weights into the game The output of AI: 0: Shoot 1: Move left 2: Move right 3: Do nothing 4: Move left + shoot 5: Move right + shoot

How to train your AI

  1. Open training.py of your choice (Evo or DQN)
  2. Tune the parameters to your liking
  3. Run the file to train the AI

How to load your AI into the game

  1. Edit the eval.py file to load your model instead
  2. Run the eval.py

Sprites and sound Modifications

For background: The background will be scaled respectively to the screen

  1. Drop the background into the images/backgrounds folder
  2. Go into the in-game settings to toggle to the background of your choice

For Sprites:

  1. Drop the sprites in the appropriate folders
  2. The sprites will appear when the characters in-game reach a certain hp

For Sound:

  1. Drop the sound in the sounds folder
  2. Go into settings.cfg and put the relative path of the sound file to replace the appropriate sounds you want to replace
  3. Go in-game to see your sound effect being played