Python Forum
My Pygame Sprite not appearing...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Pygame Sprite not appearing...
#1
My sprite is not appearing. I am trying to draw a rectangle.
code:

import pygame

pygame.init()

#Display#
display = pygame.display.set_mode((800, 500))
pygame.display.set_caption("Magic Tales")

#Variables#

Spd = 20
x1 = 360
y1 = 250
x2 = 440
y2 = 250
fight = True

while fight:
    pygame.time.delay(20)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            fight = False






    pygame.draw.rect(display, (20, 20, 20), (400, 248, 80, 20))
        
    display.fill((0, 60, 80))
    pygame.display.update()

    












pygame.quit()

            
Reply
#2
I'm not really sure, but shouldn't this be in the game development section?
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Sprites just randomly appear and dissapear in my pygame.sprite.GoupeSingle trueShadoWrr 2 1,941 Feb-13-2023, 09:34 AM
Last Post: Vadanane
  [PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. Swagford 1 1,279 Jan-24-2023, 09:58 PM
Last Post: metulburr
  FileNotFoundError when I try putting sprite in Pygame zionkozisek 9 15,793 Dec-09-2020, 04:42 AM
Last Post: zionkozisek
  [PyGame] My Pygame Sprite not appearing... noodlespinbot 3 3,761 Oct-30-2020, 06:51 AM
Last Post: robinmurphy
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,552 Dec-13-2019, 08:37 PM
Last Post: michael1789
  Pygame sprite not moving michael1789 1 2,784 Nov-10-2019, 03:54 AM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,095 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 3,186 Aug-11-2019, 09:12 PM
Last Post: metulburr
  moving a sprite pfaber11 3 2,548 May-15-2019, 12:52 PM
Last Post: pfaber11
  Pygame Class Sprite Placement Confusion TheHumbleIdiot 2 3,518 Sep-11-2018, 02:19 PM
Last Post: TheHumbleIdiot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020