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; }
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; }
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)); }
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; }
protected Character(GameWorld gameWorld, DecimalPoint location) { Location = location; GameWorld = gameWorld; MotionBehavior = new NormalMotionBehavior(this, gameWorld); Targets = new List<Type>(); Init(); }
/// <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; }
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(); }
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(); }
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(); }
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; }
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; }
public Fireball(Character source, GameWorld gameWorld, int range) : base(source, gameWorld, range) { Image = Properties.Resources.Fireball; }
/// <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; }
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; }
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; }
protected Enemy(GameWorld gameWorld, DecimalPoint location) : base(gameWorld, location) { Targets.Add(typeof(Player)); Target = gameWorld.Player; }
public SpellHandler(GameWorld gameWorld, Character source) { this.GameWorld = gameWorld; this.Source = source; Init(); }
public NovaAttackBehavior(GameWorld gameWorld) { GameWorld = gameWorld; }