Space Invaders added
This commit is contained in:
parent
321ba3c9b9
commit
b6366386c5
17 changed files with 150 additions and 1 deletions
19
Space Invaders/alien.py
Normal file
19
Space Invaders/alien.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import pygame
|
||||
|
||||
|
||||
class Alien(pygame.sprite.Sprite):
|
||||
def __init__(self, color, x, y):
|
||||
pass
|
||||
|
||||
def update(self, direction):
|
||||
pass
|
||||
|
||||
|
||||
class UFO(pygame.sprite.Sprite):
|
||||
def __init__(self, side, screen_width):
|
||||
pass
|
||||
|
||||
def update(self):
|
||||
pass
|
||||
|
||||
|
3
Space Invaders/audio/attributions.txt
Normal file
3
Space Invaders/audio/attributions.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
background music from wyver9: https://opengameart.org/content/arcade-boss-tracks-8-bitchiptune
|
||||
game sounds from SubspaceAudio: https://opengameart.org/content/512-sound-effects-8-bit-style
|
||||
graphics by me :)
|
BIN
Space Invaders/audio/explosion.wav
Normal file
BIN
Space Invaders/audio/explosion.wav
Normal file
Binary file not shown.
BIN
Space Invaders/audio/laser.wav
Normal file
BIN
Space Invaders/audio/laser.wav
Normal file
Binary file not shown.
BIN
Space Invaders/audio/music.wav
Normal file
BIN
Space Invaders/audio/music.wav
Normal file
Binary file not shown.
BIN
Space Invaders/font/Pixeled.ttf
Normal file
BIN
Space Invaders/font/Pixeled.ttf
Normal file
Binary file not shown.
BIN
Space Invaders/graphics/extra.png
Normal file
BIN
Space Invaders/graphics/extra.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 B |
BIN
Space Invaders/graphics/green.png
Normal file
BIN
Space Invaders/graphics/green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 220 B |
BIN
Space Invaders/graphics/player.png
Normal file
BIN
Space Invaders/graphics/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 190 B |
BIN
Space Invaders/graphics/red.png
Normal file
BIN
Space Invaders/graphics/red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 214 B |
BIN
Space Invaders/graphics/tv.png
Normal file
BIN
Space Invaders/graphics/tv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
Space Invaders/graphics/yellow.png
Normal file
BIN
Space Invaders/graphics/yellow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 220 B |
12
Space Invaders/laser.py
Normal file
12
Space Invaders/laser.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import pygame
|
||||
|
||||
|
||||
class Laser(pygame.sprite.Sprite):
|
||||
def __init__(self, pos, speed, screen_height, color='white'):
|
||||
pass
|
||||
|
||||
def destroy(self):
|
||||
pass
|
||||
|
||||
def update(self):
|
||||
pass
|
74
Space Invaders/main.py
Normal file
74
Space Invaders/main.py
Normal file
|
@ -0,0 +1,74 @@
|
|||
import pygame, sys
|
||||
from player import Player
|
||||
import obstacle
|
||||
from alien import Alien, UFO
|
||||
from random import choice, randint
|
||||
from laser import Laser
|
||||
|
||||
|
||||
class Game:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def create_obstacle(self, x_start, y_start, offset_x):
|
||||
pass
|
||||
|
||||
def create_multiple_obstacles(self, *offset, x_start, y_start):
|
||||
pass
|
||||
|
||||
def alien_setup(self, rows, cols, x_distance=60, y_distance=48, x_offset=70, y_offset=100):
|
||||
pass
|
||||
|
||||
def alien_position_checker(self):
|
||||
pass
|
||||
|
||||
def alien_move_down(self, distance):
|
||||
pass
|
||||
|
||||
def alien_shoot(self):
|
||||
pass
|
||||
|
||||
def ufo_timer(self):
|
||||
pass
|
||||
|
||||
def collision_checks(self):
|
||||
pass
|
||||
|
||||
# alien lasers
|
||||
|
||||
|
||||
# alien
|
||||
|
||||
|
||||
|
||||
def display_lives(self):
|
||||
pass
|
||||
|
||||
def display_score(self):
|
||||
pass
|
||||
|
||||
def victory_message(self):
|
||||
pass
|
||||
|
||||
def loser_message(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
# update sprite groups
|
||||
# draw
|
||||
pass
|
||||
|
||||
|
||||
class CRT:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def create_crt_lines(self):
|
||||
pass
|
||||
|
||||
def draw(self):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
17
Space Invaders/obstacle.py
Normal file
17
Space Invaders/obstacle.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import pygame
|
||||
|
||||
|
||||
class Block(pygame.sprite.Sprite):
|
||||
def __init__(self, size, color, x, y):
|
||||
pass
|
||||
|
||||
|
||||
shape = [
|
||||
' XXXXXXX ',
|
||||
' XXXXXXXXX ',
|
||||
'XXXXXXXXXXX',
|
||||
'XXXXXXXXXXX',
|
||||
'XXXXXXXXXXX',
|
||||
'XXX XXX',
|
||||
'XX XX'
|
||||
]
|
22
Space Invaders/player.py
Normal file
22
Space Invaders/player.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import pygame
|
||||
from laser import Laser
|
||||
|
||||
|
||||
class Player(pygame.sprite.Sprite):
|
||||
def __init__(self, pos, screen_width, speed):
|
||||
pass
|
||||
|
||||
def get_input(self):
|
||||
pass
|
||||
|
||||
def recharge(self):
|
||||
pass
|
||||
|
||||
def horizontal_bound(self):
|
||||
pass
|
||||
|
||||
def shoot_laser(self):
|
||||
pass
|
||||
|
||||
def update(self):
|
||||
pass
|
|
@ -1,2 +1,4 @@
|
|||
## Drone Invaders
|
||||
A *very* basic Space Invaders/Galaga style game made using turtle (and pygame, but only for sound and music).
|
||||
Atkinson's original is posted on canvas, but this is a lot cleaner code. I can't really tell if it works though,
|
||||
because it runs *very* slowly on the school computers.
|
Loading…
Reference in a new issue