Tuesday 5 April 2011

Starting with the game.

If you know a bit of programming you will be able to understand the program quickly.


So lets make a simple game to move a car around your screen.
Save the code as car.py and the image above in same folder.you can directly start playing the so called game by clicking the car.
To try more of the free games you can visit www.pygame.org
do not forget to read the code.!!!

Starting with Python and Pygame

What is python?

It is a easiest way to program something.To know more about python check out www.python.org.There are a lot of things that you can do with python but here i am going to speak about the games.Games that we play are just programs that run in the CPU and what you see is the graphical output of the program in response to your action,taken from input devices.

If playing game is fun,then make one game is more fun.Game is a program that changes your display screen every second which is termed as FPS(Frame Per Second).So when you are trying to shoot at your enemy,you are actually hitting the image of your enemy which is just a function running behind in CPU.You put an end to the function and your enemy is dead on the screen.Everything that you see in game is just an object form a class.There are Game Engines that provide you a lot of ready functions which will help you develop a game for example to detect the collision.So not wasting time on the technical things lets start developing a game.you will learn many thing by your own.

What you need to develop a game is patience and creative thoughts.more than that you will need the following software:
  • Python 2.6
  • Pygame 9.1
(The version is important for compatibility)


After you install above software you just try the following code in the IDLE(Python GUI):

>>>import pygame
>>>

There should not be any error if error occurs then your pygame 9.1 in not installed properly.