In all my years of on/off amateur programming, this is the oddest thing I’ve come across. I have a program which runs successfully on 3 Raspberry Pi’s to play a song when the doorbell button is pressed. I have a simplified version of it running on Pydroid on my Samsung S5 phone. Here’s the code. ..
I’m new to programming and I’m struggling to figure out how to get this to work. I’m trying to build a simple game called "Pet pandemic" and you basically just press start and the "pets" marked by different colored dots roam around on a grid in the window. Some of the pets spawn in with ..
I am trying to draw a line in pygame that has a rounded cap unlike the image below. Is there a way I can do this. Ideally I would want a smooth line with no breaks and a rounded edge as opposed to the flat edge it currently has. My current code for drawing a ..
I want to make breakout with pygame. But I dont know how to make multiple blocks. I have already a block with collision and lifes. But when I try to create multiple blocks the game is a single bug. The collision does not work properly, the lives are not properly deducted, the points are not ..
I’m trying to make a chess game, and I’ve encountered a problem: I’m trying to update the display for every ‘tick’ by using pygame.Surface.fill(black_sc). But as a result, it seems I’m not able to draw anything on top of the now black screen: #GAME LOOP while True: screen.fill(black_sc) #SQUARE DRAWING LOOP s_draw_loop() #DRAW THE PIECES ..
I always get this error whenever I try to use some fonts in Pygame I am making a Pomodoro app more info about Pomodoro here My Code import sys import pygame class TIMER: def __init__(self): self.x = screenWidth / 2 self.y = screenHeight / 2 self.font_size = 40 self.text_Color = (255, 255, 255) def draw_timer(self, ..
I am facing three problems right now and i want to get there answer seprately, First question had already been asked you can also answer that first…. import pygame, sys from random import randint pygame.init() screen_size = (350,674) screen = pygame.display.set_mode(screen_size) pygame.display.set_caption("First Game") x_poss = randint(0,350) y_poss = randint(0,675) width = 20 height = 20 ..
I am making a platform game, so platforms are obviously important, but I have arrived at a problem. I am trying to make my character jump on my platform. I have managed to make it jump onto the platform and move left and right and fall off but once I am on the platform I ..
I was messing around with pygame and tried to make a line spin around its starting point, the problem is that for some reason I have to use negative degrees to make them work in an expected way, otherwise it seems like there’s a "delay". Here’s the code: import pygame import time import math import ..
i want to Simulate Spring Physics but i dont know How can i use PyGame To Update The Rect. but when i run my code nothing works the rect wont move can someone please help me??? here is my code: maxmag = 100 mag = 100 screen.fill((255, 255, 255)) ball = pygame.draw.circle(screen, (0, 0, 255), ..