gh-space-shooter 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gh_space_shooter/cli.py CHANGED
@@ -8,8 +8,8 @@ import typer
8
8
  from dotenv import load_dotenv
9
9
  from rich.console import Console
10
10
 
11
- from gh_space_shooter.game.strategies.base_strategy import BaseStrategy
12
-
11
+ from .constants import DEFAULT_FPS
12
+ from .game.strategies.base_strategy import BaseStrategy
13
13
  from .console_printer import ContributionConsolePrinter
14
14
  from .game import Animator, ColumnStrategy, RandomStrategy, RowStrategy
15
15
  from .github_client import ContributionData, GitHubAPIError, GitHubClient
@@ -55,6 +55,11 @@ def main(
55
55
  "-s",
56
56
  help="Strategy for clearing enemies (column, row, random)",
57
57
  ),
58
+ fps: int = typer.Option(
59
+ DEFAULT_FPS,
60
+ "--fps",
61
+ help="Frames per second for the animation",
62
+ ),
58
63
  ) -> None:
59
64
  """
60
65
  Fetch or load GitHub contribution graph data and display it.
@@ -90,7 +95,7 @@ def main(
90
95
  _save_data_to_file(data, raw_output)
91
96
 
92
97
  # Generate GIF if requested
93
- _generate_gif(data, out, strategy)
98
+ _generate_gif(data, out, strategy, fps)
94
99
 
95
100
  except CLIError as e:
96
101
  err_console.print(f"[bold red]Error:[/bold red] {e}")
@@ -146,8 +151,14 @@ def _save_data_to_file(data: ContributionData, file_path: str) -> None:
146
151
  raise CLIError(f"Failed to save file '{file_path}': {e}")
147
152
 
148
153
 
149
- def _generate_gif(data: ContributionData, file_path: str, strategy_name: str) -> None:
154
+ def _generate_gif(data: ContributionData, file_path: str, strategy_name: str, fps: int) -> None:
150
155
  """Generate animated GIF visualization."""
156
+ # GIF format limitation: delays below 20ms (>50 FPS) are clamped by most browsers
157
+ if fps > 50:
158
+ console.print(
159
+ f"[yellow]Warning:[/yellow] FPS > 50 may not display correctly in browsers "
160
+ f"(GIF delay will be {1000 // fps}ms, but browsers clamp delays < 20ms to ~100ms)"
161
+ )
151
162
  console.print("\n[bold blue]Generating GIF animation...[/bold blue]")
152
163
 
153
164
  if strategy_name == "column":
@@ -163,7 +174,7 @@ def _generate_gif(data: ContributionData, file_path: str, strategy_name: str) ->
163
174
 
164
175
  # Create animator and generate GIF
165
176
  try:
166
- animator = Animator(data, strategy)
177
+ animator = Animator(data, strategy, fps=fps)
167
178
  animator.generate_gif(file_path)
168
179
  console.print(f"[green]✓[/green] GIF saved to {file_path}")
169
180
  except Exception as e:
@@ -1,11 +1,30 @@
1
1
  """Global constants for the application."""
2
2
 
3
+ # Animation settings
4
+ DEFAULT_FPS = 40 # Default frames per second for animation
5
+
3
6
  # GitHub contribution graph dimensions
4
7
  NUM_WEEKS = 52 # Number of weeks in contribution graph
5
8
  NUM_DAYS = 7 # Number of days in a week (Sun-Sat)
6
9
  SHIP_POSITION_Y = NUM_DAYS + 3 # Ship is positioned just below the grid
7
10
 
8
- SHIP_SPEED = 0.25 # Cells per frame the ship moves
9
- BULLET_SPEED = 0.15 # Cells per frame the bullet moves
10
- FRAME_DURATION_MS = 20 # Duration of each frame in milliseconds
11
- SHIP_SHOOT_COOLDOWN_FRAMES = 10 # Frames between ship shots
11
+ # Speeds in cells per second (frame-rate independent)
12
+ SHIP_SPEED = 12.5 # Cells per second the ship moves
13
+ BULLET_SPEED = 7.5 # Cells per second the bullet moves
14
+ BULLET_TRAILING_LENGTH = 3 # Number of trailing segments for bullets
15
+ BULLET_TRAIL_SPACING = 0.15 # Spacing between trail segments in cells
16
+
17
+ # Durations in seconds (frame-rate independent)
18
+ SHIP_SHOOT_COOLDOWN = 0.2 # Seconds between ship shots
19
+
20
+ # Explosion settings
21
+ EXPLOSION_PARTICLE_COUNT_LARGE = 8 # Number of particles in a large explosion
22
+ EXPLOSION_PARTICLE_COUNT_SMALL = 4 # Number of particles in a small explosion
23
+ EXPLOSION_MAX_RADIUS_LARGE = 20 # Max radius for large explosions
24
+ EXPLOSION_MAX_RADIUS_SMALL = 10 # Max radius for small explosions
25
+ EXPLOSION_DURATION_LARGE = 0.4 # Seconds for large explosion animation
26
+ EXPLOSION_DURATION_SMALL = 0.12 # Seconds for small explosion animation
27
+
28
+ # Starfield settings (speeds in cells per second)
29
+ STAR_SPEED_MIN = 1.0 # Minimum star speed (dimmer/farther stars)
30
+ STAR_SPEED_MAX = 2.5 # Maximum star speed (brighter/closer stars)
@@ -5,7 +5,6 @@ from typing import Iterator
5
5
  from PIL import Image
6
6
 
7
7
 
8
- from ..constants import FRAME_DURATION_MS
9
8
  from ..github_client import ContributionData
10
9
  from .game_state import GameState
11
10
  from .renderer import Renderer
@@ -20,7 +19,7 @@ class Animator:
20
19
  self,
21
20
  contribution_data: ContributionData,
22
21
  strategy: BaseStrategy,
23
- frame_duration: int = FRAME_DURATION_MS,
22
+ fps: int,
24
23
  ):
25
24
  """
