//----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- public MonsterZolGreen() { color = MonsterColor.Green; MaxHealth = 1; ContactDamage = 1; moveSpeed = 0.75f; jumpSpeed = new RangeF(2.0f); stopTime = new RangeI(48); stopAnimation = GameData.ANIM_MONSTER_ZOL; jumpAnimation = GameData.ANIM_MONSTER_ZOL_JUMP; }
//----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- public JumpMonster() { color = MonsterColor.Red; MaxHealth = 1; ContactDamage = 1; moveSpeed = 1.0f; stopTime = new RangeI(30, 60); jumpSpeed = new RangeF(3, 3); stopAnimation = GameData.ANIM_MONSTER_ZOL; jumpAnimation = GameData.ANIM_MONSTER_ZOL_JUMP; syncAnimationWithDirection = false; }
// Constructs a copy of the specified range. public RangeF(RangeF r) { this.Min = r.Min; this.Max = r.Max; }
//----------------------------------------------------------------------------- // Accessors //----------------------------------------------------------------------------- public bool Intersects(RangeF other) { return (Max > other.Min && Min < other.Max); }
/** <summary> Returns a random double within the specified range. </summary> */ public static double NextDouble(RangeF range) { return(range.Min + random.NextDouble() * (range.Max - range.Min)); }
/** <summary> Returns a random double within the specified range. </summary> */ public static double NextDouble(RangeF range) { return range.Min + random.NextDouble() * (range.Max - range.Min); }
//----------------------------------------------------------------------------- // Accessors //----------------------------------------------------------------------------- public bool Intersects(RangeF other) { return(Max > other.Min && Min < other.Max); }