Sign in to follow this  
biggjoee5790

Livewires? Pygame? help please

Recommended Posts

Ive been working through a new Python book lately, "Python Programming for the Absolute Beginner" I really like how it teaches and I am really moving along well. Although I am not at the point of the book where it gets into 2d game creation and graphics, I have some questions about it. The author teaches the coding using the Livewire modules. I think that Livewire is basically Pygame simplified, I may be wrong. My qeustion is, should I follow the author and use livewire, or should I somehow use his examples but instead of using Livewire, actually use Pygame? How would I go about doing this? Can someone give me an idea of what I should do when I get to this part of the book? I dont want to learn the wrong way by using a "watered down" version of Pygame. [Edited by - biggjoee5790 on April 7, 2007 10:28:14 PM]

Share this post


Link to post
Share on other sites
from what I remember is livewires is built on top of pygame, not as a replacement. I'd say go with the authors examples and stick with livewires until you get the concepts the book is teaching you then once you understand them you can worry about the library you are using.

Share this post


Link to post
Share on other sites
Stick with the version of livewires on the cd if you want to follow the book since the author is actually using an older version of livewires and if you try to use the newest one from the internet the examples won't work.
But yeah livewires is a wrapper around a wrapper so it makes things even easier than pygame but you should be able to pick up pygame later if you want since it's not that much harder.
Here's a simple game loop using pygame to give you an example of how easy it is:

""" mainFunc.py
illustrate using the main function
"""

#I - Import and init - still in global scope
import pygame
pygame.init()

def main():
#D - Display now part of main function
screen = pygame.display.set_mode((640, 480))
pygame.display.set_caption("Now I'm using a main function")

#E - Entities part of main function
background = pygame.Surface(screen.get_size())
background.fill((0, 255, 255))

square = pygame.Surface((25, 25))
square.fill((255, 0, 0))

#Action also part of main function
clock = pygame.time.Clock()
keepGoing = True
while keepGoing:
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False

screen.blit(background, (0, 0))
screen.blit(square, (300, 200))

pygame.display.flip()

#Run main if this is the primary program
if __name__ == "__main__":
main()


Share this post


Link to post
Share on other sites
Learning one thing never stops you learning something else later. Nobody ever worries about reading one book in case it stops them reading another in the future. Just keep reading, keep learning, and try not to worry too much about whether each stage is perfect.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
Learning one thing never stops you learning something else later. Nobody ever worries about reading one book in case it stops them reading another in the future. Just keep reading, keep learning, and try not to worry too much about whether each stage is perfect.


Yes that is true. I guess Im worrying too much instead of just going ahead and learning . Thanks for the advice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this