Giter Club home page Giter Club logo

pymerrychristmas's Introduction

Pygame Christmas

This little project displays an interactive Christmas card written in Python using the Pygame (http://pygame.org) library.

HINT: You need to have PyGame installed (see their website for details). If you're on a Debian based system: sudo apt-get install python-pygame should do the trick. ;-)

Usage

To start the Christmas card type the following at the console:

python xmas.py

Keys:

S - toggle the snow
M - toggle the music

The project was hacked together in a couple of hours on a Friday evening in preparation for the London Python Code Dojo. The source code is well commented and intended as an example for beginner Pygame developers.

There are three main classes:

  • Flake - represents an individual snowflake.
  • Snowman - represents the skating snowman and inherits Pygame's Sprite class.
  • Card - represents the interactive Christmas card itself, contains the main loop and utility methods for handling various events.

The cards assets can be found in the "data" directory and are all licensed under a copyleft like license - see the sources.txt file therein for more information.

Code Walkthrough

Commands for moving between the different revisions and viewing the differences:

git checkout [step1, step2... step7]
git difftool -t meld step1 step2 -- xmas.py

You'll need the visual diff tool "meld" installed (via a simple apt-get install meld)

Please feel free to expand, extend and modify this software for your own purposes. The code is licensed under the MIT license (found in the source).

Finally, bug reports, comments and enhancements most welcome!

Merry Christmas!

Nicholas.

http://ntoll.org/contact

pymerrychristmas's People

Contributors

ntoll avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.