For this assignment you will make a animation of fireworks. This common animation is called a "starfield" since it can also be used to simulate movement through a field of stars. You may find slides 35 - 52 on OOP--Inheritance & Encapsulation presentation helpful.
Your program must use at least two classes to model the particles. A Particle
super class and an Oddball
sub class. All the particles must be stored in a single array of the super class type. Make sure you do not unnunnecessarily duplicate inherited variables and functions in the Oddball
sub class. Your Oddball
sub class need only contain a constructor and void move()
and/or void show()
so that the Oddball
moves and/or looks different.
- Fork this repository
- First, finish the
Particle
class. It will need the following members:
- 5 member variables: X and Y positions, Color, Angle and Speed. (Hint: use doubles for X, Y, Speed and Angle)
Particle()
, the class constructorvoid 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()
, draws the particle in the correct color
- Now finish the program's
setup()
anddraw()
- Add one
Particle
variable, and make sure you can see it move - Add an array of type
Particle
and loop through it to move and show all the Particles. - Create an OddballParticle class that
extends
the Particle class. - Change the first element in the array to a
OddballParticle
instead of aParticle
- Run your program. Make sure you can see the Oddball.
- Submit the url of your working GitHub webpage to google classroom Extensions: Have a fun and be creative. If you have extra time you may want to modify your program and add extra features and other types and arrangements of particles. Look at student work from the links below for other variations.
Jasmine
Jimmy
Andrea
Harry
Jonathan
Robin
Patrick
Ethan
Katelyn
Megan
Duan
Trinity
Zhenyu
Katja
Curis
Marvin
Elton
William
Eustache
Claire
Quillen
Hieu
Devin
Kathy
Damian
Winston
Jason
William
Justin
Aiden
Ken
Lilian
Justine
Dylan
Rameses
Eddie
Rodger
Xinjian
Madeline
Jasmine
Ling
Jaqueline
Marlon
Claire
Phuoc
Sam
Kimia
Joaquin
Johnny
Clarence
Claire
Rahul
Edison
Gabriel
Anna
Kang
Cheryl
Chris
Hazel
Max
Fiona
Noah
Melanie
Qi
Tarsa
Kai
Luna
Tomas
Reily
Marvin
Kelly
Andy
Matt
Teresa
Andrew
Kaitlyn
Ayaka
Rafael
Francesca
Theo
Robert
Antonio
Cara
Ashley
Maanav
Antonio
Jonathan
Maanav
Michael
Anthony
Vicky
Marisa
Fred
Briana
Justin
Mia
Jalen
Ethan
Andy
Albert
Annie
Jessica
Susan
Ian
David
Jessie
Marc
Amy
Racine
Kam
Ethan
Peter
Andy
Jason
Alexis
Diego
Lawrence
Willis
Brandon
Devin
Alex
Wesley
Richard
Rowan
Esther
Calvin
Audrey
Juliana
Mampu
Michael
Emma
Brendan
Michelle
Lolita
Gee
Nathan
Jayde
Joshua
Mari
Angelica
Cappillen
Jennifer
Brendan
Lucian
Wen
Yaoquan
Andrew
Alex
Freesia
Dylan
Victor
Jing
Wilson
Ryan
Natalie
Sherissa
Bryce
Melinda
Raymond
Emma
Joe
Jennifer
Ravi
Elizabeth
James
Chase
Vincent
Hiroki
Andrew
Christopher
Wilson
Ashton
Cynthia
Lalith
Gordon
Lily
Alex
Jeffrey
Alber
Ryan
Kelvin
Maryann
Jeffrey
Michelle
Benjamin
Ben
Kelly
Linus
Karlee
Trevor
Justin
Karina
Bruno
Damian
Paolo
William
Alvin
Christina
Haden
Joanne
Irisa
Christopher
Wing
Caitlyn
Breanna
Matthew
Ye
Van
Edward
Aiden
Andrew
Jeffrey
Eric
Dylan
Mira
Austin
Jason
Ivana
Gary
Emily
Akemi
William
Stephen
Daniel
Andrew
Luke
Liam
Hayden
Jacob
Noella
Caleb
Gabriel
Eric
Joyce
Vivian
Lexian
Rafael
Nathaniel
Nicolas
Brian
Stella
Wendy
Joseph
Joshua
Brianna
Justin
Antonio
Caden
TommyJun
David
Darren
Huishan
Brennan
Jennifer
Deion
Aaron
Jackie
Christina
Joselino
Nathan
Tushig
Kyle
Noelle
Audrey
William
Jenna
Ryan
Nathan
Ivy
Gabriel
Joyce
Pyry
Mika
Sophia
Ethan
Emely
Nate
Koen
Annie
Jason
Ivan
Tobias