26
25
  Initialize animator.
@@ -28,11 +27,15 @@ class Animator:
28
27
  Args:
29
28
  contribution_data: The GitHub contribution data
30
29
  strategy: The strategy to use for clearing enemies
31
- frame_duration: Duration of each frame in milliseconds
30
+ fps: Frames per second for the animation
32
31
  """
33
32
  self.contribution_data = contribution_data
34
33
  self.strategy = strategy
35
- self.frame_duration = frame_duration
34
+ self.fps = fps
35
+ self.frame_duration = 1000 // fps
36
+ # Delta time in seconds per frame
37
+ # Used to scale all speeds (cells/second) to per-frame movement
38
+ self.delta_time = 1.0 / fps
36
39
 
37
40
  def generate_gif(self, output_path: str) -> None:
38
41
  """
@@ -79,18 +82,18 @@ class Animator:
79
82
  for action in self.strategy.generate_actions(game_state):
80
83
  game_state.ship.move_to(action.x)
81
84
  while game_state.can_take_action() is False:
82
- game_state.animate()
85
+ game_state.animate(self.delta_time)
83
86
  yield renderer.render_frame()
84
87
 
85
88
  if action.shoot:
86
89
  game_state.shoot()
87
- game_state.animate()
90
+ game_state.animate(self.delta_time)
88
91
  yield renderer.render_frame()
89
92
 
90
93
  force_kill_countdown = 100
91
94
  # Add final frames showing completion
92
95
  while not game_state.is_complete():
93
- game_state.animate()
96
+ game_state.animate(self.delta_time)
94
97
  yield renderer.render_frame()
95
98
 
96
99
  force_kill_countdown -= 1
@@ -4,7 +4,7 @@ from typing import TYPE_CHECKING
4
4
 
5
5
  from PIL import ImageDraw
6
6
 
7
- from ...constants import BULLET_SPEED, SHIP_POSITION_Y
7
+ from ...constants import BULLET_SPEED, BULLET_TRAILING_LENGTH, BULLET_TRAIL_SPACING, SHIP_POSITION_Y
8
8
  from .drawable import Drawable
9
9
  from .explosion import Explosion
10
10
 
@@ -37,9 +37,13 @@ class Bullet(Drawable):
37
37
  return enemy
38
38
  return None
39
39
 
40
- def animate(self) -> None:
41
- """Update bullet position, check for collisions, and remove on hit."""
42
- self.y -= BULLET_SPEED
40
+ def animate(self, delta_time: float) -> None:
41
+ """Update bullet position, check for collisions, and remove on hit.
42
+
43
+ Args:
44
+ delta_time: Time elapsed since last frame in seconds.
45
+ """
46
+ self.y -= BULLET_SPEED * delta_time
43
47
  hit_enemy = self._check_collision()
44
48
  if hit_enemy:
45
49
  explosion = Explosion(self.x, self.y, "small", self.game_state)
@@ -52,10 +56,9 @@ class Bullet(Drawable):
52
56
  def draw(self, draw: ImageDraw.ImageDraw, context: "RenderContext") -> None:
