0

I recently posted a very small program the uses pygame and the livewires package but was unable to get the program to run. I think the Title for that posting was Graphics Window or something close to that anyway. Since I can't resolve that problem, does anyone have any suggestions as to another way I could use pygame along with the livewires packege to accomplish that task? Thanks.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by vegaseat
0

pygame and the livewires package but was unable to get the program to run

Forget about livewires package,it is outdatet and not smart to use at all if you what to learn pygame.

If you want to look pygame you have to do as everyone else.
All tutorials on net are for pygame,none for livewires package.

A simple window with som graphics.

import pygame

#----| Initialize PyGame |---#
pygame.init()

#---| Create window |---#
screen = pygame.display.set_mode((615, 400))                      

#---| Window color |---#                              
screen.fill((100, 0, 0)) #Red

#---| Set name window |---#
pygame.display.set_caption('My pygame window')

#---| variabler color(r, g, b) and size/placement |---#
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
yellow = (255, 255, 0)
#---
radius = 50
center = (150, 150)
center_1 = (450,150)

#---| draw white circles |---#
pygame.draw.circle(screen, white, center, radius)
pygame.draw.circle(screen, white, center_1, radius)

#---| draw a yellow square |---#
pygame.draw.rect(screen, yellow,(220, 250, 150, 100))

#---| Display screen graphics|---#
pygame.display.flip()

while True:
    event = pygame.event.poll()
    if event.type == pygame.QUIT:
        break

Edited by snippsat: n/a

Attachments pygame.png 18 KB
0

I agree with snippsat, don't tie yourself down with an outdated book and outdated custom modules.

Pygame has come out for Python3, and will be around for hopefully more than just a few years. If you learn pygame programming directly, you have learned something worthwhile.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.