Transparency problem displaying text with Pygame

enter image description hereI would like to display transparent text on a surface that is sized based on the length of the text. The problem is that the text has a black background even though “…

Image following line, or how to remove an image without refilling the screen

So, I’m trying my hand at remaking TRON, the snake like cycle arcade game. I am having an issue with my lighcycle images. So in TRON after the line is drawn it stays there, so when trying to place an …

How can a object detect the mouse in pygame

import pygame from pygame.constants import( QUIT, KEYDOWN, KEYUP, K_LEFT, K_RIGHT, K_ESCAPE, K_SPACE, MOUSEBUTTONDOWN) import os from random import randint class Settings: w_width = 800 w_height …

Pygame black screen crash [closed]

I don’t what happened, it was working few minutes ago, but now it’s not. It’s crashing every time. import pygame, sys WIDTH, HEIGHT = 800, 700 pygame.init() win = pygame.display.set_mode((WIDTH, …

When I start this code, i found a problem with error Traceback (most recent call last) in my code with pygame module

I have problem with function. I starting learn pygame with video course, and this is my first pygame code. My .py code: import pygame pygame.init() win = pygame.display.set_mode((1280, 720)) pygame….

How to spawn sprites from multiple sides?

I´m creating simple game where I play as aeroplane and i´m dodging rockets (rockets appear from right side), I did something like barrier which block enemies and kill them, but it´s too OP, so I want …

Draw rectangle on key click

I want to draw a rectangle with a button click , but the problem is with every loop it updates the display , display is filled with a color So the rectangle is only seen for a brief period of time. …

Pygame functions having two brackets

Why does pygame.dispay.set_mode(()) and other similar functions has two braces instead of one and why it isnt working if i just put only one brace?

AttributeError: ‘Event’ object has no attribute ‘button’

Here’s my Code and I am just trying run my xbox controller for later on if statements to control dc motors: pygame.init() joystick = [] clock = pygame.time.Clock() for i in range(0, pygame.joystick….

Is there any way to take executable binary (.exe) and somehow “compile” .wasm

I’m working on a 2d game in pygame, and I want it to be available on the web. In my head, a fun way to challenge myself is to use web assembly to make the game available on the web. So I’m wondering …