Skip to content

JimWhiteheadUCSC/CollisionScale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Collision detection demo

A demonstration of different approaches for scaling collision detection using the Phaser game framework.

The demo allows for the increase/decrease of game objects on screen so as to determine how many simultaneous game objects can be checked for collisions before frame rate drops occur.

Naive: perform n x n checks, no space partitioning used

BSP: use a binary space partition (BSP) tree to place game objects into partitions, and then perform collision checks only in partitions.

Sweep & Prune: sort game objects according to x value, then only perform checks against game objects in the same "column" of objects.

Arcade Physics: use the Phaser-provided Arcade Physics collision detection algorithm.

In general, Sweep & Prune > BSP > Arcade Physics > Naive.

Code generated by Claude (Sonnet 4.6).

Uses Phaser 4.x

Art assets from Kenney Assets, with gratitude.

About

Tutorial examples of different ways to scale collision detection in Phaser: naive, binary space partition, sweep & prune, arcade physics (built-in)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors