Giter Site home page Giter Site logo

space-invaders-pygame's People

Contributors

attreyabhatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

space-invaders-pygame's Issues

index out of range

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/home/sarebjanjua/Documents/Code/PyGame/main.py", line 137, in
collision = isCollision(enemyX[i], enemyY[i], bulletX, bulletY)
IndexError: list index out of range

Enemy movement

The enemy does not move(One enemy) where there is only one of them. How should I solve this??

is there any change in the screen.blit() function?

i wrote this code about a month ago and it ran file but now when i tried to run it ,an error shows up in the screen.blit() function. I am not sure is there any change in the screen.blit() function in the latest version because i changed my operating system and also upgraded python

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Fatal Python error: PyEval_SaveThread: NULL tstate

Current thread 0x00007f6b0cd9a740 (most recent call first):
File "main.py", line 109 in
Aborted (core dumped)

Parallel sound crash

Hi,
thanks for your great tutorial!

I ran into problems with the sounds: it is not possible to play the laser sound at the same time as the background sound. If done, then the program crashes:
Fatal Python error: PyEval_SaveThread: NULL tstate

I googled the error message and it has something to do with the sound channels. However, trying the different solutions (see https://stackoverflow.com/questions/15385727/pygame-mixer-only-plays-one-sound-at-a-time) did not work for me. Do you have any suggestions?

Python version used: Python 3.6.9

TypeError: 'int' object is not subscriptable

Hello,

I got a type error in Line 105. Can someone please help?

Line 105, in
ufoX[i] += ufoX_change[i]
TypeError: 'int' object is not subscriptable

Attached is the code. Thank you!

Create a new enemy after hitting one the enemies

I completed this project in 4 hours and I wanted to add new feature which add one more new enemy each time I hit one of the enemies,but I can`t do this,if someone could help me I would be grateful!!!Thanks!
I have tried to add "num_of_enemies += num_of_enemies" after the collision occurs so that it adds one more new enemy,but I keep getting this error:
enemyX[i] += enemyX_change[i]
IndexError: list index out of range
If someone knows the right way of doing it,please help!!Thanks in advance;)

error

C:\Users\LENOVO\anaconda3\python.exe C:/Users/LENOVO/Downloads/Space-Invaders-Pygame-master/Space-Invaders-Pygame-master/main.py
C:/Users/LENOVO/Downloads/Space-Invaders-Pygame-master/Space-Invaders-Pygame-master/main.py:121: SyntaxWarning: "is" with a literal. Did you mean "=="?
if bullet_state is "ready":
C:/Users/LENOVO/Downloads/Space-Invaders-Pygame-master/Space-Invaders-Pygame-master/main.py:177: SyntaxWarning: "is" with a literal. Did you mean "=="?
if bullet_state is "fire":
Traceback (most recent call last):
File "C:/Users/LENOVO/Downloads/Space-Invaders-Pygame-master/Space-Invaders-Pygame-master/main.py", line 4, in
import pygame
ModuleNotFoundError: No module named 'pygame'

Process finished with exit code 1

could anyone fix this?

GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
'run' isn't configured in the .replit file
try adding 'run = "echo hello word"' to .replit

bullets

the bullets aren't appearing Idk what I'm doing wrong

issue is about playing background music

as the whole game is working but the issue is that i am unable to open background music ...as it is showing .wav file is not supported and also showing the backgroung.wav file size is larger than project file
plzzzz help guys .........

sounds are not downloading

wav files are not downloading that's why I am not able to set sound to my project plzz suggest me some alternatives so that I can do my work done.

conversion into an executabel file.

I am trying to convert the "main.py" file into an executable file but After creating the executable file it closing immediately. I am unable to play the game with the executable file. Can you fix this out ?

Blank Black Screen

It just gives me a blank black screen when launched
Plays music and can hear background explosions
Any Ideas?

show the player

i cant show my player i have put the img too but it doesn't show it

Bug in enemy movement

there is bug in my enemy movement it is just going off the screen i have made my own version of ot using oop

screen.blit() method doesn't work correctly

When I start game and press space from one to three times, I get this error:
Traceback (most recent call last):
File "/home/ivandjordjevic/Desktop/Space-Invaders-Pygame/main.py", line 14, in
background = pygame.image.load('screen.blit(background, (0, 0))')
pygame.error: Couldn't open screen.blit(background, (0, 0))

Help please

My problem that i want to add a game over sound, i can stop the background sound when is game over , i can add this game over sound but it keeps playing again and again when its supposed to play just once, please help

Issue 1

You should add more speed to your game . You can see my repository on pygame. Or you can add the option of changing the speed from terminal at the start of the game. Also you should change the background doesn't give out the best of pygame.

.

import pygame init dont work

AttributeError: partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import)

Bullets too slow

How can I reduce the so said "Bullet Recharge delay" of the player?

Error when trying to run game.

import-im6.q16: attempt to perform an operation not allowed by the security policy PS' @ error/constitute.c/IsCoderAuthorized/408. import-im6.q16: attempt to perform an operation not allowed by the security policy PS' @ error/constitute.c/IsCoderAuthorized/408.
import-im6.q16: attempt to perform an operation not allowed by the security policy PS' @ error/constitute.c/IsCoderAuthorized/408. from: can't read /var/mail/pygame ./main.py: line 11: syntax error near unexpected token screen'
./main.py: line 11: `screen = pygame.display.set_mode((800, 600))'

Invisible Enemies

For some reason when I run my code only one enemie gets the image rather then all of them. Can anyone help me fix this problem?

This is my code:

Enemie

enemie_ship = []
enemieX = []
enemieY = []
enemieX_move = []
enemieY_move_alternate = []
num_enemie = 5

for i in range(num_enemie):
enemie_ship.append(pygame.image.load('enemie_ship-64x64.png'))
enemieX.append(random.randint(0, 736))
enemieY.append(0 - random.randint(60, 70))
enemieX_move.append(1)
enemieY_move_alternate.append(40)

def enemie(enemieX, enemieY, i):
screen.blit(enemie_ship[i], (enemieX, enemieY))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.