IDEA! Forums Programming PYGAME basics – lesson 1

Viewing 1 post (of 1 total)
  • Author
  • #373 Reply


    To learn programming a computer game in python you’ll need PyGame – a python module built on top of very popular graphics library for games SDL.

    To install it in Ubuntu type in console:
    sudo apt-get install python-pygame


    In this example I’ll explain how to create simple object controlled by keyboard and moving in a game window.

    Files needed: – source code – player icon image

    To run example type in console:

    Example code consists of few functions:
    main() – creates PyGame window and loads the player image
    runGame() – creates player object and in main loop: clears window, displays player blit, reacts on keypress events and moves the object
    terminate() – terminates the game program

Viewing 1 post (of 1 total)
Reply To: PYGAME basics – lesson 1
Your information:

+ 66 = 73