Changing camera perspective in pygame
I am writing a little game with pygame. I want to add four different camera perspectives to be able to look at the screen from four sides. The first camera perspective is working perfectly fine (player in center and dungeon moving along). However, in the second perspective, the player does not stay on the same spot. I did add the other perspectives, but did not work on them just yet, so I will only give the relevant code to the first and second perspective.
Can I make Pygame rectangle outline with two different color?
Image of rectangle I want to make from paint
frames drop to 0 when my mouse is not in motion in pygame
I am new to pygame and am trying to code the dino game that plays when internet is down on google. I’ve noticed that whenever I stop moving my mouse on the animation window, the frame rate drops to 0.I’ve looked around on the net and no one seems to have spoken about the issue before (or maybe im not getting my keywords down).
I’m trying to make the code stop at a specific point
I am trying to make a story game with python using pygame where the text shows up on screen over time, like in pokemon. I am trying to make the text stop at a specific point in the array, 184. The problem is I don’t know how to make the code stop at that point and using a while loop will stop refreshing the text and make it overlap. Send help. Here is the code.
Why am I getting an AttributeError: ‘Alien’ object has no attribute ‘check_edges’ error?
I am trying to follow along in the Python Crash Course book and create the Alien Invasion game. I’ve gotten pretty far in the development but I am currently stuck on this Attribute Error: ‘Alien’ object has no attribute ‘check edges’ error, after getting the aliens to move to the right. (For reference, this is roughly page 278 of the 7th edition book) Here is the error message. I’m a bit confused as the check edges attribute is in the Alien object, but I am too new to understand where my wires are getting crossed. Any help would be appreciated. Thanks!
Circle is vanishing in PyGame?
I have written a code in Python with Pygame. And now, when I want to add a circle, it disappears immediately.
I don’t know what I have done wrong. I’ve already searched google, but didn’t find anything that helped me.
Inability to move in a spaceship game in PyGame
I have experienced a problem while writing a PyGame project. The project is a spaceship game to be exact.
Can’t detect mouse clicks with pygame
I created a magic 8 ball program, and when you click on the screen it doesn’t do anything. here is the code:
I wrote a turn-based combat sequence with the enemy occasionally using attacks that happen over two turns but in some cases they happen instantly
I’m learning Python, my first project was a tiny text-based game, now I remade it using Pygame. When I got to implementing combat I ran into this problem and failed to solve it on my own. What’s supposed to happen is the enemy goes idle for a turn, meaning a hard-hitting attack is incoming, and then after the player takes their turn the attack is delivered on the enemy’s second turn. And in most cases it behaves as it should. But if the player uses a defensive action (parry or counterspell) when the enemy is not preapring an attack then the idle part of the attack is skipped and it goes straight to instant damage.
Why is my moving code not working in pygame?
So I tried to make a piece of code which has an ‘enemy’ just move to you. It worked until I added some code with button presses moving the character itself. How can I solve this?
I’ve put the code which doesn’t work in bold.
Here is the entire code: