How to create a game with firing lasers

I have some students who want to have their player “shoot” lasers (like Asteroids, etc). How on Earth does that code work?

Some of my students wanted to do the same thing last year, so I came up with something that I thought they could understand. I only coded the ship shooting lasers. You press the space bar to shoot and the left and right arrow keys move the spaceship. You have to add your own obstacles and collision code.

3 Likes

Awesome approach, @kammie.dill! Thanks for sharing!

Thank you! This helped tremendously!!