Code Monkey home page Code Monkey logo

pinballsimulation's Introduction

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.

pinballsimulation's People

Contributors

luke-butcher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.