53
57
  """Draw the bullet with trailing tail effect."""
54
58
 
55
- trail_num = 3
56
- for i in range(trail_num):
57
- trail_y = self.y + (i + 1) * BULLET_SPEED
58
- fade_factor = (i + 1) / trail_num / 2
59
+ for i in range(BULLET_TRAILING_LENGTH):
60
+ trail_y = self.y + (i + 1) * BULLET_TRAIL_SPACING
61
+ fade_factor = (i + 1) / BULLET_TRAILING_LENGTH / 2
59
62
  self._draw_bullet(draw, context, (self.x, trail_y), fade_factor=fade_factor)
60
63
 
61
64
  self._draw_bullet(draw, context, (self.x, self.y), fade_factor=0.3, offset=.6)
@@ -13,8 +13,12 @@ class Drawable(ABC):
13
13
  """Interface for objects that can be animated and drawn."""
14
14
 
15
15
  @abstractmethod
16
- def animate(self) -> None:
17
- """Update the object's state for the next animation frame."""
16
+ def animate(self, delta_time: float) -> None:
17
+ """Update the object's state for the next animation frame.
18
+
19
+ Args:
20
+ delta_time: Time elapsed since last frame in seconds.
21
+ """
18
22
  pass
19
23
 
20
24
  @abstractmethod
@@ -42,7 +42,7 @@ class Enemy(Drawable):
42
42
  self.game_state.explosions.append(explosion)
43
43
  self.game_state.enemies.remove(self)
44
44
 
45
- def animate(self) -> None:
45
+ def animate(self, delta_time: float) -> None:
46
46
  """Update enemy state for next frame (enemies don't animate currently)."""
47
47
  pass
48
48
 
@@ -6,6 +6,14 @@ from typing import TYPE_CHECKING, Literal
6
6
 
7
7
  from PIL import ImageDraw
8
8
 
9
+ from ...constants import (
10
+ EXPLOSION_DURATION_LARGE,
11
+ EXPLOSION_DURATION_SMALL,
12
+ EXPLOSION_MAX_RADIUS_LARGE,
13
+ EXPLOSION_MAX_RADIUS_SMALL,
14
+ EXPLOSION_PARTICLE_COUNT_LARGE,
15
+ EXPLOSION_PARTICLE_COUNT_SMALL,
16
+ )
9
17
  from .drawable import Drawable
10
18
 
11
19
  if TYPE_CHECKING:
@@ -29,36 +37,36 @@ class Explosion(Drawable):
29
37
  self.x = x
30
38
  self.y = y
31
39
  self.game_state = game_state
32
- self.frame = 0
33
- self.max_frames = 6 if size == "small" else 20
34
- self.max_radius = 10 if size == "small" else 20
35
- self.particle_count = 4 if size == "small" else 8
36
- # Generate random angles for each particle
40
+ self.elapsed_time = 0.0 # Seconds elapsed since explosion started
41
+ self.duration = EXPLOSION_DURATION_SMALL if size == "small" else EXPLOSION_DURATION_LARGE
42
+ self.max_radius = EXPLOSION_MAX_RADIUS_SMALL if size == "small" else EXPLOSION_MAX_RADIUS_LARGE
43
+ self.particle_count = EXPLOSION_PARTICLE_COUNT_SMALL if size == "small" else EXPLOSION_PARTICLE_COUNT_LARGE
37
44
  self.particle_angles = [random.uniform(0, 2 * math.pi) for _ in range(self.particle_count)]
38
45
 
39
- def animate(self) -> None:
40
- """Progress the explosion animation and remove when complete."""
41
- self.frame += 1
42
- if self.frame >= self.max_frames:
46
+ def animate(self, delta_time: float) -> None:
47
+ """Progress the explosion animation and remove when complete.
48
+
49
+ Args:
50
+ delta_time: Time elapsed since last frame in seconds.
51
+ """
52
+ self.elapsed_time += delta_time
53
+ if self.elapsed_time >= self.duration:
43
54
  self.game_state.explosions.remove(self)
44
55
 
45
56
  def draw(self, draw: ImageDraw.ImageDraw, context: "RenderContext") -> None:
46
57
  """Draw expanding particle explosion with fade effect."""
47
- # Calculate animation progress (0 to 1)
48
- progress = self.frame / self.max_frames
58
+
59
+ progress = self.elapsed_time / self.duration
49
60
  fade = 1 - progress # Fade out as animation progresses
50
61
 
