Skip to content

Update asteroids to feature fully randomized starting orientation and…#492

Merged
tavdog merged 1 commit intotronbyt:mainfrom
markgreinke:asteroids
May 6, 2026
Merged

Update asteroids to feature fully randomized starting orientation and…#492
tavdog merged 1 commit intotronbyt:mainfrom
markgreinke:asteroids

Conversation

@markgreinke
Copy link
Copy Markdown
Contributor

… flight paths

@markgreinke markgreinke requested a review from tavdog as a code owner May 6, 2026 16:35
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a retro Asteroids arcade simulation app. Several critical issues were identified: the use of an invalid unix_nano attribute for seeding, a highly inefficient rendering approach that creates individual widgets for every pixel, and the omission of the required .webp preview image. Additionally, it is recommended to use tuples instead of formatted strings for dictionary keys to improve performance.

I am having trouble creating individual review comments. Click here to see my feedback.

apps/asteroids/asteroids.star (70)

high

time.now().unix_nano is not a standard attribute in the Pixlet time module. Use time.now().unix for seeding the randomizer.

    random.seed(time.now().unix)

apps/asteroids/asteroids.star (314-321)

high

Creating a separate render.Padding and render.Box widget for every individual pixel in every frame is highly inefficient. With 150 frames, the total widget count will likely exceed Pixlet's limits, causing execution failures. Consider reducing the frame count or optimizing the drawing logic by grouping pixels.

apps/asteroids/manifest.yaml (1)

medium

Missing required preview image asteroids.webp in the app directory. Every app must include a preview image named identically to the directory.

References
  1. Every app must contain a preview image in the app directory which should have the same name as the app directory with a .webp extension. (link)
  2. Every app directory must include a preview image in .webp format, named identically to the directory.

apps/asteroids/asteroids.star (292)

medium

Using string formatting "%d_%d" % (px, py) as a dictionary key in a loop is inefficient. Starlark supports using tuples as dictionary keys, which is faster.

@markgreinke
Copy link
Copy Markdown
Contributor Author

Think I have all required fixes in now

Copy link
Copy Markdown
Member

@tavdog tavdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool idea !

@tavdog tavdog merged commit 833405d into tronbyt:main May 6, 2026
1 check passed
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.

2 participants