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

Bevy

234 readers
1 users here now

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

founded 11 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 :)

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 2 points 2 months 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 2 months ago

Thank you!

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