Our Scripts Vault contains many game scripts that you can use to create your own game!
var tiles = [tile0, tile1, tile2, tile3, tile4, tile5, ..., tileN];
var tile0 = [img_id, obj_id, col_id, row_id];
var objects = [obj0, obj1, obj2, obj3, ..., objN];
var obj0 = [img_id, events_id, width, height];
var events = [event1, event2, ..., eventN];
var event1 = [type, img_id, param1, param2, ..., paramN]; // Can be ['unit', 20, bowmen, strenght=50, id=116]var event2 = [type, img_id, param1, param2, ..., paramN]; // Can be ['under construction', 15, time=5000, id=23]
very nice. exactly how I did it in visual basic 6 =)i didnt see no questions though. was there suppose to be one?
array 0 => array 0 => object(Obj)[1] 1 => object(Obj)[2] 2 => object(Obj)[3] 1 => array 0 => object(Obj)[4] 1 => object(Obj)[5] 2 => object(Obj)[6] 2 => array 0 => object(Obj)[7] 1 => object(Obj)[8] 2 => object(Obj)[9]
foreach ($data as $colId=> $row) { foreach ($row as $rowId=> $cell){ $cell->drawAt($colId*$width, $rowId*$height); }}
$map = array( 0 => array ( 0 => array ( 'tile' => 'grass.jpg', 'objects' => array (...), 'units' => array (...), ), 1 => array ( ... ), ... ), 1 => array ( ... ), ...);