Commit Graph

22 Commits

Author SHA1 Message Date
c1b69c412a autoformat 2025-08-11 22:48:08 -05:00
f5ff7c8779 Move Asteroid components to the objects.rs mod 2025-08-11 22:44:05 -05:00
f4484f759f Move SpawnAsteroid event into events.rs 2025-08-11 19:16:34 -05:00
571b910945 Rename "event" module to be plural "events.rs" 2025-08-11 19:14:22 -05:00
45b1fe751f Create the asteroid splitter to break down rocks.
Some checks failed
Basic checks / Basic build-and-test supertask (push) Has been cancelled
2025-08-10 20:45:08 -05:00
3d28d489b0 Fix: Pass size through to spawned asteroid
I actually have most of the asteroid's destruction handling system done
and found this bug.

Asteroid *assets* are selected based on the size set in the spawn event,
but the `Asteroid` Component itself was left hard-coded to the smallest
size.
2025-08-10 18:46:49 -05:00
364fbd7530 Use the lifetime limiters on Bullets & Asteroids
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 7m3s
Closes #14

Despawn bullets to limit range.

Despawn asteroids to limit random garbage floating around the scene.
2025-08-10 17:14:26 -05:00
e841facf73 Remove Rotation component, update usage sites 2025-08-09 16:04:12 -05:00
3922cac3d7 Finish removal of Position
The component has been completely removed, and all call sites are fixed
to use the Transform directly.
2025-08-09 15:10:44 -05:00
3d0da6df2d Fix module-level docstring in asteroids & config
I made a comment to help me remember the purpose, but if I do it this
way `cargo doc` will render it out to the actual documentation.
2025-08-09 14:55:07 -05:00
61c57783f1 Split physics parts into a submodule
The physics sim bits (that aren't Rapier2d) are now in their own
submodule. I've included the `Wrapping` marker component because it
doesn't really have anywhere else to live, and it's kinda sorta related
to the physics. It controls the motion of objects... that's physics. :p

There are name collisions between Rapier2d's `Velocity` and my own, but
that's a problem for later. I've used more specific type paths where
necessary to maintain the previous behavior.

The `physics::Position` component can go away completely. It's just an
extra copy of some of the built-in `Transform` data. I'm pretty sure it
only exists because I didn't realize I could rely on directly
manipulating the transform when I started this project.
2025-08-09 14:46:56 -05:00
d4ceaa6312 Add Sensor component to colliders 2025-08-06 14:44:38 -05:00
f553574e3e Beginning work with collision detection
Some checks failed
Basic checks / Basic build-and-test supertask (push) Failing after 31s
I'm going to grab the Rapier physics library so that I don't have to do
my own collision detection mechanism. The last time I did this, I
simplified everything into circles. This time I'd like to have convex
hulls, particularly for the player ship.

Also the last time, I ended up rolling my own quadtree impl. I'm not
particularly interested in doing that again, and I'd like to learn more
of the broader Bevy ecosystem.
2025-08-06 13:05:12 -05:00
1555c93bed Set asteroid velocity so they move into play area
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 6m24s
It's functional, if not especially interesting. Forward to the next
thing!
2025-07-29 17:44:33 -05:00
2b93654491 Randomly assign asteroid spawning positions
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 6m23s
I need to close the circle down to touch the corners of the play area,
but this demonstrates the principle.

Next, I need to generate a velocity and "fix" it so that the asteroid
crosses through the viewport. I left a TODO about this, which I think
will work well enough. Although it might allow for some asteroids to
slip past, or bias the density in a funny way.

Oh well, it's just an Asteroids game.
2025-07-29 16:31:35 -05:00
c80ada4aa6 Add "rand" crate, store an RNG in AsteroidSpawner 2025-07-29 13:32:26 -05:00
eee039339e Asteroid spawner now uses info from event message
Some checks failed
Basic checks / Basic build-and-test supertask (push) Has been cancelled
Closes #4: "Convert asteroid spawning system into an event listener"
2025-07-29 13:26:41 -05:00
04f192b62a Drop never-used import
Thanks, VSCode. I really like when you import things I'm not actually
trying to use. SMH my head.
2025-07-29 13:17:01 -05:00
2dd3b2ff61 Fix case on AsteroidSize enum variants
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 6m28s
Closes #9: "Fix case on AsteroidSize enum variants"
2025-07-29 13:15:54 -05:00
2c43bc699e Begin work on event-based asteroid spawning
The events are being emitted by the spawn manager, and consumed by the
spawn_asteroid system. Now to wire in the spawn properties, and then
make a good spawning manager.
2025-07-29 13:12:22 -05:00
911b6c5fe7 Fix visibility & add constructors, program builds
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 6m29s
2025-07-29 12:54:09 -05:00
71ec77f5b1 Move asteroid bits to another module
Now to fix the visibility issues and make the program compile again...
2025-07-29 12:48:54 -05:00