I made this raycasting engine using Java Swing. I wanted to have an interactable demo that could be used to explore the concepts used to generate raycasted 2.5D graphics. The bottom left panel shows a top down view of the player. The top panel shows what the player 'sees', based on their position and settings in the bttom right panel.
Run the main method to get started.
Raycount slider changes the amount of rays that are cast from the player
FOV slider changes the minimum and maximum angles the rays are cast at, relative to the player
Scale factor slider scales the heights of the rendered rectangles on the top view
Color factor slider changes the rate at which rendered rectangles turn dark with increasing distance
Keyboard input moves player relative to the direction they are facing: W - forward
S - backward
A - strafe left
D - strafe right
Q - rotate left
E - rotate right
Rays are drawn as yellow according to the slider configuration, example (rayCount 50, FOV 90):
Rectangles are drawn from left to right, each corresponding to a ray emitted by the player and render based on the color of the target, length of the ray, and scale sliders.
All together, it gives the illusion of travelling in 3d space!

