markcornwell / spacewar

Javascript implementation of 1962 game Spacewar! originally developed for the PDP-1
MIT License
0 stars 0 forks source link

Add collision detection on ships. #19

Closed markcornwell closed 4 years ago

markcornwell commented 4 years ago

Need to detect when ships collide with one another. Also will need it when we include missiles.

markcornwell commented 4 years ago

Jeffrey Thompson posted a pretty algorithm to tell if a point falls inside a triangle.

http://www.jeffreythompson.org/collision-detection/tri-point.php

markcornwell commented 4 years ago

Time to implement collision detection. Having implemented missile fire animation, we need to have ships destroyed (or take damage!) when hit by missiles.

markcornwell commented 4 years ago

Ships get destroyed by missiles now. No explosion, they just blink out of existence like they were disintegrated.