Where we're going, we definitely need roads 3

Tijn • 5 years ago on 4th Kajam 

So I'm making a traffic light programming game for Kajam 4. I thought it would be fun to look at the cars zoom by and respond to the lights you've so cunningly set up.

The first thing I wanted to set up are the roads. Because I plan to make a bunch of different levels, it would be neat to have a little road drawing algorithm, so I easily have various layouts.

First I started with a basic horizontal and vertical road, like this:

Now of course, the next thing was to try to have an intersection, because that's where the traffic lights come in. So there we go:

Hmm… that doesn't look entirely right, does it. So I added some special intersect drawing code:

Pretty sweet, if I may say so myself :D It doesn't just support 2 roads either:

And it also supports more than 2 lanes :D

And that's it for now. Next up: adding cars!

Comments (3)

toasty
 • 5 years ago • 

That road looks terrifying! Can't wait to play this ^^

Tijn
  • 5 years ago • 

I'm also pleased to report I've fixed the annoying corner thingie.

Raindrinker
 • 5 years ago • 

Wow great! I loved that game about drawing roads, Freeways. Setting up traffic lights should be interesting :D

Login to comment