Skip to content

2D raycasting is a popular technique used in many video games and simulations to create realistic-looking environments with dynamic lighting and shadows.

Notifications You must be signed in to change notification settings

krmahi/2d_ray_casting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2d_ray_casting

2D raycasting is a popular technique used in many video games and simulations to create realistic-looking environments with dynamic lighting and shadows. In this project, you will develop a 2D raycasting engine that can simulate a player moving through a virtual world, casting rays to determine what objects are visible and where shadows fall.

The project can be broken down into several main tasks:

Map creation: You will need to create a 2D map of your virtual world. This can be done using a variety of techniques, including drawing the map by hand, using a map editor, or procedurally generating the map.  
  
Player movement: You will need to create a player object that can move around the map. This can be done using arrow keys or WASD keys to move the player up, down, left, and right.  
  
Raycasting: This is the core of the project. You will need to cast rays from the player's position and calculate the intersections between the rays and the objects in the virtual world. This will allow you to determine which objects are visible and where shadows fall.  
  
Rendering: Once you have determined which objects are visible, you will need to render them to the screen. This can be done using basic graphics techniques, such as drawing rectangles and circles, or using more advanced techniques, such as textures and shaders.  
  
Lighting: Finally, you will need to add lighting to your virtual world. This can be done using simple techniques, such as a single light source, or more advanced techniques, such as dynamic lighting and shadows.  

This project is purly implemented in web languages, i.e.:

HTML  
CSS  
JS  

Screenshot 2023-12-04 192803 Screenshot 2023-12-04 192753 Screenshot 2023-12-04 192746

About

2D raycasting is a popular technique used in many video games and simulations to create realistic-looking environments with dynamic lighting and shadows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published