home *** CD-ROM | disk | FTP | other *** search
- class Layout extends Object
- {
- var player_clip;
- var enemies = [];
- var enemy_types = [];
- var enemy_selection = 1;
- function Layout(p_player_clip)
- {
- super();
- this.enemies = [];
- this.player_clip = p_player_clip;
- }
- function addEnemy(p_enemy_clip, p_pos_x, p_pos_y, p_pos_z)
- {
- this.enemies.push(new Enemy(p_enemy_clip,p_pos_x,p_pos_y,p_pos_z));
- }
- function generateEnemies()
- {
- var _loc2_ = 1500;
- while(_loc2_ < 25000)
- {
- _loc2_ += 500 + Math.round(Math.random() * 100);
- if(_loc2_ > 5000 & this.enemy_selection == 1)
- {
- this.enemy_selection = 2;
- }
- if(_loc2_ > 14000 & this.enemy_selection == 2)
- {
- this.enemy_selection = 3;
- }
- var _loc3_ = this.enemy_types[Math.floor(Math.random() * this.enemy_selection)];
- this.addEnemy(_loc3_,Math.round(Math.random() * 2000 - 1000),Math.round(Math.random() * 2000 - 1000),_loc2_);
- }
- }
- }
-