top of page
Back to 3D

Scroller Engine

This is a 2D side scroller that I coded from scratch for my CS I class using the "Java Processing Compiler." I have never done anything like it before and puzzled out all of my features having never seen how they are commonly done so some solutions are unorthodox.
​
The whole physics system is centered around a linked list collision system. Every item that gets rendered onto the screen is a type of node in one large linked list. The player, map text, and custom platforms are all their own nodes and every frame the player is checked for collision with all collision marked nodes. If collision is detected then a second closer check is made to check where the collision is happening both in respect to the player and the platform being touched to enable more affective collision correction and movement.
Movement is based on changes to x and y and the speed builds momentum. Momentum is calculated by taking two details into mind. The current moving direction and the desired moving direction. Along with collision checks.
Jumping checks collision to see if player is in the air or not. If on the ground then a jump action can be made which changes gravity to move upwards then slowly reverse gravity back to normal. If player is against a wall then gravity is reduced and an additional jump can be made. 
If player collides with a red block (a danger node in the linked list system) then death is enacted. Player loses control of the character and the rectangle fades out and respawns back at starting position.
Collision is based on a linked list system to allow for dynamic adding and removing of collision objects. When player clicks on the screen a new platform is added to the collision linked list and is restrained to specific size requisites. If that same block is right-clicked then it is removed and deleted by the java trash collector. Every level starts the player with a set amount of platforms they can add at a time.
The final level is designed to showcase everything the player has learned and all features that have been made including the level loader that interprets a notepad document to store and load levels.
bottom of page