import pygame pygame.init() win = pygame.display.set_mode((1280,800)) pygame.display.set_caption("Fight") appwallpaper = pygame.image.load(‘/Users/arnav/Downloads/AppWallpaper.jpeg’) #setting the apps wallpaper storing it in a variable pygame.display.set_icon(appwallpaper) #setting the apps wallpaper as the poster walkLeft = [pygame.image.load(‘/Users/arnav/Downloads/Jokerattack1.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack2.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack3.png’)] walkRight = [pygame.image.load(‘/Users/arnav/Downloads/Jokerattack1Right.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack2Right.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack3Right.png’)] walkLeft2 = [pygame.image.load(‘/Users/arnav/Downloads/Jokerattack1.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack2.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack3.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack4.png’)] walkRight2 = [pygame.image.load(‘/Users/arnav/Downloads/Jokerattack1Right.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack2Right.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack3Right.png’), pygame.image.load(‘/Users/arnav/Downloads/Jokerattack4Right.png’)] Joker1 = pygame.image.load(‘/Users/arnav/Downloads/Joker.png’) char = pygame.transform.scale(Joker1, ..
I have been trying for a few days to fix an issue that I’m currently having in my 3D graphics engine. I’m trying to set up camera rotation for the first time, but a strange bug has been appearing when I test it. When I use the buttons for rotating the camera, it rotates around ..
I made the Meltingnowman class and the iceball class. If the iceball’s fly_over function works, I want the index number of meltingnowman to be 1 smaller. No error message comes out when executed. However, nothing happens except for the iceball object getting out of the screen. How can I make the classes interact? One more, ..
I just do not know how to return player in this code because no matter where I put it, there is a problem. Please help me to return player so if were to menu() print(player) it would work. Here is the function def menu(): x1 = 128 y1 = 256 x2 = 256 y2 = ..
I have enemy sprites which move around the screen towards the player, however when they get close to each other they overlap ideally would like them to rebound away from each other in opposite directions, currently they bounce off each other slightly but prone to getting caught hitting into each other as they converge on ..
I’m trying to create a game. I have a list of circles that moves continuously. I want to print "yes" if the user clicked on one of the circle. I tried to use the "if in" condition but it doesn’t work. Please help me import pygame import random pygame.init() blanc = (255, 255, 255) vert ..
I’m attempting to make a grid of squares then change the color of the squares depending on their tag, But when I change the color it doesn’t update on the pygame window display. class Sq(): #init Func def __init__(self, surface, color, x, y, width=50, height=50): self.tag = ‘normal’ self.value = 1 self.color = color self.x ..
I’m trying to create a game. I want to get the position of the mouse when I click on a moving circle. I tried to create a variable on the for loop section that keeps the position and then use it on the event for the mouse click but it didn’t works. import pygame import ..
I am using Pygame. I need to trigger the 2nd button after clicking 1st button and 2nd button should stay on screen until further actions on it. Here the part of code where I am stucked: if start_button.draw(17, 315, ‘START’, font_size=15): test_button.draw(17, 415, ‘TEST BUTTON’, font_size=15) I have created test_button in order to test will ..
I need implement the below logic in Python using Pygame library: If user click to button "START", then new frame (no new window, just additional frame with 2 options) should appear for that user with 2 options – "YES" button and "NO" button. If user click to "YES" button, then game should be started, if ..