cyferlawyn / arcinc

1 stars 1 forks source link

Better Ship Colisions #31

Open Nessworthy opened 6 years ago

Nessworthy commented 6 years ago

The hitboxes for the sprites are rectangles, might be worthwhile seeing if there's a better way to handle collision detection.

cyferlawyn commented 6 years ago

I totally agree. I experimented with PIXI.BUMP (collision detection extension), but even using the most basic rectangle collision check of that library, frames plummeted. I took their code as base for a somewhat better performing (albeit less general) collision check implementation.

Changing the collision detection is always to be done with performance in mind as the product of enemies and player projectiles can spike enormously during compressed waves or via blackhole-stacking.

cyferlawyn commented 6 years ago

Now that Spatial Hashing is in place, we can further improve on this one.