Category : pygame

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, ..

Read more

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 ..

Read more

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 ..

Read more

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 ..

Read more