pygame

How can I make text in pygame pan letter by letter?

半世苍凉 提交于 2021-01-29 12:17:56
问题 For a certain game I'm making, I think it would look a lot better if each letter came one by one, rather than all at once. What can I do to do this? 回答1: First thought: You could create an animation function: This could be a loop that goes through each of the characters and displays them. The only real problem with this is the interrupt time in the main thread--pygame's--slowing down the rest of the game's logic. Better allternative An alternative would be rendering letters as though they

Hide and Seek/Maze game in pygame not working [closed]

南楼画角 提交于 2021-01-29 10:52:19
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Improve this question I'm making a hide and seek/maze game. I'v bean working in the maze but when i move it sometimes skips past it even though i made conditions. I haven't added the other player yet, right know i'm trying to stop the first one from going through walls, but I can't get it to work. I

how do i make an image move?

送分小仙女□ 提交于 2021-01-29 09:53:55
问题 i need the image "pepega" to move/follow the finish. i dont know why this isn't working though. i see pepega but he doesn't move towards the finish. I've done this code before in a different project and it worked. i probably left out something but I don't know what. #make the finish position finishX = 425 finishY = 200 #make the pepega position pepegaX = 60 pepegaY = 175 pepega = pygame.transform.smoothscale(pygame.image.load("C://Users//me//Desktop//python//pygame//resources//charactors/

Uninstalling pygame on linux

帅比萌擦擦* 提交于 2021-01-29 09:38:36
问题 I have been trying to uninstall pygame, but i'm not sure how and i couldn't find any resources to help me. I had installed pygame with the command python3 -m pip install -U pygame -- user , and attempted to uninstall it with sudo apt-get remove --auto-remove python-pygame , but it spat back Package 'python-pygame' is not installed, so not removed . but, in the terminal, I can do python3 -m pygame.examples.aliens and the aliens game will show up. edit: please note that i am new to linux and am

Unable to install pygame on Python via pip (Windows 10)

拟墨画扇 提交于 2021-01-29 08:32:53
问题 Currently unable to install Pygame via pip: pip install pygame Getting this message: Concerned by it being termed an EOF error, is this an error in the module itself? 回答1: There's dev versions available as of now. Get them via pip install pygame==2.0.0.dev6 回答2: welcome to Stack Overflow Pygame is not compatible with python 3.8 at the moment. I would recommend you to downgrade back to 3.7 and installing with pip there. Let me know how it goes... 回答3: pip is doesn't have pygame up. But there

Unable to launch PyGame on PyCharm [duplicate]

那年仲夏 提交于 2021-01-29 08:06:50
问题 This question already has answers here : Add pygame module in PyCharm IDE (5 answers) Cannot install pygame in Pycharm (1 answer) Closed 13 days ago . I was able to install PyCharm onto my computer and installed the Pygame interpreter, yet when I attempted to launch the program, it displays the following: Hello from the pygame community. https://www.pygame.org/contribute.html 2020-11-30 23:32:10.238 Python[56929:43313580] -[CAMetalLayer setDisplaySyncEnabled:]: unrecognized selector sent to

Run Terminal Commands on Raspberry Startup

*爱你&永不变心* 提交于 2021-01-29 07:20:17
问题 I am working on a project in which I am using curses and pygame librarie, my python program/script can only be run through using terminal otherwise this error occurs fd=_sys.__stdout__.fileno()) _curses.error: setupterm: could not find terminal I want to run my program on startup of Raspberry pi by using these two commands cd Desktop python test.py I am aware of rc.local but unable to run this....(first open terminal and then run these 2 commands in order to run my script) 回答1: Running on

Making clone enemies

点点圈 提交于 2021-01-29 06:10:26
问题 I'm making a simple game in pygame, in which you're supposed to dodge or shoot the targets that descend through the screen. So far, I've created the ship movement, the bullet movement, and the first enemy appearance. However, I have absolutely no clue on how to generate new enemies every 3 seconds on the screen. I made a timer, but I still don't know how to generate an enemy after triggering the timer. When the timer hits 3 seconds, it restarts and sets the "has_passed" variable to True,

pygame.error: Not an Ogg Vorbis audio stream

久未见 提交于 2021-01-29 05:26:13
问题 When I try to play a sound which is in .ogg format , I get an error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\default\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1884, in __call__ return self.func(*args) File "C:\Users\default\PycharmProjects\pythonProject1\main.py", line 17, in read pygame.mixer.music.load(outfile) pygame.error: Not an Ogg Vorbis audio stream Here's the code: from tkinter import * import pyttsx3 import pygame

Installing pygame on ubuntu

一笑奈何 提交于 2021-01-29 04:42:33
问题 I am trying to install pygame on an Ubuntu 16.04 system. My default python is 2.7.12. I opened terminal and tried: sudo apt-get install python-pygame I got this message: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The