home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / cone_crazy_2.swf / scripts / frame_11 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  2.4 KB  |  61 lines

  1. var lives = 3;
  2. var score = 0;
  3. var row = 0;
  4. while(row < _root.map.length)
  5. {
  6.    var col = 0;
  7.    while(col < _root.map[row].length)
  8.    {
  9.       if(!(!_root.map[row][col] || _root.map[row][col] == 0))
  10.       {
  11.          var the_tile = "tile_" + row + "_" + col;
  12.          var world_x = world.tile_width * col;
  13.          var world_y = 0;
  14.          var world_z = world.tile_height * row;
  15.          var newdepth = Math.floor((world.totaldepth - world_z) * 1000 + world_x);
  16.          _root.game.attachMovie(_root.map[row][col].clip,the_tile,newdepth,_root.map[row][col]);
  17.          var temp = _root.WorldToScreen(world_x,world_y,world_z);
  18.          _root.game[the_tile]._x = temp[0];
  19.          _root.game[the_tile]._y = temp[1];
  20.          _root.game[the_tile].swapDepths(temp[1] + temp[0]);
  21.          if(!(!_root.objects[row][col] || _root.objects[row][col] == 0))
  22.          {
  23.             var the_object = "object_" + row + "_" + col;
  24.             var world_x = world.tile_width * col + world.tile_width / 2;
  25.             var world_y = 0;
  26.             var world_z = world.tile_height * row + world.tile_height / 2;
  27.             var newdepth = Math.floor((world.totaldepth - world_z) * 1000 + world_x);
  28.             _root.game.attachMovie(_root.objects[row][col].clip,the_object,newdepth,_root.objects[row][col]);
  29.             var temp = _root.WorldToScreen(world_x,world_y,world_z);
  30.             _root.game[the_object]._x = temp[0];
  31.             _root.game[the_object]._y = temp[1];
  32.             _root.game[the_object].pos_x = world_x;
  33.             _root.game[the_object].pos_z = world_z;
  34.             _root.game[the_tile].object = _root.game[the_object];
  35.          }
  36.       }
  37.       col++;
  38.    }
  39.    row++;
  40. }
  41. var newdepth = Math.floor((world.totaldepth - player.car_z) * 1000 + player.car_x);
  42. game.attachMovie("player","player",newdepth,player);
  43. var temp = WorldToScreen(player.car_x,player.car_y,player.car_z);
  44. game.player._x = temp[0];
  45. game.player._y = temp[1];
  46. game.player.stop();
  47. game.player.car_collider.stop();
  48. game.player.car_collider._visible = false;
  49. _root.focus_x = temp[0];
  50. _root.focus_y = temp[1];
  51. game.onEnterFrame = function()
  52. {
  53.    var _loc4_ = _root.screen.keepplayerat_x - _root.focus_x;
  54.    var _loc3_ = _root.screen.keepplayerat_y - _root.focus_y;
  55.    var _loc6_ = Math.floor(this._x + (_loc4_ - this._x) * 0.2);
  56.    var _loc5_ = Math.floor(this._y + (_loc3_ - this._y) * 0.2);
  57.    this._x = _loc6_;
  58.    this._y = _loc5_;
  59. };
  60. stop();
  61.