A simple 2D dodge game that implements gravitational attraction. Made in my senior year of high school.
Dodge.javacontains the main. This starts aFramer, which takes aDoubleBufferedCanvasthat is passed to it and puts it in a window.Dodgeis also an actualization ofDoubleBufferedCanvas, it contains the necessarydrawandupdateVarsmethods.updateVarscontains most of the physics logic, done by operating on aBall.
Framer.javais used to create a window around aDoubleBufferedCanvas.DoubleBufferedCanvas.javais 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 theDoubleBufferedCanvaswill display a FPS tracker. TheDoubleBufferedCanvasalso tracks key presses. All actualizations must implementdrawandupdateVars.Ball.javais a pretty simple object class which keeps track of the position and physicsVectorsof a ball.Vector.javais another simple object class to represent vectors that are used for physics operations.
