Update asteroids to feature fully randomized starting orientation and…#492
Update asteroids to feature fully randomized starting orientation and…#492tavdog merged 1 commit intotronbyt:mainfrom
Conversation
There was a problem hiding this comment.
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)
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)
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)
Missing required preview image asteroids.webp in the app directory. Every app must include a preview image named identically to the directory.
References
- 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)
- Every app directory must include a preview image in .webp format, named identically to the directory.
apps/asteroids/asteroids.star (292)
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.
|
Think I have all required fixes in now |
… flight paths