Python Forum
pip install pygame choking on SDL dependency
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip install pygame choking on SDL dependency
#16
Quote: I'm having my doubts about pygame now.
Please don't compare livewires to pygame. Pygame has it own faults.

Pygame example.
import pygame

class Scene:
    def __init__(self, title, width, height):
        # basic pygame setup
        pygame.display.set_caption(title)
        self.rect = pygame.Rect(0, 0, width, height)
        self.surface = pygame.display.set_mode(self.rect.size)
        self.clock = pygame.time.Clock()

        # your code
        image_name = "/Users/yamo/trash/python/ch11/wall.jpg"
        # convert the image to match pygame format
        self.wall_image = pygame.image.load(image_name).convert()

    def mainloop(self):
        self.running = True

        while self.running:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    self.running = False

            # draw code here
            # background
            self.surface.blit(self.wall_image, (0,0))

            pygame.display.flip()
            # don't max out cpu. limit framerate.
            self.clock.tick(30)

if __name__ == '__main__':
    pygame.init()
    scene = Scene('Example', 640, 480)
    scene.mainloop()
    pygame.quit()
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
RE: pip install pygame choking on SDL dependency - by Windspar - Jan-22-2019, 09:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't get pygame to install djwilson0495 13 10,590 Dec-07-2020, 01:30 PM
Last Post: djwilson0495
  Trying to install pygame Mac OS x high sierra giladal 2 2,857 Oct-18-2020, 09:27 PM
Last Post: nilamo
  Error to install pygame skp 1 3,614 Apr-14-2020, 05:17 PM
Last Post: joe_momma
  PIP cannot install Pygame Amaly84 6 10,273 Sep-04-2019, 07:59 PM
Last Post: Amaly84
  pip can't install pygame SheeppOSU 1 9,533 Dec-08-2018, 08:20 PM
Last Post: snippsat
  How to install Pygame chappie 2 3,505 Dec-06-2017, 10:47 PM
Last Post: chappie
  How to begin coding for game making [Install pygame on mac] mattkrebs 2 5,065 Apr-02-2017, 10:57 AM
Last Post: machrider
  [split] permission error on pygame install pyteach 7 8,420 Jan-23-2017, 11:00 PM
Last Post: pyteach

Forum Jump:

User Panel Messages

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