Sunday 21 June 2009

THE TOSS IS ALWAYS IMPORTANT !

MY FIRST INTERACTIVE GAME : PYGAME TOSS

My first interactive user input game ! .... tossing a coin. The user is prompted to choose (HEADS or TAILS) using the up and down keys ,and enter.

Fig1. Start up screen

Fig2. User input screen

An Intermediate screen confirms the choice made by the user.

Fig3. Intermediate screen confirming the user of his/her choice

The Result of the toss is confirmed by the show of the successful side of the coin and status (Winner/ Loser) in regards to the user's choice.

Fig4(i). Result screen

Fig3(ii). Result screen
THINGS WORTH A CHAT

(1) The randomisation is realised using the random module across a range (1,2)


Fig5. Randomisation

(2) The Disney font is used to give a touch of humour
(3) The PyGame screen is (512 x 384) suited for a small game !
(4) Dr.Python is WOW ! better than Scite

THINGS NOT WORTH A CHAT

(1) There should be a 'count' which counts the number of times 'you' win.

(2) I am avoiding all sound effects since they fail with py2exe.


video

Video 1. PyGame Toss

Such codes can be extended to any more games of chance as a throw of a die, draw of cards etc.


The user-input setting can be used to make an electronic photo album or an electronic jukebox.

REFERENCES

(1) http://www.pygame.org/project/875/
(2)
Mc Gugan,Will ' Beginning Game Development with Python and Pygame'
(3)
IYOCGwP
(4) Source code and images , http://code.google.com/p/pygame-toss/downloads/list
(5) Pygame Official Project 1254


No comments: