Sprites - My Game (Sort of)
I'm new here and I'd like to start things off right by letting you have my game. It's kind of like space invaders. All the enemy sprites are stored in an ArrayList. All the missiles are stored in a separate ArrayList. The player has a rectangular boundary that he can't go outside of. This keeps him in the JFrame. Upon reaching the edge of the boundary the player will stop. Enemies will bounce off the side of the JFrame and reverse their velocity.
I developed my own sprite class for the game. Missiles could be implemented as sprites but I used a separate missile class for them.
I used the same image for the missiles of the enemy and the player so it looks like the enemy is shooting the missile backwards. You can change it simply by using a parameter for the image or a setImage() method. That's up to you.
Arrow keys move, space fires. If the player holds space the missiles fire in a very rapid succession. I'll probably change that eventually to have a slower fire-rate.
If you die the window closes. If you kill all the enemies the window closes.
Feel free to use the source in whatever way you like. Edit, copy, whatever. The source code is partially commented and it's pretty easy to understand. If you want something explained or expanded upon or if you have any questions feel free to ask them here.
If you like the source then please let me know.