Giter Site home page Giter Site logo

starfield's Introduction

Starfield with an Oddball

For this assignment you will make a simple animation of fireworks. This common animation is called a "starfield" since it can also be used to simulate movement through a field of stars.

Program requirements: Your program must use two classes to model the particles. A "Normal" particle class and an "Oddball" partcle class All the particles must be stored in a single array using an interface. Your program must use at least one constant (for number of particles). Steps to completing this assignment Fork and clone down the Starfield repository, First, finish the NormalParticle class. It will need the following members: 5 data members: X and Y positions, Color, Angle and Speed. (Hint use doubles for X, Y, Speed and Angle) Particle(), the class constructor void move(), Takes the cos of the angle times the speed and adds it to the X coordinate. Does the same to Y with the sin of the angle. void show(), sets the current color to the color of the particle and draws a dot using ellipse() Now finish the program's setup and draw Add one Particle variable, and see you can see it move Now modify the program so you have an array of Particles.

Finish the Particle interface. It will list two methods: public void show(); public void move(); Have your NormalParticle implement the Particle interface. Add public in front of the move() & draw() methods in your NormalParticle class. Have your OddballParticle implement the Particle interface. Finish OddballParticle class. It will be very similiar, but OddballParticles should have different move and draw methods. Change your array of NormalParticles to an array of Particles. Change the first element in the array to a OddballParticle instead of a NormalParticle Submit the url of your GitHub webpage via the school loop drop box for the assignment Extensions Have a fun and be creative. If you have extra time you may want to modify your program and add extra features. Experiment with different arrangements of particles. Look at student work from previous years for other variations.

starfield's People

Contributors

philiphuang2 avatar simart avatar

Watchers

James Cloos avatar  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.