A simple 2D dodge game that implements gravitational attraction. Made in my senior year of high school.
Dodge.java
contains the main. This starts aFramer
, which takes aDoubleBufferedCanvas
that is passed to it and puts it in a window.Dodge
is also an actualization ofDoubleBufferedCanvas
, it contains the necessarydraw
andupdateVars
methods.updateVars
contains most of the physics logic, done by operating on aBall
.
Framer.java
is used to create a window around aDoubleBufferedCanvas
.DoubleBufferedCanvas.java
is my personal implementation of a pseudo-double buffered canvas. It is an abstract interface that is aRunnable
. The constructor must be supplied a desired fps target, and theDoubleBufferedCanvas
will display a FPS tracker. TheDoubleBufferedCanvas
also tracks key presses. All actualizations must implementdraw
andupdateVars
.Ball.java
is a pretty simple object class which keeps track of the position and physicsVectors
of a ball.Vector.java
is another simple object class to represent vectors that are used for physics operations.