Game Made in p5.js


#21

The collision detection is definitely to be revised ^^


#22

@jb4x I’m glad you got it to work!


#23

The collusion detection could be improved, i will admit. The bounding boxes are a bit off.


#24

I have cut down the size of the hit boxes, hopefully it will be at least a little better now.


#25

The collision detection could be improved further by using 2 boxes for the Penguin and another 2 boxes for the Shark.

It would mean 4 box intersection tests per collision (2x2) rather than the current one but with so few tests to make it won’t be noticeable.

15

Still good fun!


#26

To add to that, it could even be almost pixel perfect since the shapes are so simple. Ellipses and triangles basically (and maybe 2 squares and circles for the arm of the penguin).

The math for a ellipse/line intersection can easily be found online.