Steps to be followed in javascript game programming
by Selva[ Edit ] 2008-03-28 18:23:36
Apply the following steps to create javascript game program
1)Don't go to code part at the first step,first paly the game which is just like the game you are going to develop (or)aleast have knowledge of the game you are going to develop
2)Create game Elements--That is first create the images used in the game.
3)Place the game Elements(Images) in window using HTML or javascript.Have name and id for each image.specificy the events to be handled for the image.
4)Split the function to be defined as two groups
*Functions For user move handling
*Function for computer Move handling
5)Delare the variable as global, only if both of the above functions access that variable
6)First Define function for User Move hadling.In that keep provisions for following:
*decide what are the events to be catched(eg:key-up,mouse click)
*Define functions or create loop for handling that events
7)Then define Functions for computer move handling.In that funtions keep provisions to block the user's next move.Any worng move done by user must be taken in favour of computer.Analise each move done by user and move to be made by user.All these must done in a 'if'--condition.

There must be one main game loop must be not end until some codition is met.