Common Computer Science References
At the end of this lesson, you will be able to:
make lasers show up when you shoot
firing with the A button
go over how to make a list of lasers off the screen
show demo of lasers
create the lasers off screen and make them show up and move when you press A button
the PyBadge have 5 NeoPixels
you can use RGB values to set them to any color
255 is really, really bright; seriously I use only up to 10!!
since you have 5 lasers, set each NeoPixel to green when you can shoot it and yellow once it is shot, then set all 5 to red when you have none left!
this will really help
you will need to load the lib directory with the NeoPixel library onto the PyBadge
constants.py
Add list of lasers and move them off screen
When you fire, go through the list of lasers. If any have an x value < 0 meaning that they are not on the screen, then place that one on the screen where the ship currently is.
Each frame go through the list of lasers. If its value x value > 0 meaning it is on the screen, then you need to move it up since it was fired. If it goes off the top of the screen, then move it back off screen again.
Each from you now have to re-draw not only the list of sprites (which is currently only the ship) but now the all the lasers
This is "Blinka" the CircuitPython mascot.