kgizo 0 Light Poster

hello

I'm developing an online game for this mini project we are about to embark in. The game I'm developing is similar to battle ship its just that I will use my own entities instead of using battle ships. Now I've already have a full code for the game which I downloaded from the net, but I need to change the ship types so that they'll correspond to the entities I will be using,here is the code I modified.


<head>
<body>


<SCRIPT LANGUAGE="JavaScript">

/* Information used to draw the ships
var ship =
[[[
[1,2,3,]
[4,'',5],

],
[
[6,7,''],
[8,8,''],

],
[
[1,'',''],
,

]],
[
[1,2,3],

],
[
,
,

]]

;

/* Information used to draw sunk ships
var dead = [[[
[201,202,203],
[201,'',202],

],
[
[201,202,''],
[203,204,''],

],
[
[204,'',''],
,

]],
[
[201,202,203],

],
[
,
,

]]

;

/* Information used to describe ships
var shiptypes = [["Worm",?,1],["Email",?,1],[ "Cyberbully",?,1],[ "Password",?,1],[ "Cookie",?,1]];

var gridx = 16, gridy = 16;
var player = [], computer = [], playersships = [], computersships = [];
var playerlives = 0, computerlives = 0, playflag=true, statusmsg="";


Note that the numbers in the matrices for the var ship & var dead are images which will be used to draw the entities. Now I have a problem whereby I need the ship types variable to correspond to the variable ship. I don't whether I make sense what I mean is that for ship type the array should be like the entity,the number of images, the number of entities on the grid, because what they had is something like this

var shiptypes = [["Minesweeper",2,4] that's for 1 entity.

that's why I have question marks in the var ship type array I need to figure out a way to declare the shapes of my entities. Your help will be highly appreciated!!!

thanks in advance.