// *************************************************************************** // Konstruktor 2 public GameObject(ILocationBehavior locationBehavior) { this.LocationBehavior = locationBehavior; this.Renderer = new NoRenderer(); GetRect = RectDefault; }
public void Draw(SpriteBatch spriteBatch, ILocationBehavior locationBehavoir, Color renderColor) { Rectangle temp = locationBehavoir.RelativeBoundingBox; temp.X -= temp.Width / 2; temp.Y -= temp.Height / 2; spriteBatch.Draw(pixel, temp, renderColor); }
// *************************************************************************** // Konstruktor 1 public GameObject(ILocationBehavior locationBehavior, IRenderBehavior renderBehavior) { this.LocationBehavior = locationBehavior; this.Renderer = renderBehavior; GetRect = RectDefault; }
//Constructor public Antrieb( int id, EGroup group, String name, float rateOfFire, float damage, string soundId, float weight, string description, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { RateOfFire = rateOfFire; Damage = damage; SoundId = soundId; }
// *************************************************************************** // Konstruktor public Weapon( Visier visier, Antrieb antrieb, Stabilisator stabilisator, Hauptteil hauptteil, int id, EGroup group, String name, float weight, string description, ILocationBehavior locationBehavior ) : base(id, group, name, description, weight, locationBehavior) { this.Visier = visier; this.Antrieb = antrieb; this.Stabilisator = stabilisator; this.Hauptteil = hauptteil; }
public StaticObject(ILocationBehavior location, IRenderBehavior renderer, bool locationSizing) : base(location, renderer) { if (locationSizing) LocationSizing(); allowToRotate = true; }
// *************************************************************************** // Konstruktor public Weapon( int visierId, int antriebId, int stabilisatorId, int hauptteilId, int id, EGroup group, String name, float weight, string description, ILocationBehavior locationBehavior ) : base(id, group, name, description, weight, locationBehavior) { this.Visier = Item.DefaultVisiere[ visierId ]; this.Antrieb = Item.DefaultAntrieb[ antriebId ]; this.Stabilisator = Item.DefaultStabilisatoren[ stabilisatorId ]; this.Hauptteil = Item.DefaultHauptteil[ hauptteilId ]; }
//Constructor public Munition(int id, EGroup group, String name, List<int> buffIDs, int count, int shotId, float damage, string description, float weight, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { this.buffIDs = buffIDs; Count = count; MagazineSize = count; ShotId = shotId; Damage = damage; }
/// <summary> /// Kosntruktor /// </summary> /// <param name="locationBehavior"> Position des Spielers auf der Map </param> /// <param name="maxHealth"> Maximal Leben </param> /// <param name="health"> Aktuelles Leben </param> /// <param name="speed"> Bewegungsgeschwindigkeit </param> public Player(ILocationBehavior locationBehavior, float maxHealth, float health, float speed) : base(locationBehavior) { Buffs = new Dictionary<EBuffType, Buff>(); Speed = speed; MaxHealth = maxHealth; Health = maxHealth; // Texturen für Renderer laden RendererStanding = LoadedRenderer.GetStatic("S_Player_Standing"); RendererBigWeapon = LoadedRenderer.GetStatic("S_Player_BW"); RendererBigWeaponShot = LoadedRenderer.GetStatic("S_Player_BW_Shot"); RendererSmallWeapon = LoadedRenderer.GetStatic("S_Player_SW"); RendererSmallWeaponShot = LoadedRenderer.GetStatic("S_Player_SW_Shot"); RendererDying = LoadedRenderer.GetAnimation("A_Splatter_01"); RendererDying.PlayOnce(); Texture2D[] textureFootMoving = new[] { Main.ContentManager.Load<Texture2D>("images/character/left_foot"), Main.ContentManager.Load<Texture2D>("images/character/right_foot") }; RendererFootMoving = new AnimationRenderer(textureFootMoving, 4F); _footRenderer = new NoRenderer(); // Location für die Füße _footLocation = new MapLocation(locationBehavior.Position, new Vector2(textureFootMoving[0].Width, textureFootMoving[0].Height)); // Standardmäßig den StandingRenderer zuweisen //Renderer = RendererBigWeapon; // LocationSize anpassen LocationSizing(); LocationBehavior.Size = Renderer.Size; // Sollte LocationSizing machen // InventarListe init Inventar = new Dictionary<int, int>(); Shortcuts = new Dictionary<int, Weapon>(); // Schusstime auf 0 setzten _shotTimer = 0; // Poweruplist init ActivePowerups = new List<Powerup>(); // Liquids auf 0 setzten Liquids = new Vector3(0, 0, 0); // Rect Methode setzten base.GetRect = base.RectPlayer; }
//Constructor public Shot(int id, EGroup group, float speed, Vector2 direction, float damage, String name, float distance, string description, float weight, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { this.Speed = speed; this.Damage = damage; this.Distance = distance; this.Direction = direction; this.Direction.Normalize(); Lifetime = 2000;// TODO: Das irgendwie auslagern oder so Buffs = new Dictionary<EBuffType, Buff>(); }
public Enemy(ILocationBehavior locationBehavoir, IRenderBehavior renderBehavior, float ratOfFire, float attackDistance, float sightiningDistance, float maxHealth, float speed, float health, EEnemyType typeOfEnemy) : base(locationBehavoir, renderBehavior) { this.buffList = new List<Buff>(); this.ratOfFire = ratOfFire; this.AttackDistance = attackDistance; this.SightiningDistance = sightiningDistance; this.MaxHealth = maxHealth; TypOfEnemy = typeOfEnemy; lastAttack = 0; this.Speed = speed; this.Health = health; switch (typeOfEnemy) { case EEnemyType.E1: moveRenderer = LoadedRenderer.Get("A_Krabbler_Move"); standRenderer = LoadedRenderer.Get("A_Krabbler_Stand"); break; case EEnemyType.E2: moveRenderer = LoadedRenderer.Get("A_Schleimer_Move"); standRenderer = LoadedRenderer.Get("A_Schleimer_Stand"); break; case EEnemyType.E3: moveRenderer = LoadedRenderer.Get("A_StachelKrabbe_Move"); standRenderer = LoadedRenderer.Get("A_StachelKrabbe_Stand"); break; case EEnemyType.E4: moveRenderer = LoadedRenderer.Get("A_Schleimer_Move"); standRenderer = LoadedRenderer.Get("A_Schleimer_Stand"); break; case EEnemyType.E5: moveRenderer = LoadedRenderer.Get("A_RoterDrache_Move"); standRenderer = LoadedRenderer.Get("A_RoterDrache_Stand"); break; case EEnemyType.E6: moveRenderer = LoadedRenderer.Get("A_Hellboy_Move"); standRenderer = LoadedRenderer.Get("A_Hellboy_Stand"); break; } this.Activity = new NoActivity(); }
public Enemy(ILocationBehavior locationBehavoir, float ratOfFire, float attackDistance, float sightiningDistance, float maxHealth, float speed, float health, EEnemyType typeOfEnemy) : this(locationBehavoir, new NoRenderer(), ratOfFire, attackDistance, sightiningDistance, maxHealth, speed, health, typeOfEnemy) { }
//Constructor public Stabilisator( int id, EGroup group, String name, float accuracy, float weight, string description, ILocationBehavior locationBehavior ) : base(id, group, name, description, weight, locationBehavior) { this.Accuracy = accuracy; }
public void Draw(SpriteBatch spriteBatch, ILocationBehavior locationBehavoir) { Draw(spriteBatch, locationBehavoir, color); }
public Liquid(int id, ELiquid typeOfLiquid, String name, int amount, EGroup group, string description, float weight, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { this.Amount = amount; this.TypeOfLiquid = typeOfLiquid; }
public void Draw(SpriteBatch spriteBatch, ILocationBehavior locationBehavoir) { // Texture zeichnen Draw(spriteBatch, locationBehavoir, Color.White); }
public void Draw(SpriteBatch spriteBatch, ILocationBehavior locationBehavoir, Color color) { // Nothing todo }
public StaticObject(ILocationBehavior location, IRenderBehavior renderer) : this(location, renderer, true) { }
//Constructor public Powerup(int id, EGroup group, String name, float regeneration, string description, float weight, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { }
public void Draw(SpriteBatch spriteBatch, ILocationBehavior locationBehavoir, Color color) { // Texture zeichnen spriteBatch.Draw(Textures[Frame], locationBehavoir.RelativeBoundingBox, null, color, locationBehavoir.Rotation, locationBehavoir.Size / 2, SpriteEffects.None, 0); }
//Constructor public Hauptteil(int id, EGroup group, String name, float rateOfFire, float weight, string description, ILocationBehavior locationBehavior) : base(id, group, name, description, weight, locationBehavior) { RateOfFire = rateOfFire; }