Freeways, draw perfect Bezier curves

Post gaming related scripts
blaarkies
Posts: 2
Joined: 04 Nov 2021, 05:59
Contact:

Freeways, draw perfect Bezier curves

04 Nov 2021, 06:20

Image

https://github.com/Blaarkies/freeways-helping-hand
The script is split up into 4 files for maintainability, so the link is easier to show and keep up to date (but i will edit the post with raw code if anyone prefers)

Checkout https://captaingames.itch.io/freeways, a game where you build roads, interchanges, and freeways by drawing on screen.

This script helps to draw smooth curves with your mouse pointer. You get to customize how many checkpoints the curve should have:
- 2 checkpoints is a straight line
- 3 checkpoints is a simple curve (Quadratic Bezier Curve)
- 4 checkpoints can make s-curves (Cubic Bezier Curve)
- all the way up to 10 checkpoints (you can edit the script limit to more if you like, but it's not that useful after 5 checkpoints)

1. After checkpoints are set, you will see an On Screen Display overlay showing where the curve would be drawn. You can adjust positions of existing checkpoints to edit this curve to where you want it.
2. When happy, press `f` to draw the full curve, or press and hold `w` to draw the curve partially (this way you can stop at any point, and continue in smalls steps for precision)
3. If you want to start over, press 'r' to reset
4. If anything feels stuck, press `ctrl + q` to quit the script

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 12 guests