Traffic Light Game
You're in charge of programming the traffic lights in the city! It's a busy place, so try not to cause traffic jams, or more importantly, any accidents. When you succeed, try to cut down on the timing to get a better score!
Your code is saved automatically.
The levels
- The tutorial level: Simple enough. Just merge two one-way roads onto another shared one-way road.
- Level 1: A classic 4-way road. Autonomous cars can't tell when to make discretionary left turns though, so you'll have to guide them.
- Level 2: A big road connecting into a small road. The small road's traffic ranges from nothing to quite a decent bit of traffic, so you'll have some induction pads to detect when cars are on the small road.
Sample code
loop: // 0 goes first green 0 wait 3 // make 0 red, then wait for intersection to clear red 0 wait 1 // 1 goes second green 1 wait 3 // wait for intersection to clear again red 1 wait 1 // repeat goto loop
Command reference
GREEN X... -> Sets traffic light X and more to green RED X... -> Sets traffic light X and more to red GREENLEFT X -> Sets traffic light X's left arrow to green GREENRIGHT X... -> Sets traffic light X's right arrow to green REDLEFT X... -> Sets traffic light X's left arrow to red REDRIGHT X... -> Sets traffic light X's right arrow to red CLEARLEFT X... -> Sets traffic light X's left arrow to nothing CLEARRIGHT X... -> Sets traffic light X's right arrow to nothing X: -> Represents a label X for GOTO (no instructions on the same line for now) GOTO X -> Jumps execution to label X WAIT X -> Waits X seconds SET X Y -> Sets variable X to a number ADD X Y -> Adds variable X to a number. READ X Y -> Sets variable X to induction sensor Y (1 = has car, 0 = no car) IFNEG X Y -> Jumps to label Y if variable X is negative IFPOS X Y -> Jumps to label Y if variable X is positive
Status | Prototype |
Platforms | HTML5 |
Rating | Rated 3.0 out of 5 stars (2 total ratings) |
Author | Lim Ding Wen |
Genre | Simulation, Puzzle |
Made with | Unity |
Tags | City Builder |
Comments
Log in with itch.io to leave a comment.