home *** CD-ROM | disk | FTP | other *** search
- var lives = 3;
- var score = 0;
- var row = 0;
- while(row < _root.map.length)
- {
- var col = 0;
- while(col < _root.map[row].length)
- {
- if(!(!_root.map[row][col] || _root.map[row][col] == 0))
- {
- var the_tile = "tile_" + row + "_" + col;
- var world_x = world.tile_width * col;
- var world_y = 0;
- var world_z = world.tile_height * row;
- var newdepth = Math.floor((world.totaldepth - world_z) * 1000 + world_x);
- _root.game.attachMovie(_root.map[row][col].clip,the_tile,newdepth,_root.map[row][col]);
- var temp = _root.WorldToScreen(world_x,world_y,world_z);
- _root.game[the_tile]._x = temp[0];
- _root.game[the_tile]._y = temp[1];
- _root.game[the_tile].swapDepths(temp[1] + temp[0]);
- if(!(!_root.objects[row][col] || _root.objects[row][col] == 0))
- {
- var the_object = "object_" + row + "_" + col;
- var world_x = world.tile_width * col + world.tile_width / 2;
- var world_y = 0;
- var world_z = world.tile_height * row + world.tile_height / 2;
- var newdepth = Math.floor((world.totaldepth - world_z) * 1000 + world_x);
- _root.game.attachMovie(_root.objects[row][col].clip,the_object,newdepth,_root.objects[row][col]);
- var temp = _root.WorldToScreen(world_x,world_y,world_z);
- _root.game[the_object]._x = temp[0];
- _root.game[the_object]._y = temp[1];
- _root.game[the_object].pos_x = world_x;
- _root.game[the_object].pos_z = world_z;
- _root.game[the_tile].object = _root.game[the_object];
- }
- }
- col++;
- }
- row++;
- }
- var newdepth = Math.floor((world.totaldepth - player.car_z) * 1000 + player.car_x);
- game.attachMovie("player","player",newdepth,player);
- var temp = WorldToScreen(player.car_x,player.car_y,player.car_z);
- game.player._x = temp[0];
- game.player._y = temp[1];
- game.player.stop();
- game.player.car_collider.stop();
- game.player.car_collider._visible = false;
- _root.focus_x = temp[0];
- _root.focus_y = temp[1];
- game.onEnterFrame = function()
- {
- var _loc4_ = _root.screen.keepplayerat_x - _root.focus_x;
- var _loc3_ = _root.screen.keepplayerat_y - _root.focus_y;
- var _loc6_ = Math.floor(this._x + (_loc4_ - this._x) * 0.2);
- var _loc5_ = Math.floor(this._y + (_loc3_ - this._y) * 0.2);
- this._x = _loc6_;
- this._y = _loc5_;
- };
- stop();
-