예제 #1
0
        public Player(Image image, GameWorld gameWorld)
        {
            double speed = 0.000001;
            this.MotionBehavior = new NormalMotionBehavior(this, gameWorld);
            MotionBehavior.CanMoveThroughWall = false;
            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);
            //((GrowingImageDrawBehavior)DrawBehavior).SpeedX = 10;
            //((GrowingImageDrawBehavior)DrawBehavior).SpeedY = 10;
            //((GrowingImageDrawBehavior) DrawBehavior).SizeChanged += (Size) =>
            //{
            //    if (Size.Width > 400)
            //    {
            //        ((GrowingImageDrawBehavior)DrawBehavior).SpeedX = -2;
            //        ((GrowingImageDrawBehavior)DrawBehavior).SpeedY = -2;
            //    }

            //    if (((GrowingImageDrawBehavior) DrawBehavior).SpeedY < 0)
            //    {
            //            ((GrowingImageDrawBehavior)DrawBehavior).SpeedX = 0 - (int)speed;
            //            ((GrowingImageDrawBehavior)DrawBehavior).SpeedY = 0 - (int)speed;
            //            speed += speed;
            //    }

            //};

            Paralax = Paralax.Middleground;
            IsPhysicalObject = true;
        }
예제 #2
0
 protected Spell(Character source, GameWorld gameWorld, int range)
 {
     Source = source;
     GameWorld = gameWorld;
     Range = range;
     Init();
 }
 public HealthPowerUp(DecimalPoint location, GameWorld gameWorld)
     : base(location, gameWorld)
 {
     Image = Properties.Resources.heart;
     health = 500;
     DropChance = 50;
 }
예제 #4
0
 public Frostball(Character source, GameWorld gameWorld, int range)
     : base(source, gameWorld, range)
 {
     Image = Properties.Resources.Frostbolt_small;
     if(!SpellHandler.Cooldowns.ContainsKey(typeof(IceGround)))
         SpellHandler.Cooldowns.Add(typeof(IceGround), new Cooldown(0));
 }
예제 #5
0
 public Fireball(Image image, GameWorld gameWorld, IGameObject source)
 {
     this.source = source;
     gw = gameWorld;
     Image = image;
     Init();
 }
 public SpellShieldNova(Character source, GameWorld gameWorld, int range)
     : base(source, gameWorld, range)
 {
     Image = Properties.Resources.SpellNova;
     DrawBehavior.IsCircle = true;
     MotionBehavior = new StationaryMotionBehavior(this, gameWorld);
 }
 public SlaugtherDungeonGame(Graphics g, Size gameSize)
 {
     gameWorld = new GameWorld(@"C:\Users\54430\Google Drev\level1.txt");
     game = new Game(g, gameWorld, gameSize);
     game.Draw += game_Draw;
     game.OutOfVision += game_OutOfVision;
 }
예제 #8
0
 protected Character(GameWorld gameWorld, DecimalPoint location)
 {
     Location = location;
     GameWorld = gameWorld;
     MotionBehavior = new NormalMotionBehavior(this, gameWorld);
     Targets = new List<Type>();
     Init();
 }
예제 #9
0
 /// <summary>
 /// Game contructor
 /// </summary>
 /// <param name="g">The graphics object to draw onto</param>
 /// <param name="gw">The gameworld</param>
 public Game(Graphics g, GameWorld gw, Size gameSize)
 {
     Size = gameSize;
     this.gw = gw;
     this.camera = new Camera(gw, 0, 0);
     this.gw.Camera = camera;
     gfx = new GfxEngine(g, gw, camera);
     gfx.Draw += gfx_Draw;
     gfx.OutOfVision += gfx_OutOfVision;
 }
예제 #10
0
 public IceGround(Character source, GameWorld gameWorld, int range) : base(source, gameWorld, range)
 {
     Image = Properties.Resources.IceGround;
     this.MotionBehavior = new StationaryMotionBehavior(this, gameWorld);
     Paralax = Paralax.Background;
     affectedCharacters = new List<Character>();
     Cost = 0;
     gameWorld.Split += gameWorld_Split;
     SlowPercentage = 25;
     Exit();
 }
예제 #11
0
 public Monster(GameWorld gameWorld, DecimalPoint location)
     : base(gameWorld, location)
 {
     Image = Properties.Resources.MonsterSmall;
     Inertia.X = 2;
     Inertia.Y = 2;
     TargetSpeed = 7;
     DrawBehavior.IsCircle = true;
     MotionBehavior = new WanderingMotionBehavior(this, gameWorld);
     CreateAttackMap();
 }
예제 #12
0
 public Player(GameWorld gameWorld, DecimalPoint location)
     : base(gameWorld, location)
 {
     Image = Properties.Resources.Player;
     Acceleration = 2;
     Inertia.X = 2;
     Inertia.Y = 2;
     DrawBehavior.IsCircle = true;
     Health.Max = 5000;
     Health.Current = Health.Max;
     Targets.Add(typeof(Enemy));
     CreateAttackMap();
 }
예제 #13
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;
        }
예제 #14
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;
 }
예제 #15
0
 public Fireball(Character source, GameWorld gameWorld, int range)
     : base(source, gameWorld, range)
 {
     Image = Properties.Resources.Fireball;
 }
예제 #16
0
 /// <summary>
 /// Camera constructor
 /// </summary>
 /// <param name="gw">GameWorld</param>
 /// <param name="xOffset">Start x offset</param>
 /// <param name="yOffset">Start y offset</param>
 public Camera(GameWorld gw, float xOffset, int yOffset)
 {
     this.gw = gw;
     XOffset = xOffset;
     YOffset = yOffset;
 }
 public SplitShotAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }
 public SpawnSpellAttackBehavior(GameWorld gameWorld, Func<Spell> newSpell)
 {
     GameWorld = gameWorld;
     NewSpell = newSpell;
 }
예제 #19
0
 /// <summary>
 /// Camera constructor
 /// </summary>
 /// <param name="gw">GameWorld</param>
 /// <param name="xOffset">Start x offset</param>
 /// <param name="yOffset">Start y offset</param>
 public Camera(GameWorld gw, float xOffset, int yOffset)
 {
     this.gw = gw;
     XOffset = xOffset;
     YOffset = yOffset;
 }
 public TargetAttackBehavior(GameWorld gameWorld, IGameObject target)
 {
     this.Target = target;
     GameWorld = gameWorld;
 }
 public CircleSpellAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
     affectedSpells = new List<Spell>();
 }
 public RemoveTargetSpellAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }
 public ChangeImageAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }
예제 #24
0
 public Lightningbolt(Character source, GameWorld gameWorld, int range)
     : base(source, gameWorld, range)
 {
 }
 public RejectSpellAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }
 public TargetAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }
 public BuffDurationAttackBehavior(GameWorld gameWorld, Buff buff)
 {
     GameWorld = gameWorld;
     Buff = buff;
 }
예제 #28
0
 protected Enemy(GameWorld gameWorld, DecimalPoint location)
     : base(gameWorld, location)
 {
     Targets.Add(typeof(Player));
     Target = gameWorld.Player;
 }
예제 #29
0
 public SpellHandler(GameWorld gameWorld, Character source)
 {
     this.GameWorld = gameWorld;
     this.Source = source;
     Init();
 }
 public NovaAttackBehavior(GameWorld gameWorld)
 {
     GameWorld = gameWorld;
 }