Skip to content

Conversation

kienvo
Copy link
Member

@kienvo kienvo commented Jul 30, 2025

Resolves #102

Simple pong game to make use of the 2 top buttons.

Summary by Sourcery

Add a simple Pong game mode with basic paddle and ball rendering and a placeholder game loop.

New Features:

  • Define paddle and ball data structures with positions and velocities
  • Implement pong_init to set initial positions and velocities for paddle and ball
  • Implement pong_render to draw the paddle and ball onto the framebuffer
  • Integrate a Pong game loop into main, calling pong_update and pong_render

Enhancements:

  • Add a stub pong_update function for future game logic

Copy link
Contributor

sourcery-ai bot commented Jul 30, 2025

Reviewer's Guide

Implements a simple pong game by defining paddle and ball state, providing init/update/render routines, and temporarily integrating the game loop into main before returning to normal operation.

Class diagram for new Pong game structures

classDiagram
    class paddle_st {
        +uint8_t size
        +uint8_t pos_x
    }
    class ball_st {
        +uint8_t px
        +uint8_t py
        +uint8_t vx
        +uint8_t vy
    }
Loading

File-Level Changes

Change Details Files
Introduce game state structures and constants for paddle and ball
  • Add PADDLESZ constant
  • Define paddle_st and ball_st structs
  • Declare global paddle and ball variables
src/main.c
Implement pong game lifecycle functions
  • Create pong_init to set initial positions and velocities
  • Stub pong_update for future game logic
  • Create pong_render to clear framebuffer and draw paddle and ball
src/main.c
Integrate pong loop into main execution
  • Call pong_init after spawn_tasks
  • Add game loop invoking pong_update, pong_render, and DelayMs
  • Break on mode change and reset mode to NORMAL
src/main.c

Assessment against linked issues

Issue Objective Addressed Explanation
#102 Implement support for two buttons in Badge Magic firmware, ensuring integration with existing BLE and USB interfaces. The PR adds a simple pong game that appears to use the two top buttons, but there is no code in the diff that handles button input or demonstrates integration with BLE and USB interfaces. The code only initializes and renders the pong game, with no evidence of button handling or interface integration.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Support for Two Buttons in Badge Magic Firmware
1 participant