protected Character(GameWorld gameWorld, DecimalPoint location) { Location = location; GameWorld = gameWorld; MotionBehavior = new NormalMotionBehavior(this, gameWorld); Targets = new List<Type>(); Init(); }
private void Init() { Acceleration = 5; Angle = Source.Target != null ? (int)GameWorld.CalcAngle(Source.Location.ToPoint(), Source.Target.Location.ToPoint()) : Source.Angle; Cost = 20; Damage = 200; DamageBehavior = new NormalDamageBehavior(Source, Source.Targets, (int)Damage); DrawBehavior = new TopDownRotationDrawBehavior(this); Inertia = new DecimalPoint(5, 5); ActualSpeed = Source.ActualSpeed; Location = new DecimalPoint(Source.Location.X, Source.Location.Y); MotionBehavior = new NormalMotionBehavior(this, GameWorld); Paralax = Paralax.Middleground; TargetSpeed = 20; IsPhysicalObject = false; MotionBehavior.CanMoveThroughObjects = true; SpellHandler = Source.SpellHandler; SpellHandler.Spells.Add(this); AttackBehaviors = new List<IAttackBehavior>(); GameWorld.Collision += GameWorld_Collision; GameWorld.Split += GameWorld_Split; }
private void Init() { gw.Collision += gw_Collision; Acceleration = 2; Inertia = new DecimalPoint(5, 5); TargetSpeed = 30; MotionBehavior = new NormalMotionBehavior(this, gw); MotionBehavior.WallCollision += MotionBehavior_WallCollision; gw.GameObjects.Add(this); DrawBehavior = new TopDownRotationDrawBehavior(this); Paralax = Paralax.Foreground; IsPhysicalObject = false; }