51
- # Get center position
52
62
  center_x, center_y = context.get_cell_position(self.x, self.y)
53
63
  center_x += context.cell_size // 2
54
64
  center_y += context.cell_size // 2
55
65
 
56
- # Draw expanding particles in random directions
57
66
  for i in range(self.particle_count):
58
67
  distance = progress * self.max_radius
59
68
  angle = self.particle_angles[i]
60
69
 
61
- # Particle position using random angle
62
70
  px = int(center_x + distance * math.cos(angle))
63
71
  py = int(center_y + distance * math.sin(angle))
64
72
 
@@ -19,7 +19,7 @@ class Ship(Drawable):
19
19
  """Initialize the ship at starting position."""
20
20
  self.x: float = 25 # Start middle of screen
21
21
  self.target_x = self.x
22
- self.shoot_cooldown = 0 # Frames until ship can shoot again
22
+ self.shoot_cooldown = 0.0 # Seconds until ship can shoot again
23
23
  self.game_state = game_state
24
24
 
25
25
  def move_to(self, x: int):
@@ -37,18 +37,23 @@ class Ship(Drawable):
37
37
 
38
38
  def can_shoot(self) -> bool:
39
39
  """Check if ship can shoot (cooldown has finished)."""
40
- return self.shoot_cooldown == 0
40
+ return self.shoot_cooldown <= 0
41
41
 
42
- def animate(self) -> None:
43
- """Update ship position, moving toward target at constant speed."""
42
+ def animate(self, delta_time: float) -> None:
43
+ """Update ship position, moving toward target at constant speed.
44
+
45
+ Args:
46
+ delta_time: Time elapsed since last frame in seconds.
47
+ """
48
+ delta_x = SHIP_SPEED * delta_time
44
49
  if self.x < self.target_x:
45
- self.x = min(self.x + SHIP_SPEED, self.target_x)
50
+ self.x = min(self.x + delta_x, self.target_x)
46
51
  elif self.x > self.target_x:
47
- self.x = max(self.x - SHIP_SPEED, self.target_x)
52
+ self.x = max(self.x - delta_x, self.target_x)
48
53
 
49
- # Decrement shoot cooldown
54
+ # Decrement shoot cooldown (scaled by delta_time)
50
55
  if self.shoot_cooldown > 0:
51
- self.shoot_cooldown -= 1
56
+ self.shoot_cooldown -= delta_time
52
57
 
53
58
  def draw(self, draw: ImageDraw.ImageDraw, context: "RenderContext") -> None:
54
59
  """Draw a simple Galaga-style ship."""
@@ -1,23 +1,30 @@
1
1
  """Animated starfield background."""
2
2
 
3
3
  import random
4
- from typing import TYPE_CHECKING
4
+ from typing import TYPE_CHECKING, TypedDict
5
5
 
6
6
  from PIL import ImageDraw
7
7
 
8
- from ...constants import NUM_WEEKS, SHIP_POSITION_Y
8
+ from ...constants import NUM_WEEKS, SHIP_POSITION_Y, STAR_SPEED_MIN, STAR_SPEED_MAX
9
9
  from .drawable import Drawable
10
10
 
11
11
  if TYPE_CHECKING:
12
12
  from ..render_context import RenderContext
13
13
 
14
+ class Star(TypedDict):
15
+ x: float
16
+ y: float
17
+ brightness: float
18
+ size: int
19
+ speed: float
20
+
14
21
 
15
22
  class Starfield(Drawable):
16
23
  """Animated starfield background with slowly moving stars."""
17
24
 
18
- def __init__(self):
25
+ def __init__(self) -> None:
19
26
  """Initialize the starfield with random stars."""
20
- self.stars = []
27
+ self.stars: list[Star] = []
21
28
  # Generate about 100 stars across the play area
22
29
  for _ in range(100):
23
30
  # Random position across the entire grid area
@@ -27,25 +34,34 @@ class Starfield(Drawable):
27
34
  brightness = random.uniform(0.2, 1.0)
28
35
  # Size: 1-2 pixels
29
36
  size = random.choice([1, 1, 1, 2]) # More 1-pixel stars
