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

No comments: