95 Topics

Member Avatar for
Member Avatar for Gilbertsilva123

this is a small part of my code where i created the collision but the issue is that it still doesnt work i have used also the distance formula to figure out the collision still nothing showed up; please look at the screenshot and help!

Member Avatar for Reverend Jim
0
194
Member Avatar for Gilbertsilva123

which code can i use to make enemy shoot at the player non stop and when the bullet catches the player the health decreases any kind of help i appreciate - pygame

Member Avatar for Gilbertsilva123
0
153
Member Avatar for Traj

import turtle import os import math import random import pygame #set up the screen wn = turtle.Screen() wn.bgcolor("black") wn.title("Space invaders") wn.bgpic("space_invaders_backgrounds.gif") pygame.init() #Register the shapes turtle.register_shape("ship.gif") turtle.register_shape("Enemy.gif") #Drawing my border border_pen = turtle.Turtle() border_pen.speed(0) border_pen.color("white") border_pen.penup() border_pen.setposition(-300,-300) border_pen.pendown() border_pen.pensize(3) for side in range(4): border_pen.fd(600) border_pen.lt(90) border_pen.hideturtle() #Set the score to …

0
318
Member Avatar for ben.juarez.773

Hello! I am looking for some help, and have provided the code. I'm just trying to do some simple stuff. I'm trying to create a simple game without using classes (but using lists). What I'm trying to do is create collision detection among list objects ("bullets" and "baddies"), as you'll …

Member Avatar for a_9
0
708
Member Avatar for Christine_7

I'm currently working on multithreading with PyAudio and Pygame, but when I try to run the audio, I get an error saying "OSError: [Errno -9996] Invalid output device (no default output device)." So far I've tried these on Terminal: >>> import pyaudio >>> pa = pyaudio.PyAudio() >>> pa.get_default_input_device_info() {'name': 'Built-in …

Member Avatar for rproffitt
0
4K
Member Avatar for bmanzana

i am building a pong like game and cant seem to figure out how to add in a pause feature everything else works i have movement and collision detection, sound, game over and restart options but cant figure out how to pause the game any help would be greatly appreciated …

Member Avatar for shubham_9
0
9K
Member Avatar for Lucas_10

So, I'm making a ton of games like Bubble Blaster but will anyone help me with my currunt one, CodeNet! Currently this is the code. #CodeNet.com #Game Script import time print('Welcome') menu = ['Accept', 'Cancel'] from Tkinter import * HEIGHT = 626 WIDTH = 1238 window = Tk() window.title('Code Net.com') …

Member Avatar for Lucas_10
0
382
Member Avatar for rhys1619

Hi, i was want to add an image that is displayed before my game and then the user will click or press enter and the image will disappear and my game will start. I have tried "blit" and a few other thinks to try and get the image to appear …

Member Avatar for Lucas_10
0
344
Member Avatar for rhys1619

Hi, im trying to add a slapsh screen before my game. It will display a png and the use can either press "e" to continue or "q" to quit. when i run this in my game is says that pygame.display.update() is the problem. Please help thanks. def game_intro(): intro = …

Member Avatar for rhys1619
0
1K
Member Avatar for vegaseat
Member Avatar for rhys1619

hi, so ive been trying to add a splash screen to the start of my game. the user presses "e" to continue and "q" to quit. it's not working, could anyone help. import os import pygame import random pygame.init() #Colours im using in the game white = (255,255,255) black = …

0
245
Member Avatar for rhys1619

hi, im making a game in pygame game and i was wanting to add an image (just a png of the story) before my game. I was wondering if anyone can help me with how i would do this. thanks

Member Avatar for rproffitt
0
272
Member Avatar for rhys1619

Hi, i'm making a maze game. As you can see i have added an image for my floor and i'm trying to add an image to my walls. I am having trouble adding the image to the walls. Could anyone start me on my path on how to do this …

0
305
Member Avatar for rhys1619

Hi, this is a maze I have been working on. As you can see everything is just flat colors. I was wanting to make it so i can add more detail like having it so i could have a picture of some tree textures as the walls to my maze …

Member Avatar for DerSoldi
0
281
Member Avatar for rhys1619

Hi, at the end of the maze you see a red square. I was trying to make it say "you win , would you like to play again y or n". i have tried using def mes and gameover = false but nothing seems to work. would help a lot …

Member Avatar for Gribouillis
0
1K
Member Avatar for Nether_1

I have a simple pygame code that doesn't seem to be functioning correctly, check it out: import pygame, time active = True screen_size = (1052, 700) pygame.init() DISPLAY = pygame.display.set_mode(screen_size) firstimg = pygame.image.load('firstimage.png') secondimg = pygame.image.load('secondimage.png') clock = pygame.time.Clock() def WHITESCREEN: DISPLAY.fill(255, 255, 255) def DisplayFirstImg(): DISPLAY.blit(firstimg, (1, 1)) def …

0
160
Member Avatar for Nether_1

Okay so I'm writing a code for a game and the way its currently programmed is the main menu is contained within a large function that references another function, and so on. Not too complicated. But (as you'll see with the code below) I have all the essential variables set …

