Space Invaders added

This commit is contained in:
ben 2022-07-28 16:34:12 -05:00
parent 321ba3c9b9
commit b6366386c5
17 changed files with 150 additions and 1 deletions

19
Space Invaders/alien.py Normal file
View 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

View 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 :)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

12
Space Invaders/laser.py Normal file
View 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
View 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

View 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
View 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

View file

@ -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.