├── .gitignore ├── JavaScript_LifeSimGame ├── style.css └── index.html ├── JavaScript_EndlessRunnerGame ├── logic.js └── Index.html ├── README.md ├── Game Jam Submission Form.md ├── JavaScript_RPSGame ├── style.css ├── logic.js └── index.html ├── GameJamProjectBoards.md ├── gamePlanning.md ├── GameJamPresentation.md ├── JavaScript_ClassActivity_March21.md ├── Python_ClassActivity_March21.md ├── endlessRunner.py ├── Python_ShootingGame └── shootingGame.py ├── Python_FallingGame └── fallGame.py └── Python_FarioGame └── fario.py /.gitignore: -------------------------------------------------------------------------------- 1 | unPushed -------------------------------------------------------------------------------- /JavaScript_LifeSimGame/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /JavaScript_EndlessRunnerGame/logic.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlackTechPhilly/BTP-Games/HEAD/README.md -------------------------------------------------------------------------------- /Game Jam Submission Form.md: -------------------------------------------------------------------------------- 1 | # Game Jam Submission Form 2 | 3 | Please use the link below to submit your game folde 4 | 5 | [Game Submission Form ](https://forms.gle/dAWe6LyBvWi2VEEE9) 6 | -------------------------------------------------------------------------------- /JavaScript_RPSGame/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | text-align: center; 4 | padding: 20px; 5 | } 6 | .choice-btn { 7 | padding: 10px; 8 | margin: 5px; 9 | font-size: 16px; 10 | cursor: pointer; 11 | } -------------------------------------------------------------------------------- /GameJamProjectBoards.md: -------------------------------------------------------------------------------- 1 | # Project Board 2 | 3 | Provided below is the project boards that cover the objectives you'll need to complete by next week. 4 | Search for you or your teams name on the document below. 5 | 6 | [Project Board ](https://docs.google.com/presentation/d/1SDZqiQNimmyYdgr6bAmC6ThwK596NfTgzNSM-ZE1Xmo/edit?usp=sharing) 7 | -------------------------------------------------------------------------------- /gamePlanning.md: -------------------------------------------------------------------------------- 1 | # Game Jam Project Planning Form 2 | Take some time to brainstorm your game idea. Decide whether you want to work solo or as part of a team. Once you’re ready, click the link below to answer key questions about your game. 3 | 4 | You'll be expected to participate in an interview and create a project proposal to bring your game idea to life. 5 | 6 | Good luck 7 | 8 | [Game Planning Form ](https://forms.gle/V7yBFtCqkMa61Mpj8) 9 | -------------------------------------------------------------------------------- /JavaScript_EndlessRunnerGame/Index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Choose your move:
12 | 13 | 14 | 15 | 16 |Monthly Salary: $3000
25 |Remaining Balance: $3000
26 |Saved Money: $0
27 |Month: 1
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Python_FallingGame/fallGame.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import random 3 | 4 | # Initialize pygame 5 | pygame.init() 6 | 7 | # Game settings 8 | WIDTH, HEIGHT = 500, 600 9 | PLAYER_WIDTH, PLAYER_HEIGHT = 50, 50 10 | OBJECT_WIDTH, OBJECT_HEIGHT = 50, 50 11 | WHITE = (255, 255, 255) 12 | RED = (255, 0, 0) 13 | BLUE = (0, 0, 255) 14 | 15 | # Create screen 16 | screen = pygame.display.set_mode((WIDTH, HEIGHT)) 17 | pygame.display.set_caption("Avoid the Falling Objects") 18 | 19 | # Clock to control frame rate 20 | clock = pygame.time.Clock() 21 | FPS = 60 22 | 23 | class Player: 24 | def __init__(self): 25 | self.x = WIDTH // 2 26 | self.y = HEIGHT - PLAYER_HEIGHT - 10 27 | self.width = PLAYER_WIDTH 28 | self.height = PLAYER_HEIGHT 29 | self.speed = 5 30 | 31 | def move(self, keys): 32 | if keys[pygame.K_LEFT] and self.x > 0: 33 | self.x -= self.speed 34 | if keys[pygame.K_RIGHT] and self.x < WIDTH - self.width: 35 | self.x += self.speed 36 | 37 | def draw(self): 38 | pygame.draw.rect(screen, BLUE, (self.x, self.y, self.width, self.height)) 39 | 40 | class FallingObject: 41 | def __init__(self): 42 | self.x = random.randint(0, WIDTH - OBJECT_WIDTH) 43 | self.y = -OBJECT_HEIGHT 44 | self.width = OBJECT_WIDTH 45 | self.height = OBJECT_HEIGHT 46 | self.speed = random.randint(3, 7) 47 | 48 | def move(self): 49 | self.y += self.speed 50 | 51 | def draw(self): 52 | pygame.draw.rect(screen, RED, (self.x, self.y, self.width, self.height)) 53 | 54 | def off_screen(self): 55 | return self.y > HEIGHT 56 | 57 | # Game loop 58 | player = Player() 59 | falling_objects = [] 60 | score = 0 61 | lives = 3 62 | running = True 63 | 64 | while running: 65 | clock.tick(FPS) 66 | screen.fill(WHITE) # Clear screen 67 | 68 | # Handle events 69 | for event in pygame.event.get(): 70 | if event.type == pygame.QUIT: 71 | running = False 72 | 73 | # Player movement 74 | keys = pygame.key.get_pressed() 75 | player.move(keys) 76 | player.draw() 77 | 78 | # Add falling objects periodically 79 | if random.randint(1, 30) == 1: # Lower the number to increase difficulty 80 | falling_objects.append(FallingObject()) 81 | 82 | # Update falling objects 83 | for obj in falling_objects[:]: 84 | obj.move() 85 | obj.draw() 86 | 87 | # Check for collision 88 | if (obj.x < player.x + player.width and 89 | obj.x + obj.width > player.x and 90 | obj.y < player.y + player.height and 91 | obj.y + obj.height > player.y): 92 | lives -= 1 93 | falling_objects.remove(obj) # Remove object on collision 94 | 95 | # Remove objects off screen 96 | elif obj.off_screen(): 97 | falling_objects.remove(obj) 98 | score += 1 # Increase score for avoiding 99 | 100 | # Display score and lives 101 | font = pygame.font.Font(None, 36) 102 | score_text = font.render(f"Score: {score}", True, (0, 0, 0)) 103 | lives_text = font.render(f"Lives: {lives}", True, (255, 0, 0)) 104 | screen.blit(score_text, (10, 10)) 105 | screen.blit(lives_text, (10, 40)) 106 | 107 | # Check game over 108 | if lives <= 0: 109 | game_over_text = font.render("Game Over!", True, (0, 0, 0)) 110 | screen.blit(game_over_text, (WIDTH // 2 - 50, HEIGHT // 2)) 111 | pygame.display.update() 112 | pygame.time.delay(2000) # Pause before quitting 113 | running = False 114 | 115 | pygame.display.update() # Refresh screen 116 | 117 | pygame.quit() 118 | -------------------------------------------------------------------------------- /Python_FarioGame/fario.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import sys 3 | 4 | # ============================ 5 | # Step 1: Initialize Pygame 6 | # ============================ 7 | pygame.init() 8 | WIDTH, HEIGHT = 800, 600 9 | screen = pygame.display.set_mode((WIDTH, HEIGHT)) 10 | clock = pygame.time.Clock() 11 | pygame.display.set_caption("Mini Mario Style Game") 12 | 13 | # ============================ 14 | # Step 2: Define Colors 15 | # ============================ 16 | WHITE = (255, 255, 255) 17 | BLUE = (66, 135, 245) 18 | GREEN = (0, 200, 0) 19 | RED = (255, 0, 0) 20 | 21 | # ============================ 22 | # Step 3: Classes 23 | # ============================ 24 | 25 | class Player: 26 | def __init__(self, x, y): 27 | self.width = 100 28 | self.height = 60 29 | self.rect = pygame.Rect(x, y, self.width, self.height) 30 | self.vel = [0, 0] 31 | self.speed = 5 32 | self.jump_power = -15 33 | self.gravity = 1 34 | self.on_ground = False 35 | self.health = 100 36 | 37 | def handle_input(self, keys): 38 | if keys[pygame.K_LEFT]: 39 | self.vel[0] = -self.speed 40 | elif keys[pygame.K_RIGHT]: 41 | self.vel[0] = self.speed 42 | else: 43 | self.vel[0] = 0 44 | 45 | if keys[pygame.K_SPACE] and self.on_ground: 46 | self.vel[1] = self.jump_power 47 | self.on_ground = False 48 | 49 | def apply_physics(self, platforms): 50 | self.vel[1] += self.gravity 51 | self.rect.x += self.vel[0] 52 | self.rect.y += self.vel[1] 53 | 54 | self.on_ground = False 55 | for plat in platforms: 56 | if self.rect.colliderect(plat): 57 | if self.vel[1] > 0 and self.rect.bottom <= plat.top + self.vel[1]: 58 | self.rect.bottom = plat.top 59 | self.vel[1] = 0 60 | self.on_ground = True 61 | 62 | 63 | def attack(self): 64 | # Create attack hitbox extending to the right 65 | if self.vel[0] >= 0: # Facing right 66 | attack_rect = pygame.Rect(self.rect.right, self.rect.y + 10, 40, self.height - 20) 67 | else: # Facing left 68 | attack_rect = pygame.Rect(self.rect.left - 40, self.rect.y + 10, 40, self.height - 20) 69 | return attack_rect 70 | 71 | def draw(self, surface, scroll_x): 72 | pygame.draw.rect(surface, BLUE, (self.rect.x - scroll_x, self.rect.y, self.width, self.height)) 73 | 74 | 75 | class Enemy: 76 | 77 | def __init__(self, x, y, width=40, height=40): 78 | self.rect = pygame.Rect(x, y, width, height) 79 | self.speed = 10 80 | self.health = 30 81 | 82 | def draw(self, surface, scroll_x): 83 | pygame.draw.rect(surface, RED, (self.rect.x - scroll_x, self.rect.y, self.rect.width, self.rect.height)) 84 | 85 | 86 | # ============================ 87 | # Step 4: Platforms 88 | # ============================ 89 | platforms = [ 90 | pygame.Rect(0, HEIGHT - 40, 2000, 40), 91 | pygame.Rect(300, HEIGHT - 150, 100, 20), 92 | pygame.Rect(500, HEIGHT - 250, 100, 20), 93 | pygame.Rect(750, HEIGHT - 180, 150, 20), 94 | pygame.Rect(1000, HEIGHT - 300, 100, 20) 95 | ] 96 | 97 | # ============================ 98 | # Step 5: Create Player and Enemies 99 | # ============================ 100 | player = Player(100, HEIGHT - 150) 101 | enemies = [Enemy(600, HEIGHT - 100), Enemy(1100, HEIGHT - 340)] 102 | 103 | # ============================ 104 | # Step 6: Game Loop 105 | # ============================ 106 | running = True 107 | while running: 108 | clock.tick(60) 109 | screen.fill(WHITE) 110 | 111 | # ============================ 112 | # Step 7: Event Handling 113 | # ============================ 114 | for event in pygame.event.get(): 115 | if event.type == pygame.QUIT: 116 | pygame.quit() 117 | sys.exit() 118 | 119 | # ============================ 120 | # Step 8: Input 121 | # ============================ 122 | keys = pygame.key.get_pressed() 123 | player.handle_input(keys) 124 | 125 | # Handle attack key 126 | attack_rect = None 127 | if keys[pygame.K_a]: # Press A to attack 128 | attack_rect = player.attack() 129 | 130 | # ============================ 131 | # Step 9: Physics 132 | # ============================ 133 | player.apply_physics(platforms) 134 | 135 | # ============================ 136 | # Step 10: Enemy Collision 137 | # ============================ 138 | for enemy in enemies[:]: 139 | if player.rect.colliderect(enemy.rect): 140 | if player.vel[1] > 0 and player.rect.bottom <= enemy.rect.top + player.vel[1]: 141 | enemies.remove(enemy) 142 | player.vel[1] = player.jump_power // 2 # Bounce 143 | 144 | if attack_rect: 145 | for enemy in enemies[:]: 146 | if attack_rect.colliderect(enemy.rect): 147 | enemies.remove(enemy) 148 | # ============================ 149 | # Step 11: Camera Scroll 150 | # ============================ 151 | scroll_x = player.rect.x - WIDTH // 2 152 | 153 | # ============================ 154 | # Step 12: Drawing 155 | # ============================ 156 | for plat in platforms: 157 | pygame.draw.rect(screen, GREEN, (plat.x - scroll_x, plat.y, plat.width, plat.height)) 158 | 159 | for enemy in enemies: 160 | enemy.draw(screen, scroll_x) 161 | 162 | if attack_rect: 163 | pygame.draw.rect(screen, (0, 0, 0), (attack_rect.x - scroll_x, attack_rect.y, attack_rect.width, attack_rect.height), 2) 164 | 165 | player.draw(screen, scroll_x) 166 | 167 | pygame.display.flip() 168 | --------------------------------------------------------------------------------