shadows — Multiplayer Shadowy Halloween Maze Game!
fuzzyastrocat (1867)

Welp, I misread the timestamp on the bramjam, so I guess I can't submit this, but I'm posting it here anyway! ( @bramley that is right, correct?)

This was a little experiment in raycasting and FOV graphics. The goal is to get to the green light at the end of the maze... the problem is that you only have a tiny lantern which casts light in one direction! So, it's basically a maze game where you can't see the goal, only what you could see in real life. Sounds fun, eh? :D

There is a server, so you can race your friends to the end. Additionally, you can drop beacons to help others out... provided that you're going the right way!

Gameplay Images


  • WASD/Arrow keys to move
  • SPACE to drop beacon


You are viewing a single comment. View All
DynamicSquid (5024)

How'd you do ray casting? Is it just extending a line until you hit a wall? But if that's the case it would seem very inefficient

fuzzyastrocat (1867)

@DynamicSquid It would seem very inefficient, but math says no!

DynamicSquid (5024)

@fuzzyastrocat So do you just check all the walls, and the end point of the light, and if the end point of the light isn't touching a wall, then keep moving it?

fuzzyastrocat (1867)

@DynamicSquid Basically, there are a bunch of "rays" each going from the player to the edge of the FOV (the angle of the ray being the variable). For each ray, it finds the nearest wall that it intersects and passes that to the player. The player then renders the walls based on that data.

The way it finds that nearest wall is lines 122 to 148. It's standard raycasting math, so I won't explain it here, but basically it calls cast on each wall and takes the closest point.

realTronsi (923)

@DynamicSquid you can just use line intersection formula. Get the angle of the ray and see which line it intersects with

fuzzyastrocat (1867)

@DynamicSquid Also, one thing I forgot to mention: thanks to math, it's not an iterative solution (it's not "extend line until you hit"), instead it's just "do math on each wall and from that find where the line hits that wall".