30
- # Speed: slower for dimmer (farther) stars
31
- speed = 0.02 + (brightness * 0.03) # 0.02-0.05 cells per frame
32
- self.stars.append([x, y, brightness, size, speed])
37
+ # Speed: slower for dimmer (farther) stars (in cells per second)
38
+ speed = STAR_SPEED_MIN + (brightness * (STAR_SPEED_MAX - STAR_SPEED_MIN))
39
+ self.stars.append(
40
+ {"x": x, "y": y, "brightness": brightness, "size": size, "speed": speed}
41
+ )
42
+
43
+ def animate(self, delta_time: float) -> None:
44
+ """Move stars downward, wrapping around when they go off screen.
33
45
 
34
- def animate(self) -> None:
35
- """Move stars downward, wrapping around when they go off screen."""
46
+ Args:
47
+ delta_time: Time elapsed since last frame in seconds.
48
+ """
36
49
  for star in self.stars:
37
- # star[1] is the y position, star[4] is the speed
38
- star[1] += star[4]
50
+ star["y"] += star["speed"] * delta_time
39
51
 
40
52
  # Wrap around: if star goes below the screen, move it back to the top
41
- if star[1] > SHIP_POSITION_Y + 4:
42
- star[1] = -2
53
+ if star["y"] > SHIP_POSITION_Y + 4:
54
+ star["y"] = -2
43
55
  # Randomize x position when wrapping for variety
44
- star[0] = random.uniform(-2, NUM_WEEKS + 2)
56
+ star["x"] = random.uniform(-2, NUM_WEEKS + 2)
45
57
 
46
58
  def draw(self, draw: ImageDraw.ImageDraw, context: "RenderContext") -> None:
47
59
  """Draw all stars at their current positions."""
48
- for star_x, star_y, brightness, size, _ in self.stars:
60
+ for star in self.stars:
61
+ star_x = star["x"]
62
+ star_y = star["y"]
63
+ brightness = star["brightness"]
64
+ size = star["size"]
49
65
  # Convert grid position to pixel position
50
66
  x, y = context.get_cell_position(star_x, star_y)
51
67
 
@@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, List
4
4
 
5
5
  from PIL import ImageDraw
6
6
 
7
- from ..constants import SHIP_SHOOT_COOLDOWN_FRAMES
7
+ from ..constants import SHIP_SHOOT_COOLDOWN
8
8
  from ..github_client import ContributionData
9
9
  from .drawables import Bullet, Drawable, Enemy, Explosion, Ship, Starfield
10
10
 
