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.
Fig2. User input screen
Fig3. Intermediate screen confirming the user of his/her choice
An Intermediate screen confirms the choice made by the user.
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.
THINGS WORTH A CHAT
(1) The randomisation is realised using the random module across a range (1,2)
(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 1. PyGame Toss
Such codes can be extended to any more games of chance as a throw of a die, draw of cards etc.
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
(1) The randomisation is realised using the random module across a range (1,2)
(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.
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:
Post a Comment