Thursday, June 25, 2009

STARTING WITH GAMEMAKER 7.0

GAMEMAKER 7.0

I got inspired to try out GAMEMAKER 7.0 after skirting through the wonderful book by Jacob Habgood and Mark Overmars.

Fig 1 . The Game Maker's Apprentice

GAMEMAKER reduced the 'coding' aspects and allows creation of games using GUI. Excellent software ! in some beginnner's pursuit I was able to create game snippets similar to PAC-MAN and SUPER-MARIO. The software is also supported by GAME MAKER LANGUAGE (GML) which is similar to Java/C++.

Fig 2. Game snippet similar to SUPER-MARIO. The 'mushrooms' add life and energy whilst the 'snakes' reduces it.

video
Video 1. Game snippet similar to SUPER-MARIO

Fig 3. GML 'Hello World'

Fig 4. GML 'Hello World' script

Sunday, June 21, 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


Saturday, June 20, 2009

WHAT IS PYGLET ?

WHAT IS IT ?

It is a cross-platform , Open-GL based software library used for developing games and animations using python.

Image 1. '...snakes.....pigs ....it is an entire zoo out here...'

The improvement over PyGame is that it allows animated gif images.


Video 1. Create Space Invaders with Pyglet in 40 Minutes

video
Video 2. Animating a gif file


Monday, June 15, 2009

21 POUNDS

21 POUNDS

A 1 pound coin bouncing randomly with a 20 pound note in the background ! Another PyGame creation !

Fig 1. 21 Pounds

Fig 2. 21 Pounds

Fig 3. 21 Pounds

OBSERVATIONS AND THE CODE

The code is somewhat different than my earlier PyGame creations. Further, there is a parameter 'e' to slow down the speed of the 1 Pound coin. At e = 0.98 the 1 Pound coin comes to a stop after about 141 seconds , at the upper left corner of the pygame screen. For e = 1 , the coin never comes to stop while for e > 1 , the motion becomes faster and erroneous and the software rejects it after some time.

video
Video 1. 21 Pounds

The PyGame screen is also made to suit to that of the 20 pound note (591 x 326) and not the usual (640 x 480).

Fig 4. 21 Pounds , the code

It is also worth noting that random motion is obtained without the use of the random module.

REFERENCES

(1) Daniweb , http://www.daniweb.com/code/snippet758.html
(2) source code and images , http://code.google.com/p/pygame-21pounds/downloads/list

Friday, June 5, 2009

MAKING A FIRE !

PYGAME FIRE

Trying to animate a fire , using python game platform , pygame. I got the fire 'to life' by combining together 16 different sketches or 'sprites'. The primary plume and the wood being the static parts while the other smaller portions of the flame being in repetitive motion. Black is used as background for best contrast.

Fig1.Fire, Screen-Shot 1

Fig2. Fire , Screen-Shot 2

Superimposing the main plume with 14 other minor plume allows creating a seeming movement of the flames upward.


Fig 3. Without the main plume (14 minor plumes and the wood)

video
Video 1. PyGame Fire

The 'effect' is created by motion of the 14 sprites both in horizontal and vertical axis and the variation of the colour. Not often 16 different pieces are sewn together to form an animation in PyGame.

Some tweaking has to be done with the various parameters in order to 'liven-up' the fire.

REFERENCES


(1) Source code and sketches , http://code.google.com/p/pygame-fire/downloads/list

Monday, June 1, 2009

CHERRYPY : HELLO WORLD

HELLO CHERRY

CherryPy is a python based web-development tool. The traditional 'hello world' is scripted as follows.

Fig 1. 'Hello World' in CherryPy

After running the program , on opening http://localhost:8080/


Fig 2. In Firefox

Fig 3. In Safari

REFERENCES
(1) CherryPy Website