Luke-Butcher / PinballSimulation

A project for simulating pinball objects interacting with each other and the environment, different balls having different characteristics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PROJECT TITLE: Java Coursework Assignment - 804653

AUTHORS:804653, Claire Ancient, Michael Kölling (mik), Bruce Quig.

VERSION or DATE: 2017.03.24.

HOW TO START THIS PROJECT: To start the project right click the "package" file and select open.

PURPOSE OF PROJECT: A program which models a "pinball machine". The pinball model has some signicant differences from its real-world counterpart. In particular, multiple pinballs of diffrent types will be used, and there will be no user control (i.e. this is not a game). The machine contains a variety of objects (pinballs, holes, and bumpers), which have diffrent characteristics, the details of which are given below. The simulation will end when one of the pinballs falls through the gap at the bottom of the machine. Pinballs collect points as they interact with particular objects in the machine. Each pinball will have its own score. Once the simulation is over, the fnal score of all the balls is displayed on the screen.

Pinball 0 ~ Colour - the pinball will change colour to another valid colour for that type of pinball on contact with the edge.. ~ Size - the radius of the pinball will increase or decrease by 10% on contact with amother pinball. Pinball 3 ~ Speed - the speed of the pinball will change between a given minimum and maximum on contact with the edge. ~ Direction - pinballs normally bounce off the edge of the machine, a bumper, or another pinball at the same angle as they hit it at. Pinballs that change their direction will bounce off the object at another random angle on contact with amother pinball.

The program must demonstrate 4 functionalities:

Functionality 1 �~ Presence of bumpers and the 2 correct types of pinball. ~ Correct behaviour of each type of pinball when hitting the wall. ~ Correct behaviour of each type of pinball when colliding with a bumper. ~ Correct ending of the simulation, as described above.

Functionality 2 ~ Correct behaviour of each pinball when colliding with another pinball.

Functionality 3 ~ Presence of holes. �~ Correct action when a smaller pinball interacts with a hole. �~ Correct behaviour when a larger pinball interacts with a hole.

Functionality 4 �~ Presence of the score on the pinballs. �~ Correct addition of points when colliding with the wall. �~ Correct addition of points when colliding with a bumper. �~ Correct addition of points when colliding with another pinball. �~ Correct points action when interacting with a hole. �~ Correct display of points at the end of the simulation.

USER INSTRUCTIONS: Once the package is open left click on the button on the left hand side labelled "Compile", then right click on the orange class file called labelled "Demo" a selection menu will appear. Select the top most item called "new Demo()". Click "Ok" on the window that pops up. This will create an instance of the demo class you will see a red box on the bottom left hand side of the screen and a window will display with the edges of the pinball simulation right click on the red instance box from earlier a menu will appear. To view functionality 1 left click on the menu item titled "void functionality1Demo()" the demonstration will be displayed on the java window that was created earlier. each functionality has its own method select "void functionality2Demo()", "void functionality3Demo()", "void functionality4Demo()" for functionality 2 3 4, respectively And to view the full simulation select the item "void fullSimulation()". You must wait for one simulation to end before you start the next or you must reset the machine and start this process again.

To reset the java virtual machine right click on the red and grey bar above the red instance box and select the option that pops up.

About

A project for simulating pinball objects interacting with each other and the environment, different balls having different characteristics


Languages

Language:HTML 66.4%Language:Java 32.7%Language:CSS 0.9%