Skip to content

calda/Streets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Streets

Streets is a prototype / mechanics demo for a road-management simulator inspired by Mini Metro.

In the prototype, you can draw striaght roads on the screen. Intersections are automatically identified using CGPathIntersection. Once a car spawner is connected to your road network, cars will be generated periodically. Cars can drive around the scene, taking a random turn when they reach an intersection.

Screenshots

CGPathIntersection

Surprisingly, calculating the intersections of two GGPaths is not function provided by CoreGraphics. Intersections must be computed manually. It's simple to analytically calculate the intersection point of two straight lines, but that does not extend to arbitrarily complicated paths. For example, the Streets prototype also has some support for roundabouts:

CGPathIntersection, created as a part of this project and provided as a standalone framework, provide tools for calculating the intersection of arbitrary CGPaths. As far as I can tell, it's the only open source Swift framework that provides this functionality.

About

๐Ÿš— SpriteKit game that simulates managing a network of streets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages