diff --git a/space-invaders/README.md b/space-invaders/README.md index 36893f8..f81fbb1 100644 --- a/space-invaders/README.md +++ b/space-invaders/README.md @@ -1,3 +1,43 @@ -# Space Invaders +# Zeus Invaders -TODO +We'll give some general pointers on how to make this Space Invaders based game. + +## Game description + +The player controls a ship which can shoot bullets at a group of aliens. The aliens move to one side (right or left) of the screen, and move one space down when reaching the edge. The ships then speed up once they've moved down. + +## Game structure + +![Project structure](readme-assets/structure.png) + +The general game structure we used is pretty simple, comprising of a player-controlled ship, a group of enemies, a node which randomly spawns a UFO which grants extra points, a GUI and a camera node to have some easier control over what the player sees. + +We advise the reader to implement the nodes in the order presented in this README. + +### 1. Ship + +The ship should contain code which responds to the player pressing the arrow keys or the spacebar. + +**TASK**: Implement player movement in the script of the ship. Make use of the `delta` parameter available in the `_process` function to vary the `position.x` of the ship node. Add a **Sprite** node with an image (placeholder will suffice for now). + +### 2. Bullet + +Common for both the enemies and the ship is the fact they can shoot bullets. + +**TASK**: Create a Bullet scene containing a sprite and a Collision box. Collision can be obtained by adding an Area2D node and adding a CollisionShape2D node as its child. Have the Bullet scene move upwards continuously and let it despawn using `queue_free()` when it reaches the edge of the screen. + +**TASK**: Check for collision with player or enemies. Quick tip: make use of groups + +**TASK**: Add code to the ship which spawns this bullet scene at the current `global_position` of the ship. Make use of `preload()` to load the scene into memory. + +### 3. Enemy + +**TASK**: Create an Enemy scene which can be almost completely analogous to the ship. It contains a Sprite and a way to detect collisions. + +### 4. Enemies + +The enemy spaceships can be combined with one general "enemies" node. This controls the movement of the group of enemies, moving a discrete amount of time to one side, moving down when reaching the end of the screen. + +![Enemies](readme-assets/enemies.png) + +**TASK**: Create a node "Enemies". Populate with a couple of individual Enemy scenes (can right now just contain a single sprite). Create a **Timer** node and connect its timeout signal to the script of the group of enemies. This should then trigger a single movement of the group. Also add a **Bullet** spawner which randomly spawn downward facing bullets. diff --git a/space-invaders/readme-assets/enemies.png b/space-invaders/readme-assets/enemies.png new file mode 100644 index 0000000..8a06df7 Binary files /dev/null and b/space-invaders/readme-assets/enemies.png differ diff --git a/space-invaders/readme-assets/enemies.png.import b/space-invaders/readme-assets/enemies.png.import new file mode 100644 index 0000000..fc911dc --- /dev/null +++ b/space-invaders/readme-assets/enemies.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/enemies.png-27f006e9f6b37bcf385ccf7bfafcdbcb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://readme-assets/enemies.png" +dest_files=[ "res://.import/enemies.png-27f006e9f6b37bcf385ccf7bfafcdbcb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/space-invaders/readme-assets/structure.png b/space-invaders/readme-assets/structure.png new file mode 100644 index 0000000..6f55179 Binary files /dev/null and b/space-invaders/readme-assets/structure.png differ diff --git a/space-invaders/readme-assets/structure.png.import b/space-invaders/readme-assets/structure.png.import new file mode 100644 index 0000000..4fbb5a0 --- /dev/null +++ b/space-invaders/readme-assets/structure.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/structure.png-c45f4609588da3ee14f408dd8272af87.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://readme-assets/structure.png" +dest_files=[ "res://.import/structure.png-c45f4609588da3ee14f408dd8272af87.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0