-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_stats.py
More file actions
122 lines (105 loc) · 3.82 KB
/
game_stats.py
File metadata and controls
122 lines (105 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python3
"""
Game Statistics and Features Summary for Retro Space Defender
"""
import os
def analyze_game():
"""Analyze the game code and provide statistics"""
# Read the main game file
with open('retro_space_defender.py', 'r') as f:
code = f.read()
# Basic statistics
lines = code.split('\n')
total_lines = len(lines)
code_lines = len([line for line in lines if line.strip() and not line.strip().startswith('#')])
comment_lines = len([line for line in lines if line.strip().startswith('#')])
# Count classes and methods
classes = len([line for line in lines if line.strip().startswith('class ')])
methods = len([line for line in lines if 'def ' in line])
print("🎮 RETRO SPACE DEFENDER - GAME ANALYSIS")
print("=" * 50)
print(f"📊 Code Statistics:")
print(f" Total Lines: {total_lines}")
print(f" Code Lines: {code_lines}")
print(f" Comment Lines: {comment_lines}")
print(f" Classes: {classes}")
print(f" Methods: {methods}")
print()
print("🚀 Game Features:")
features = [
"✅ Retro neon color scheme",
"✅ Smooth player movement (arrow keys)",
"✅ Space bar shooting mechanism",
"✅ Multiple enemy types with AI",
"✅ Progressive difficulty scaling",
"✅ Power-up collection system",
"✅ Health and scoring system",
"✅ Collision detection",
"✅ Animated starfield background",
"✅ Pause/resume functionality",
"✅ Game over and restart system",
"✅ Real-time UI updates"
]
for feature in features:
print(f" {feature}")
print()
print("🎨 Visual Elements:")
visual_elements = [
"🔷 Neon blue player ship",
"🔴 Pink/yellow/cyan enemy ships",
"💚 Green player bullets",
"🌟 Colored enemy bullets",
"⭐ Moving star field",
"🎯 Circular power-ups",
"📊 Retro-style UI"
]
for element in visual_elements:
print(f" {element}")
print()
print("🎯 Game Mechanics:")
mechanics = [
"Player health system (3 lives)",
"Enemy spawning with increasing difficulty",
"Three types of power-ups (health, rapid fire, shield)",
"Score-based level progression",
"Collision detection for all objects",
"Boundary checking for movement",
"Automatic enemy bullet firing",
"Power-up spawn timing system"
]
for mechanic in mechanics:
print(f" • {mechanic}")
print()
print("🏆 Amazon Q CLI Game Challenge Compliance:")
compliance = [
"✅ Built using Python and Pygame",
"✅ Retro aesthetic theme implemented",
"✅ Interactive GUI with smooth gameplay",
"✅ Creative game mechanics and features",
"✅ Well-structured, documented code",
"✅ Complete game with win/lose conditions",
"✅ User-friendly controls and interface"
]
for item in compliance:
print(f" {item}")
print()
print("📁 Project Files:")
files = [
"retro_space_defender.py - Main game file",
"requirements.txt - Dependencies",
"README.md - Project documentation",
"test_game.py - Testing script",
"BLOG_POST_TEMPLATE.md - Blog template",
"game_stats.py - This analysis script"
]
for file in files:
if os.path.exists(file.split(' - ')[0]):
print(f" ✅ {file}")
else:
print(f" ❌ {file}")
if __name__ == "__main__":
analyze_game()
print()
print("🎮 Ready to play? Run: python3 retro_space_defender.py")
print("📝 Ready to blog? Check BLOG_POST_TEMPLATE.md")
print("🏆 Don't forget to share with #AmazonQCLI hashtag!")