Advertisement
Guest User

Untitled

a guest
May 28th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package  {
  2.    
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.    
  6.     public class Floor extends Sprite {
  7.        
  8.         var floorMC:Sprite = new Sprite();
  9.         var floorList = new Array();
  10.        
  11.         public function Floor() {
  12.             floorMC = new floorImage();
  13.             drawFloor(10, 10, 100);
  14.         }
  15.        
  16.         public function drawFloor(fX:Number, fY:Number, fW:Number):void {
  17.             for(var i = 0; i < fW; i++) {
  18.                 floorList.push(floorMC);
  19.                 stage.addChild(floorList[i]);
  20.                 floorList[i].x = fX + i;
  21.                 floorList[i].y = fY;
  22.             }
  23.         }
  24.    
  25.     }
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement