Skip to content

2D shooting game utilizing a ray-casting algorithm for the game mechanics

Notifications You must be signed in to change notification settings

michaelmhtong/portfolio-shooting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShadowStrike

2D shooting game utilizing a ray-casting algorithm for the game mechanics. The player must use a limited angle and view to shoot enemies, with randomly generated wall blocks that change the gameplay experience each time.

👨‍🏫 Demo

ShadowStrike Demo

game

🧰 Tech Stack

HTML, CSS, Javascript, p5.js, Algorithm

💡 Lightcasting Logic

  1. Cast rays by offsetting angle (trigonometry)
  2. Find the intersection point between ray and wall (line-line intersection)
  3. Find the closest intersection point (pythagorean Theorem)
  4. Draw the areas by points (p5.js)
  5. Draw the flashlight by clip (p5 clip function)

📚 Appendix

About

2D shooting game utilizing a ray-casting algorithm for the game mechanics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages