this post was submitted on 07 Aug 2024
23 points (100.0% liked)

Bevy

223 readers
2 users here now

A community for discussion around the bevy game engine! https://bevyengine.org/

founded 9 months ago
MODERATORS
 

I working on a life simulation game with a working title Project Harmonia.

Added initial editor for roads, reusing some logic from the walls implementation.

Currently, I'm using segments for road creation, but I plan to add Bezier curves to allow for curved walls and roads. Maybe I should use Bezier curves even for straight lines ๐Ÿค”

I also need to use a texture without road markings for connection islands and implement rounding for turns.

But wanted to share the current progress :)

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 1 month ago (1 children)

This is neat. If you do look at beziers you'll run into some difficulty with offsetting them / creating parallel curves.

But you can find a solution for that with this crate: https://crates.io/crates/kurbo

And a nifty article on the topic: https://raphlinus.github.io/curves/2022/09/09/parallel-beziers.html

[โ€“] [email protected] 1 points 1 month ago

Thank you!

This will definitely come in handy, offsetting is quite hard. For segments it's much simpler.