Sidescroller Game

Connor Virostek

Overview

For my final project, I created a 3D sidescroller game inspired by the original Super Mario Bros. You play as an animated dummy that can collect coins, break boxes, and destroy enemy bunnies. The main features and technologies highlighted in this project are physics interactions, hierarchical modeling, and level generation.


Physics

Every object in the game has an axis-aligned bounding box fitted to the model. Since only two dimensions matter in a sidescroller, the Z-axis is not considered when calculating collisions. In order to get the game running smoothly on my hardware, I tried to keep the number of collision calculations per frame as low as possible with a technique called spatial hashing. By converting each object's world coordinates to indices and keeping track of them in a 2D array, I could quickly lookup nearby objects (rather than iterating over every object in the level) and only calculate collisions on those.


Hierarchical Modeling

When running, the dummy is animated using hierarchical modeling. Through trial and error, I found the right rotation values needed for each part of the model in order to give it a somewhat natural-looking gait. I used stock footage of a running man as reference during this process.


Level Generation

Levels are generated from image files with each pixel color-coded to represent a certain object. This system made it a lot easier to build levels, allowing me to re-create Super Mario Bros worlds 1-1 and 1-2 (as seen below) without too much trouble.


Color Key








Resources