home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Puzzle
/
HexiomConnect.swf
/
scripts
/
Slot.as
< prev
next >
Wrap
Text File
|
2008-08-29
|
2KB
|
72 lines
package
{
import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.geom.Point;
public class Slot extends Sprite
{
public static var SW:Point = new Point(-75,43);
public static var NW:Point = new Point(-75,-43);
public static var SE:Point = new Point(75,43);
public static var S:Point = new Point(0,86);
public static var N:Point = new Point(0,-86);
public static var NE:Point = new Point(75,-43);
private static var SlotGfx:Class = Slot_SlotGfx;
public var nw:Slot;
public var sw:Slot;
public var n:Slot;
public var s:Slot;
public var ne:Slot;
public var se:Slot;
public var tile:Tile;
public function Slot(param1:Number, param2:Number)
{
super();
this.x = param1;
this.y = param2;
var _loc3_:DisplayObjectContainer = new SlotGfx() as DisplayObjectContainer;
while(_loc3_.numChildren)
{
addChild(_loc3_.getChildAt(0));
}
}
public function swapTiles(param1:Slot) : void
{
var _loc2_:Tile = this.tile;
var _loc3_:Tile = param1.tile;
param1.tile = _loc2_;
this.tile = _loc3_;
if(_loc2_)
{
_loc2_.slot = param1;
_loc2_.snapToSlot();
_loc2_.checkNeighbours();
}
if(_loc3_)
{
_loc3_.slot = this;
_loc3_.snapToSlot();
_loc3_.checkNeighbours();
}
}
}
}