Questions tagged as 'pygame'

1
answer

how can I change the event KEYDOWN to key_o? without error

What happens is that I saw this code and I was working for a while, but when I try to change KEYDOWN To K_o I get an error that the key is not defined can you tell me why I can not change it or how do I change it? import os import pygame, rand...
asked by 26.09.2017 / 22:54
1
answer

Problems with menu in python

This is what I have def Menu(): #Muestra en pantalla la imagen guardada en Ganag screen.blit(Menug, (0,0)) #Actualizará el contenido de la pantalla entera for event in pygame.event.get(): dificultad =0 if event.type ==...
asked by 10.10.2018 / 05:24
2
answers

Pip does not install packages: [Errno 13] Permission denied

I want to install packages for Python 3.6.5 When entering pip install pygame I get this: C:\Users\rayvi>pip install shell Collecting shell Using cached https://files.pythonhosted.org/packages/c1/19/5fc161e830b08bf2b419a04b0105f2dbf0957591...
asked by 27.04.2018 / 00:45
1
answer

global name 'K_ENTER' is not defined

That error comes to me when I try to press the enter or even when I want to press the space I get the same error ... def Menu(): #Llama a la variable global dificultad global dificultad #Carga y guarda la imagen de la carpeta dibujo...
asked by 10.10.2018 / 09:32
0
answers

What does "libpng warning: iCCP: known incorrect sRGB profile" mean?

The game works and everything but once you lose or win this message seems to you in the compiler (In my case I use spyder) libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iC...
asked by 10.10.2018 / 01:39
1
answer

How does self work in python? [duplicate]

I would like to know how self works in python, I know that it has to do something with the classes but I do not have it so clear and I need to know to convert it into an arrangement, here there is little of the code class Button(pygame.sprit...
asked by 07.10.2018 / 06:44
0
answers

UnicodeDecodeError: 'ascii' codec can not decode byte 0xc3 in position 18: ordinal not in range (128)

Well no idea what happened, change the code to another folder to send it and I have given these errors No se puede cargar imagen: mmempty.png Traceback (most recent call last): File "C:\Python27\lib\site-packages\IPython\core\interactiveshell...
asked by 08.10.2018 / 23:28
0
answers

Create game without lists

what happens is that I must create a game but must not have lists (the truth does not work either but I plan to use them as XD), I just found out and now I do not know how to remove them or how to put it to work. This is the code import pygame...
asked by 06.10.2018 / 04:29
1
answer

Create menu and difficulty in pygame

I have everything ready, I just need to create the menu and I do not know where to put it, the complete code is this import pygame, sys, os, random from pygame.locals import * pygame.init() #Se crea la ventana y le damos un titulo screen = py...
asked by 09.10.2018 / 01:55
0
answers

2D collisions in pygame

I already have the collision by means of a library function pygame . The function returns True each time a collision is generated. My problem is this: I want to make that when a collision is True I can not transfer that...
asked by 14.09.2018 / 04:37