Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a help with my code, as you can see I have the body code but I need to add arms to it as

I need a help with my code, as you can see I have the body code but I need to add arms to it as shown in picture (in white) and wants it to wag(like move itself up & down) and move around the window as it is moving right now. Can anyone help me with this in Pygame.

Attaching picture and code.

image text in transcribed

import pygame BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (0, 255, 0) RED = (255, 0, 0) YELLOW = (255, 215, 0) BLUE = (0, 0, 255) LIGHT_BLUE = (0,191,255) pygame.init() size = [1200, 1000] screen = pygame.display.set_mode(size) pygame.display.set_caption("D") done = False clock = pygame.time.Clock() rect_x = 50 rect_y = 50 rect_change_x = 2 rect_change_y = 2 # -------- Main Program Loop ----------- while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True rect_x += rect_change_x rect_y += rect_change_y if rect_y > 700 or rect_y  900 or rect_x 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions