For my senior project I planned on making a video game using Java as the primary medium.
My intent is to make it in the format of a 2D action platformer.
Production began by working from a template obtained from “Killer Game Programming in Java” by Andrew Davison.
The template code didn’t require permission for programming use and most of the code was redundant and removed.
As can be seen here is a lot of the code put together into one screen.
The images are loaded and placed in the window at specific x and y coordinates.
It uses collision detection to see if the player is hitting with a certain rectangle. The rectangle can be
a. Playing field
b. World borders
d. Enemies’ projectiles
The collision detection is also used if the player’s projectile rectangle collides with the enemies’ rectangle.
This takes keyboard input for the player to fire their projectile, move left or right, and jump.
Samples of the code are provided below.