95 Topics
|
|
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! |
|
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 |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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') … |
|
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 … |
|
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 = … |
|
A short example of Pygame showing an image with a known internet url. |
|
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 = … |
|
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 |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
A very basic pygame sprite example. Moving a sprite with the arrow keys, could be the start of a great space game. |
|
This simple code shows how to write text with a given font, font size and color using the module pygame ... |
|
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 … |
|
after importing pygame, when we convert an image an assign it to a variable, what is the type of that variable? |
|
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 … |
|
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 |
|
# 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 … |
|
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 … |
|
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 … |
|
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 |
|
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 … |
|
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 … |
The End.