initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxObject;
|
||||
|
||||
public class Entity extends ArcSprite
|
||||
{
|
||||
|
||||
public var of:Function;
|
||||
|
||||
public function Entity(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2);
|
||||
this.of = Data.state is HorizontalMode ? this.ofh : this.ofv;
|
||||
}
|
||||
|
||||
public function handleCollision(param1:FlxObject) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function get outside() : Boolean
|
||||
{
|
||||
return this.of();
|
||||
}
|
||||
|
||||
public function ofh() : Boolean
|
||||
{
|
||||
var _loc1_:int = x / Config.BLOCK_SIZE;
|
||||
return _loc1_ <= Data.state.despawnTop - 2;
|
||||
}
|
||||
|
||||
public function ofv() : Boolean
|
||||
{
|
||||
var _loc1_:int = y / Config.BLOCK_SIZE;
|
||||
return _loc1_ >= Data.state.despawnBottom || _loc1_ <= Data.state.despawnTop - height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user