Ejemplo n.º 1
0
        private void Init()
        {
            Energy = new Mana(300);
            Health = new Health(1000);

            DrawBehavior = new TopDownRotationDrawBehavior(this);

            Level      = 1;
            Experience = new NormalExperience();

            Inertia          = new DecimalPoint(0.5, 0.5);
            Acceleration     = 5;
            IsPhysicalObject = true;

            Paralax = Paralax.Middleground;

            SpellHandler = new SpellHandler(GameWorld, this);
            AttackMap    = new Dictionary <ActionSlot, Func <Spell> >();

            ExperienceWhenKilled = 300;

            Loot = new Loot();
            Loot.Items.Add(new HealthPowerUp(Location, GameWorld));

            Experience.LevelUp += Experience_LevelUp;
            Killed             += Character_Killed;
        }
Ejemplo n.º 2
0
        protected PowerUp(DecimalPoint location, GameWorld gameWorld)
        {
            Location             = location;
            GameWorld            = gameWorld;
            GameWorld.Collision += gameWorld_Collision;

            Inertia        = new DecimalPoint(0, 0);
            MotionBehavior = new StationaryMotionBehavior(this, gameWorld);
            Paralax        = Paralax.Middleground;
            DrawBehavior   = new TopDownRotationDrawBehavior(this);

            IsPhysicalObject = false;
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public Enemy(Image image, GameWorld gameWorld)
 {
     Image = image;
     this.MotionBehavior = new NormalMotionBehavior(this, gameWorld);
     Location            = new DecimalPoint(300, 150);
     Image            = image;
     Angle            = 0;
     ActualSpeed      = 0;
     Acceleration     = 0.3;
     TargetSpeed      = 0;
     Inertia          = new DecimalPoint(0.5, 0.5);
     DrawBehavior     = new TopDownRotationDrawBehavior(this);
     Paralax          = Paralax.Middleground;
     IsPhysicalObject = true;
 }
Ejemplo n.º 5
0
        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;
        }