This is the Space Invaders Game created by me in Python using turtle module, OpenCV Object-Tracking and PyAutoGUI.
TURTLE MODULE :.
All the functionality of the game is added using Turtle Module.
Turtle Key Bindings :-
- LEFT ARROW KEY ---------> For left movement of spacebar
- RIGHT ARROW KEY --------> For right movement of spacebar
- SPACE BAR KEY ----------> For firing
- A KEY -----------------> For firing
- S KEY -----------------> For Starting the game
SOUND MODULES :-
- Winsound :- This module is used for addding collision sound, firing sound and game over sound.
- Playsound :- This module is used for adding background music to the game.
OPENCV OBJECT DETECTION AND TRACKING :-
Object Used :- Highlighter
We are detecting the green color of the cap of the highlighter , tracking its motion and finding the direction of its motion.
- LEFT ARROW KEY ---------> WEST
- RIGHT ARROW KEY --------> EAST
- SPACE BAR KEY ----------> NORTH
- A KEY -----------------> SOUTH
PyAutoGUI MODULE :-
We are making the respective key presses using PyAutoGUI Module when different directions are detected.
- NORTH ---------------> SPACE BAR KEY PRESSED
- SOUTH ----------------> A KEY PRESSED
- EAST ----------------> RIGHT ARROW KEY PRESSED
- WEST ----------------> LEFT ARROW KEY PRESSED
I am open to any type of improvements which you can suggest. So, don't hesitate in making your contributions in this project as pull request is open for all.