joshchen984 / Starfield

An AP Computer Science A programming assignment for Mr. Simon's APCSA course at Lowell High School, San Francisco, USA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starfield (with an Oddball)

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.

Program requirements:

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.

Suggested steps to completing this assignment

  1. Fork this repository
  2. 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 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(), draws the particle in the correct color
  1. Now finish the program's setup() and draw()
  2. Add one Particle variable, and make sure you can see it move
  3. Add an array of type Particle and loop through it to move and show all the Particles.
  4. Create an OddballParticle class that extends the Particle class.
  5. Change the first element in the array to a OddballParticle instead of a Particle
  6. Run your program. Make sure you can see the Oddball.
  7. 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.

Samples of Student Work

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

About

An AP Computer Science A programming assignment for Mr. Simon's APCSA course at Lowell High School, San Francisco, USA


Languages

Language:JavaScript 99.3%Language:Processing 0.5%Language:HTML 0.1%Language:CSS 0.1%