Skip to content

This is my first python game using Pycharm IDE . For more well-detailed explanation, don't forget to check out Readme file.

Notifications You must be signed in to change notification settings

achalesh27022003/Spaceship-Zombies

Repository files navigation

🚀SpaceShip & Zombies 👽

This is my first python game using Pycharm IDE. This game has two characters: player or spaceship and enemies or zombies.
We have to shoot bullets before zombies reach near spaceship.
At top left, Score will be calculated, 1 point for each successful shot & 0 point for miss. After any of the zombie reached near spaceship, then game finishes displayed by GAME OVER text.
This game has different sound, image & display combinations which enthrills player with gaming endeavours.
So, what are you waiting for?? Just run it in your IDE or PyCharm, Enjoy & Share your score on LinkedIn or Mail.

🤩 Libraries Used :

  • pygame
  • random
  • math

😉 Necessary Methods (Compulsory) Used:

  • pygame.init()
  • pygame.display.update()
<

😯 Python Data Structure, Formulas & Methods Used:

I used List python data structure and appended element in empty lists using .append method. I also used Distance Formula to find distance between bullets and zombie or enemy.


🧐 Certain States To Be Understood:

  • Ready:
  • When we can't see the bullet on screen. It is in state of going to be ejected from spaceship.

  • Fire:
  • The state in which bullet is in moving condition.

💪 Classes or Methods Used for Images, Musics, Sounds, Texts & Display: 💪

🖼 Images: 🖼

  • pygame.image.load("image name")

🎶 Musics & Sounds:🎛

  • from pygame import mixer
  • mixer class help us to handle all type of activities to perform with music in game whether it can be repeating, loading or anything to do with music.

  • mixeer.music.load ("music file")
  • mixeer.music.play ()
  • Use -1 only when you want to persists this music during whole game.

  • variable = mixer.Sound("filename") & then variable.play()

📜 Texts: 📜

  • pygame.font.Font("Font family file", font-size)
  • font.render(self, text, antialias, color, background)

📺 Display: 📺

  • pygame.display.set_mode((height, width))
  • Don't Forget to use inner bracket for making it tuple.😛😂

  • pygame.display.set_caption("Text")
  • pygame.display.set_icon("Icon variable in which icon image is loaded")
  • screen.blit(variable name, (x,y))
  • blit means to just draw !!

  • screen.fill((R,G,B))

🤘 Use of Math & Random Libraries: 🤘

Math library was used to implement two functions i.e. sqrt() & pow(a,b) .
Random library was used for respawning of zombie in gaming terms by giving random coordinates over a certain range of coordinates.

🧾 Use of Events: 🧾

  • To get all events we used pygame.event.get().
  • for identifying event type, we used event.type.
  • to know about event of key like it is released or pressed or whether it is space, left & right arrow key or any other key, we used event.key.
  • For space, right arrow & left arrow key it has to match with pygame.K_SPACE, pygame.K_RIGHT and pygame.K_LEFTrespectively.
  • If we close window...then while loop has to be closed & game over....we used pygame.QUIT.

✡ Steps To Conquer This Gaming Project: ✡

  1. Install Python and Pycharm
  2. Creating Our First Game Window
  3. Changing the Title, Logo and Background Color
  4. Adding Images into Our Space Invader Game
  5. Movement Mechanics in Game Development
  6. Keyboard Input Controls & Key Pressed Event
  7. Adding Boundaries to Our Game
  8. Creating the Enemy
  9. Movement Mechanics of the Enemy Space Invader
  10. Adding a Background Image
  11. Creating Bullets for Shooting
  12. Shooting Multiple Bullets at Space Invaders
  13. Collision Detection
  14. Creating Multiple Enemies
  15. Adding Text and Displaying Score
  16. Adding Sounds and Background Music
  17. Game Over

About

This is my first python game using Pycharm IDE . For more well-detailed explanation, don't forget to check out Readme file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages