Questions tagged [pygame-surface]

pygame object for representing images. Use this tag only if you are using the pygame library and not if you have a question about programming a game in python in general.

The most important part of pygame is the surface. Just think of a surface as a blank piece of paper. You can do a lot of things with a surface – you can draw lines on it, fill parts of it with color, copy images to and from it, and set or read individual pixel colors on it. A surface can be any size (within reason) and you can have as many of them as you like (again, within reason). One surface is special – the one you create with pygame.display.set_mode(). This ‘display surface’ represents the screen; whatever you do to it will appear on the user’s screen. You can only have one of these – that’s an SDL limitation, not a pygame one.

Home Page: http://www.pygame.org/docs/ref/surface.html

609 questions
-2
votes
1 answer

Pygame.Surface driving me crazy

I can get all my images to come up if I only do image.load('').convert_alpha(). When i try getting alittle more control, Surface just kills me, I dont know what to do any more. I need help, please!! import pygame, sys pygame.init() white =…
Tea-We
  • 13
  • 3
-2
votes
2 answers

How to use mousebuttons in pygame?

hi im new to pygame and i'm creating virtual version of board game which i created. so for now im playing arond in pygame and i want to change my code where i use w and d for moving piece to code where i ll use mouse cliclicks to move my pieces here…
Namper
  • 37
  • 5
-3
votes
0 answers

Dynamic settings (speed of the aliens, ship and bullets) don't reset. Python Crash Course. The Alien Invasion project

I have two types of score in the game to record my game's statistic. The first score is the score a user earn playing. In the code it's called as "score" The second score (high_score) is the highest score of the all plays a user does. It stores in…
education
  • 5
  • 1
-3
votes
2 answers

How to execute event repeatedly in Python?

I'm new to pygame programming. I need that operation increases character's speed (who is represented as moving images on screen) every 10 seconds using 'self.vel+=1'. Probably pygame.time.set_timer) would do it but I don't know how to use it.…
-3
votes
1 answer

I'm new to Python. I'm trying to make a simple snake game,but it keeps giving me these errors.(I am using python 3.7.1 and pygame 1.9.6)

class Snake(pygame.sprite.Sprite): image: Union[SurfaceType, Any] def __init__(self): pygame.sprite.Sprite.__init__(self) self.image=pygame.Surface((12,12)) self.image.dill(WHITE) …
zcody
  • 3
  • 1
-3
votes
1 answer

TypeError: argument 1 must be pygame.Surface, not list

I was working on a movement animations since I saw a youtuber explaining how to do it, but I'm getting this error: TypeError: argument 1 must be pygame.Surface, not list My code is about 500 lines. # Pygame Template - skeleton for a new pygame…
-4
votes
1 answer

Can't sort into categories, values will increase indefinitely, can't remove enemies

import random from random import * import math from math import * from pygame import * import pygame, sys from pygame.locals import * import pygame.font from pygame.font import * bif= "grass.png" mif= "character front.png" mifB= "character…
1 2 3
40
41