pygame

argument 1 must be pygame.surface, not list

99封情书 提交于 2021-02-08 06:15:14
问题 I'm programming a minor python game and some of my code doesn't seem to work. Have a look: import pygame import sys import pygame.sprite as sprite import time pygame.init() pygame.display.set_caption("Uni Mario") m_x = 100 m_y = 350 width = 40 height = 60 vel = 5 left=False right=False walk_count = 0 walkRight = [] walkLeft = [] myfont = pygame.font.SysFont("monospace", 25) screen_over = pygame.font.SysFont("monospace", 100) hitcount = 0 score=0 clock = pygame.time.Clock() FPS = 30 background

Can pygame use vector art?

送分小仙女□ 提交于 2021-02-08 05:41:26
问题 http://cache.kotaku.com/assets/resources/2008/02/dbzburstcell.jpg -edit- bassically just detailed vectorized 2d games. When making a side scroller in pygame or any other comparable 2d framework with python, can you utilize graphics such as in the above link? Thanks. 回答1: You can always render your vectors to bitmaps with enough resolution and use the rendered version in the game, instead of rendering everything in runtime -- that seems to be what the game you linked above does. That said, you

Collision detection / physics for simple game

风流意气都作罢 提交于 2021-02-07 23:11:21
问题 Hi i am currently working on a mini game for class (first time doing something like this) and i dont really know how to start with collision detection at all. Okay the game i'm creating is a top down sumo fighting game on a icy circular arena where you move around gaining momentum and velocity and try to knock each other off to gain points. So far i have the movement acceleration/friction pretty much down and I also have a system to detect when a collision occurs, i just don't know how to

Collision detection / physics for simple game

江枫思渺然 提交于 2021-02-07 23:01:09
问题 Hi i am currently working on a mini game for class (first time doing something like this) and i dont really know how to start with collision detection at all. Okay the game i'm creating is a top down sumo fighting game on a icy circular arena where you move around gaining momentum and velocity and try to knock each other off to gain points. So far i have the movement acceleration/friction pretty much down and I also have a system to detect when a collision occurs, i just don't know how to

having issues setting up and displaying the sprites in my classes/subclasses in pygame

给你一囗甜甜゛ 提交于 2021-02-07 21:13:06
问题 Hello I am relatively new to creating games/coding so sorry before hand for the multitude of issues I am going to be bringing and the god awful organisation of my code, I'm attempting to have my class' have a function to render themselves into the game instead of using an outside source `class Animal(pygame.sprite.Sprite): def __init__(Self,): super().__init__() Self.Image=pygame.image.load('Blank.png').convert_alpha() Self.rect=Self.image.get_rect() Self.x=x Self.y=y Self.Screen= screen

having issues setting up and displaying the sprites in my classes/subclasses in pygame

…衆ロ難τιáo~ 提交于 2021-02-07 21:10:28
问题 Hello I am relatively new to creating games/coding so sorry before hand for the multitude of issues I am going to be bringing and the god awful organisation of my code, I'm attempting to have my class' have a function to render themselves into the game instead of using an outside source `class Animal(pygame.sprite.Sprite): def __init__(Self,): super().__init__() Self.Image=pygame.image.load('Blank.png').convert_alpha() Self.rect=Self.image.get_rect() Self.x=x Self.y=y Self.Screen= screen

How to implement flood fill in a Pygame surface

怎甘沉沦 提交于 2021-02-07 18:22:55
问题 I would like to know a good way of filling part of a Pygame surface. The best example of what I want is the way the paint bucket works in MS Paint. For example, if there were a circle drawn in black on a white surface, I want to fill the white inside the circle(or whatever the shape might be). To give you an idea of what I'm working on, I'm making a pixel art tool and I'm working on a feature similar to the bucket from MS Paint. (Watch This: http://imgur.com/a/ogtPV) I've tried using Surface

How to implement flood fill in a Pygame surface

故事扮演 提交于 2021-02-07 18:22:12
问题 I would like to know a good way of filling part of a Pygame surface. The best example of what I want is the way the paint bucket works in MS Paint. For example, if there were a circle drawn in black on a white surface, I want to fill the white inside the circle(or whatever the shape might be). To give you an idea of what I'm working on, I'm making a pixel art tool and I'm working on a feature similar to the bucket from MS Paint. (Watch This: http://imgur.com/a/ogtPV) I've tried using Surface

Level Design in Pygame

落爺英雄遲暮 提交于 2021-02-07 08:54:46
问题 Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks! 回答1: With this type of game your maps are in terms of tiles (I'm assuming that by level you mean an individual level, not managing all of your levels). Each tile has an associated picture (what it

Level Design in Pygame

这一生的挚爱 提交于 2021-02-07 08:53:39
问题 Hey--I'm trying to design my first game using the Pygame library for Python, and I was wondering what the best practices are for level design in general. I would love to hear what you guys think are good object oriented design patterns for managing levels. Also, I'm fairly new to Python--thanks! 回答1: With this type of game your maps are in terms of tiles (I'm assuming that by level you mean an individual level, not managing all of your levels). Each tile has an associated picture (what it