Skip to content

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

Notifications You must be signed in to change notification settings

Piwong1/Starfield

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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
Willa
James
Kathleen
Juan
Toby
Ryan
Ryan
Evangeline
Miriam
Ethan
Loren
Sally
Tennyson
Allynaraizel
Alvin
Sonia
AndreiRock
Maxwell
Humphrey
Hannah
Piero
Fiona
Isaac
Karla
Saw
Aiden
Theo
Tara
Maya
Nicholas
Samson
Patrick
Diego
Luca
Cuiyin
Laura
Noel
Yiyuan
Artiom
Samantha
Charlotte
Dylan
Joanna
Andy
Victor
Ivan
Kaijun
Michelle
Kyle
Daniel
Jerry
Rock
Gage
Angela
Ivona
Sandy
Johnathan
KaloonRidge
Robin
Kayla
Justin
Leanna
Philix
Audrey
Emily
Haoheng
Gabriel
Alejandro
Angela
Kelvin
Lily
Aaron
Terrance
Jessica
Grace
Daniil
Matthew
Leanna
Andre
Calvin
Aaron
Justin
Kyla
Calvin
Yuxi
Aaron
Hao
Katie
Benjamin
Matthew
Wanyan
Kaitlyn
Austin
Evan
Xiaoyi
Damien
Marie-Fleur
Richard
Supath
Amy
Lisa
Liheng
Garvin
Ethan
Ekaterina
Alice
Raymond
Jocelyn
Davyn
Francisco
Roan
Jenny
Justin
Jason
Amiya
Ngoc
Niko
Naomi
Caspar
Charlene
Stanley
Ella
Noah
Yasmine
Ruibin
Wingyan
Joseph

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.5%
  • Other 0.5%