@@ -47,7 +47,7 @@ class GameState(Drawable):
47
47
  """
48
48
  bullet = Bullet(int(self.ship.x), game_state=self)
49
49
  self.bullets.append(bullet)
50
- self.ship.shoot_cooldown = SHIP_SHOOT_COOLDOWN_FRAMES
50
+ self.ship.shoot_cooldown = SHIP_SHOOT_COOLDOWN
51
51
 
52
52
  def is_complete(self) -> bool:
53
53
  """Check if game is complete (all enemies destroyed)."""
@@ -57,16 +57,20 @@ class GameState(Drawable):
57
57
  """Check if ship can take an action (not moving and can shoot)."""
58
58
  return not self.ship.is_moving() and self.ship.can_shoot()
59
59
 
60
- def animate(self) -> None:
61
- """Update all game objects for next frame."""
62
- self.starfield.animate()
63
- self.ship.animate()
60
+ def animate(self, delta_time: float) -> None:
61
+ """Update all game objects for next frame.
62
+
63
+ Args:
64
+ delta_time: Time elapsed since last frame in seconds.
65
+ """
66
+ self.starfield.animate(delta_time)
67
+ self.ship.animate(delta_time)
64
68
  for enemy in self.enemies:
65
- enemy.animate()
69
+ enemy.animate(delta_time)
66
70
  for bullet in self.bullets:
67
- bullet.animate()
71
+ bullet.animate(delta_time)
68
72
  for explosion in self.explosions:
69
- explosion.animate()
73
+ explosion.animate(delta_time)
70
74
 
71
75
  def draw(self, draw: ImageDraw.ImageDraw, context: "RenderContext") -> None:
72
76
  """Draw all game objects including the grid."""
@@ -32,7 +32,6 @@ class ContributionData(TypedDict):
32
32
  username: str
33
33
  total_contributions: int
34
34
  weeks: list[ContributionWeek]
35
- fetched_at: str
36
35
 
37
36
 
38
37
  class GitHubAPIError(Exception):
@@ -157,7 +156,6 @@ class GitHubClient:
157
156
  "username": username,
158
157
  "total_contributions": calendar["totalContributions"],
159
158
  "weeks": weeks,
160
- "fetched_at": datetime.now().isoformat(),
161
159
  }
162
160
 
163
161
  LEVEL_MAP = {
@@ -1,15 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gh-space-shooter
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: A CLI tool that visualizes GitHub contribution graphs as gamified GIFs
5
5
  Author-email: zane <czl970721@gmail.com>
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.13
8
8
  Requires-Dist: httpx>=0.27.0
9
- Requires-Dist: pillow>=10.0.0
9
+ Requires-Dist: pillow>=10.1.0
10
10
  Requires-Dist: python-dotenv>=1.0.0
11
11
  Requires-Dist: rich>=13.0.0
12
12
  Requires-Dist: typer>=0.12.0
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
13
15
  Description-Content-Type: text/markdown
14
16
 
15
17
  # gh-space-shooter 🚀
@@ -18,19 +20,50 @@ Transform your GitHub contribution graph into an epic space shooter game!
18
20
 
19
21
  ![Example Game](example.gif)
20
22
 
21
- ## Features
23
+ ## Usage
24
+
25
+ ### GitHub Action
26
+
27
+ Automatically update your game GIF daily using GitHub Actions! Add this workflow to your repository at `.github/workflows/update-game.yml`:
22
28
 
23
- - 🚀 **Galaga-style space shooter** - Classic arcade gameplay with your contribution data
24
- - 📊 **GitHub integration** - Fetches your last 52 weeks of contributions automatically
25
- - 🎮 **Smart enemy AI** - Multiple attack strategies (columns, rows, random patterns)
26
- - 💥 **Particle effects** - Explosions with randomized particles and smooth animations
27
- - 🎨 **Polished graphics** - Rounded enemies, smooth ship design, starfield background
28
- - 📈 **Contribution stats** - View your coding activity statistics
29
- - 💾 **Export options** - Save both the GIF and raw JSON data
29
+ ```yaml
30
+ name: Update Space Shooter Game
30
31
 
31
- ## Installation
32
+ on:
33
+ schedule:
34
+ - cron: '0 0 * * *' # Daily at midnight UTC
35
+ workflow_dispatch: # Allow manual trigger
32
36
 
33
- ### From PyPI (Recommended)
37
+ permissions:
38
+ contents: write
39
+
40
+ jobs:
41
+ update-game:
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+
46
+ - uses: czl9707/gh-space-shooter@v1
47
+ with:
48
+ github-token: ${{ secrets.GITHUB_TOKEN }}
49
+ output-path: 'game.gif'
50
+ strategy: 'random'
51
+ ```
52
+
53
+ Then display it in your README:
54
+ ```markdown
55
+ ![My GitHub Game](game.gif)
56
+ ```
57
+
58
+ **Action Inputs:**
59
+ - `github-token` (required): GitHub token for fetching contributions
60
+ - `username` (optional): Username to generate game for (defaults to repo owner)
61
+ - `output-path` (optional): Where to save the GIF (default: `gh-space-shooter.gif`)
62
+ - `strategy` (optional): Attack pattern - `column`, `row`, or `random` (default: `random`)
63
+ - `fps` (optional): Frames per second for the animation (default: `40`)
64
+ - `commit-message` (optional): Commit message for the update
65
+
66
+ ### From PyPI
34
67
 
35
68
  ```bash
36
69
  pip install gh-space-shooter
@@ -92,6 +125,11 @@ gh-space-shooter torvalds -o my-game.gif
92
125
  gh-space-shooter torvalds --strategy column # Enemies attack in columns
93
126
  gh-space-shooter torvalds --strategy row # Enemies attack in rows
94
127
  gh-space-shooter torvalds -s random # Random chaos (default)
128
+
129
+ # Adjust animation frame rate
130
+ gh-space-shooter torvalds --fps 25 # Slower, smaller file size
131
+ gh-space-shooter torvalds --fps 40 # Default frame rate
132
+ gh-space-shooter torvalds --fps 50 # Smoother animation
95
133
  ```
96
134
 
97
135
  This creates an animated GIF showing:
@@ -131,8 +169,7 @@ When saved to JSON, the data includes:
131
169
  }
132
170
  ]
133
171
  }
134
- ],
135
- "fetched_at": "2024-12-30T12:00:00"
172
+ ]
136
173
  }
137
174
  ```
138
175
 
@@ -0,0 +1,28 @@
1
+ gh_space_shooter/__init__.py,sha256=jBFfHY3YC8-3m-eVPIo3CWoQLsy5Yvd0vcbHVbUDTWY,337
2
+ gh_space_shooter/cli.py,sha256=mCo7PH0XGCeGG9V6lCPlZMCmDIapeJVCfJenQgEW9o8,5798
3
+ gh_space_shooter/console_printer.py,sha256=opT5vITkPJ_9BCPNMDays6EtXez9m86YXY9pK5_Hdh8,2345
4
+ gh_space_shooter/constants.py,sha256=jMEaDAO1xdo9Bu4SN0vcOZfoESl3IAfF8r8OS8CSuwM,1399
5
+ gh_space_shooter/github_client.py,sha256=PkXGWjR7TpzJvCPg37RM4kPq1phg_MlyBpHNtofaNXQ,4697
6
+ gh_space_shooter/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ gh_space_shooter/game/__init__.py,sha256=bIc-S0hOiYqYBtdmd9_CedqYY07Il6XiV__TqcbtJNA,707
8
+ gh_space_shooter/game/animator.py,sha256=G9PGcIQkdPgxByIKC1vlFnVHNdvTNefinXYj1_TEIMo,3126
9
+ gh_space_shooter/game/game_state.py,sha256=s-aQ-XvL4ybeu7q1Dhmd5tngC6fIMVbEBGrDtp6ELME,2949
10
+ gh_space_shooter/game/render_context.py,sha256=TPJw9RmRB0_786W-O7nfB61UoDzDT_SlEVdaSlW750c,1805
11
+ gh_space_shooter/game/renderer.py,sha256=J13eUOWHkImtiNWGyvRqORM7ngg1Q7LBUgs4cWFl26g,1617
12
+ gh_space_shooter/game/drawables/__init__.py,sha256=lzo3O5cxahrYTyOQVrz7rQ3Prkaj8Z_dpzlt0UdurOo,306
13
+ gh_space_shooter/game/drawables/bullet.py,sha256=GTWDD0YqJ6cVlXBVFGNB_TPf0FV_J5Drmw23Fx_VpdE,3100
14
+ gh_space_shooter/game/drawables/drawable.py,sha256=JjPnzpTnaRvKHYiQVCLOiq0zHjR8rOo7jqf6bKu5cKo,847
15
+ gh_space_shooter/game/drawables/enemy.py,sha256=clBEpp4TqVPLD_d6jTiuXipI3BbLJv_ks8eqvDr0vmc,1940
16
+ gh_space_shooter/game/drawables/explosion.py,sha256=XfIbecMwlx8WwFV4HqFA_0hpLc3_eDRektvdvqB0dJo,2944
17
+ gh_space_shooter/game/drawables/ship.py,sha256=_DIX5JbQkcLoGpUGf9M87g_5QB5bMYi1sSLsfhEDad4,3396
18
+ gh_space_shooter/game/drawables/starfield.py,sha256=VEUj7gX-R_GtBklr6JDekGdphsHc-ZkvRcA-m1LFGCs,2980
19
+ gh_space_shooter/game/strategies/__init__.py,sha256=a34i4FlNv-aQ-oEkT1ha7oJDBt7Cd7EFpbMWsYNHpW0,338
20
+ gh_space_shooter/game/strategies/base_strategy.py,sha256=IwPdthCWkgsFdUsMjQgifpSJv1bPRCCuUMF0o00y6pk,1152
21
+ gh_space_shooter/game/strategies/column_strategy.py,sha256=AQHXVTRe5BEjc4QHRL9QLtkkelTzGUGf2531POGtkG0,1728
22
+ gh_space_shooter/game/strategies/random_strategy.py,sha256=l0GKMkGJa_QEvNrN57R_KgWDBafGebP926fZJqpdghc,2215
23
+ gh_space_shooter/game/strategies/row_strategy.py,sha256=8izcioSGrVYGdQ__GrdfAQxnJt1BLhwNdumeuQiDhpg,1426
24
+ gh_space_shooter-0.0.4.dist-info/METADATA,sha256=DcUrmwjeM1VUOkm1th-R164K3FUYrxYIaj4wwuD8r-0,4310
25
+ gh_space_shooter-0.0.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
+ gh_space_shooter-0.0.4.dist-info/entry_points.txt,sha256=SmK2ET5vz62eaMC4mhxmLJ1f_H9qSTXOvFOHNo-qwCk,62
27
+ gh_space_shooter-0.0.4.dist-info/licenses/LICENSE,sha256=teCrgzzcmjYCQ-RqXkDmICcHMN1AfaabrjZsW6O3KEk,1075
28
+ gh_space_shooter-0.0.4.dist-info/RECORD,,
@@ -1,28 +0,0 @@
1
- gh_space_shooter/__init__.py,sha256=jBFfHY3YC8-3m-eVPIo3CWoQLsy5Yvd0vcbHVbUDTWY,337
2
- gh_space_shooter/cli.py,sha256=AHONWh6Kv9Y8D7OWsnOH6kOjN73aSCXF8Ats9jKJwkY,5310
3
- gh_space_shooter/console_printer.py,sha256=opT5vITkPJ_9BCPNMDays6EtXez9m86YXY9pK5_Hdh8,2345
4
- gh_space_shooter/constants.py,sha256=HR_FYewYnjQ8V5fJwMS2UhiYSS3l0iR5Y8bmaS3thQE,498
5
- gh_space_shooter/github_client.py,sha256=Ugt4wi8RAvnYPO8fF7-MgugD5t91nxQUcEnCf-Hmc-8,4771
6
- gh_space_shooter/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- gh_space_shooter/game/__init__.py,sha256=bIc-S0hOiYqYBtdmd9_CedqYY07Il6XiV__TqcbtJNA,707
8
- gh_space_shooter/game/animator.py,sha256=5nCY0xfRl6tifwixUlUlVXCQfDjhsR6HbQBKHHmYHH8,2998
9
- gh_space_shooter/game/game_state.py,sha256=pvKc-FAapVXuFNb2hCGoOhJI1P8kWXkyCf_lruc-j50,2804
10
- gh_space_shooter/game/render_context.py,sha256=TPJw9RmRB0_786W-O7nfB61UoDzDT_SlEVdaSlW750c,1805
11
- gh_space_shooter/game/renderer.py,sha256=J13eUOWHkImtiNWGyvRqORM7ngg1Q7LBUgs4cWFl26g,1617
12
- gh_space_shooter/game/drawables/__init__.py,sha256=lzo3O5cxahrYTyOQVrz7rQ3Prkaj8Z_dpzlt0UdurOo,306
13
- gh_space_shooter/game/drawables/bullet.py,sha256=8DjqXI1Ab4IINi77szJuRc5Bqilb0gvofKgcQ9s0ONM,2920
14
- gh_space_shooter/game/drawables/drawable.py,sha256=xIJWI5m-kZCbvCfgYF4jiqTvPFelViJ1gLilz7adJoM,738
15
- gh_space_shooter/game/drawables/enemy.py,sha256=RCIE4Vn2tis0iJmJO_JUIxnomSgDSsfFhrcPPWmFLhE,1921
16
- gh_space_shooter/game/drawables/explosion.py,sha256=Ek2CCjjifkLVSpaJ4Nv8ey1VhkXNK6HeKK3wB0fRI5g,2618
17
- gh_space_shooter/game/drawables/ship.py,sha256=j389lXOUWvPoFZUNvVN-OEjhTtIlEkAVeEYqF7gDBIE,3216
18
- gh_space_shooter/game/drawables/starfield.py,sha256=ON_cQ6Qfg30ocLHQEp1dceqputHmxJ7sf61o4uNF4Ng,2530
19
- gh_space_shooter/game/strategies/__init__.py,sha256=a34i4FlNv-aQ-oEkT1ha7oJDBt7Cd7EFpbMWsYNHpW0,338
20
- gh_space_shooter/game/strategies/base_strategy.py,sha256=IwPdthCWkgsFdUsMjQgifpSJv1bPRCCuUMF0o00y6pk,1152
21
- gh_space_shooter/game/strategies/column_strategy.py,sha256=AQHXVTRe5BEjc4QHRL9QLtkkelTzGUGf2531POGtkG0,1728
22
- gh_space_shooter/game/strategies/random_strategy.py,sha256=l0GKMkGJa_QEvNrN57R_KgWDBafGebP926fZJqpdghc,2215
23
- gh_space_shooter/game/strategies/row_strategy.py,sha256=8izcioSGrVYGdQ__GrdfAQxnJt1BLhwNdumeuQiDhpg,1426
24
- gh_space_shooter-0.0.2.dist-info/METADATA,sha256=Kd8sR8mbxG7X88E0abNI8ohBtZrN-NtjzDyNqFFFqTQ,3493
25
- gh_space_shooter-0.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
- gh_space_shooter-0.0.2.dist-info/entry_points.txt,sha256=SmK2ET5vz62eaMC4mhxmLJ1f_H9qSTXOvFOHNo-qwCk,62
27
- gh_space_shooter-0.0.2.dist-info/licenses/LICENSE,sha256=teCrgzzcmjYCQ-RqXkDmICcHMN1AfaabrjZsW6O3KEk,1075
28
- gh_space_shooter-0.0.2.dist-info/RECORD,,