Skip to content

A simple piece of javascript code for collision detection of 2 sprites. Uses the p5 library.

Notifications You must be signed in to change notification settings

Blue0Tech/collisionDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collision detector

This simple yet effective function with an example for the p5 library.

Syntax

isInRange(sprite1,sprite2)

Method

Uses Pythagoras' theorem to calculate actual distance between 2 sprites.

Returns

Returns true or false, depending on whether the 2 sprites or touching or not.

About

A simple piece of javascript code for collision detection of 2 sprites. Uses the p5 library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published