Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.48 KB

README.md

File metadata and controls

35 lines (21 loc) · 1.48 KB

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