Member Avatar for Gribouillis
0
366
Member Avatar for vegaseat

This 'sticky' thread is for working examples of Python GUI code. Note that most wxPython examples have their own thread. Please use comments in your code to help the reader. The example code should be usable as a template, so folks get a feel for the toolkit and can use …

Member Avatar for vegaseat
9
45K
Member Avatar for vegaseat

A very basic pygame sprite example. Moving a sprite with the arrow keys, could be the start of a great space game.

0
6K
Member Avatar for vegaseat

This simple code shows how to write text with a given font, font size and color using the module pygame ...

Member Avatar for lsallen
4
7K
Member Avatar for JonKho

Dear all, Currently I am facing the problem on getting the resources for getting Tkinter and pygame to work together. Sadly, I do not have any leads til now(Which worries me alot!! :( ) so I hope the people here can point me to the correct direction. So basically I …

Member Avatar for vegaseat
0
3K
Member Avatar for aanchal_1

after importing pygame, when we convert an image an assign it to a variable, what is the type of that variable?

Member Avatar for aanchal_1
0
256
Member Avatar for ben.juarez.773

Hello, Simple question: how can I command pgs4a to use android-10 (2.2.3) instead of always using android-8 (2.2)? I've tried using the target commands, but to no avail, unless I have missing files? I have my game set up and built, i've successfully created 2.2 apk's but cannot figure out …

0
165
Member Avatar for 26bm

Hi, I am wondering if there is any easy way to up the frame rate of a pygame program. For example locking the frame rate? I don't know. Thanks in advance! 26BM

Member Avatar for 26bm
0
244
Member Avatar for theUserMan

# Heading Here # Trying to add a webcam fee to a panel inside of my wxpython GUI. I have buttons on the left currently, and a black panel on the right. I'm confused as to how to add a webcam feed to that panel? here is the code being …

Member Avatar for ZZucker
0
469
Member Avatar for sam.tubb.75

Hello everyone! I have made a game intended for the Rasberry pi in python. It is called Pi Blocks, but all of my friends with windows want to play it, so I've been trying and trying to get the game into an exectutable format, but nothing seems to work! I've …

Member Avatar for sam.tubb.75
0
329
Member Avatar for wrathofmobius

First of all, I should say I'm brand new to PyGame and am pretty new to advanced Python. I'm trying to make a side-scrolling game but just making a sprite move back and forth with keyboard input is proving to be a problem. It appears that the loop is running …

Member Avatar for vegaseat
0
886
Member Avatar for 26bm

Hi, I'm wondering if anybody knows of a python compiler to make an exe with. I have tries cx_freeze and py2exe so far, but I haven't been able to get it to work. If anyone has any good python to exe compilers please post here. Thanks, 26bm

Member Avatar for james.lu.75491856
0
369
Member Avatar for natehome

im trying to get this script to draw a line from the center of the rectangle to the mouse BUT i only want it to draw about 10 pixels out. how can i find that point that is 10 pixels(or points) out? code so far: import pygame from pygame.locals import …

Member Avatar for natehome
0
300
Member Avatar for 26bm

Hi, I am tring to make a custom cursor in pygame and I would like to use a XBM file to do so. I am wondering if somebody could please give me an example on how to create a XBM cursor, how to load it into pygame, and how to …

0
143

The End.