For my final project of CSCE 450, I wrote a Spiderman simulator game. The user plays as Spiderman as he swings through the city.

I based this project off of Assignment 5: Cloth Simulation because I wanted the game to be physically-based. Spiderman is (partly) a particle, and whenever he shoots a web, it generates a fixed particle at the target of the web, and finally a spring is created that connects the two. This spring is what allows Spiderman to swing.

The next big addition to the physics system was collision detection between axis-aligned bounding boxes (AABBs). Spiderman and every building in the scene have AABBs. Spiderman's bounding box checks for collision with buildings in the foreground. Spiderman's webs check for collision with buildings in the background.

It is very simple to check if AABBs overlap, but checking if a web intersects an AABB is a little more involved. When the player wants to shoot a web, a ray is shot, and checks for collision with every background building in the scene. I use the slab method for determining if there is an intersection. If there is, then the player's web is allowed to connect to the building's bounding box.

Check out my presentation video below!

Credits

Dr. Sueda provided a lot of the base code for Assignment 5: Cloth Simulation, which is where I started my final project.

This blog post helped me understand the Slab method for checking ray-AABB intersections, and I also adapted some of its code for my project.