####Intro
I used to play Asteroids growing up. My objective is to build this game in p5. I will vary its functionality to learn weekly course objectives.
####random()
1/ Testing out the random() function by building stars that flicker in space
2/ Declaring var and objective
3/ Building random() sparkling stars
####mouseX and mouseY
1/ In the game the spaceship responds to arrow keys to rotate.
2/ Wanted to rotate the spaceship with mouseX and mouseY while it is centered. Couldn’t figure that out.
3/ Wrote the following for the spaceship (a simple triangle) to move with mouseX and mouseY
####mouseIsPressed and firing missiles
- mouseIsPressed loops within draw(), unlike mousePressed(), the function which is an event
- Would like small ellipses to leave the tip of the triangle() on mousepressed.
- Need help!
- Instead, I get the ellpises to get circle highlights,
Here’s the program, and the snapshot below: