Esempio n. 1
0
 public Inputmanager(Contents contents, Camera camera, Player player, Keymanager keymanager, Cursor mouse, Enemymanager enemymanager, Windowmanager windowmanager, Backgroundmanager backgroundmanager, Backgrounddatabase backgrounddatabase, Objectmanager objectmanager, Objectdatabase objectdatabase, Eventmanager eventmanager, Levelmanager levelmanager, Levermanager levermanager, ContentManager contentmanager, Editor editor, DebugView DebugView, DepressionHandler Depression, Mathe mathe, Itemmanager itemmanager, BackgroundMusic bmus)
 {
     this.Contents = contents;
     this.Player = player;
     this.Keymanager = keymanager;
     this.Cursor = mouse;
     this.Enemymanager = enemymanager;
     this.Windowmanager = windowmanager;
     this.Backgroundmanager = backgroundmanager;
     this.Backgrounddatabase = backgrounddatabase;
     this.Objectmanager = objectmanager;
     this.Objectdatabase = objectdatabase;
     this.Eventmanager = eventmanager;
     this.Levelmanager = levelmanager;
     this.Levermanager = levermanager;
     this.Contentmanager = contentmanager;
     this.Editor = editor;
     this.Mathe = mathe;
     this.Keymanager.Windowmanager = windowmanager;
     this.Camera = camera;
     this.Itemmanager = itemmanager;
     this.DebugView = DebugView;
     this.Depression = Depression;
     this.bg = bmus;
 }
Esempio n. 2
0
 //Kontruktor Ladevorgang
 public Eventcondition(Mathe mathe, Player player, Conditiontype type, Vector2 position)
 {
     this.Mathe = mathe;
     this.Player = player;
     this.Type = type;
     this.Position = position;
 }
Esempio n. 3
0
 public Windowdatabase(Contents contents, Player player, Inputmanager inputmanager)
 {
     this.Contents = contents;
     this.Player = player;
     this.Inputmanager = inputmanager;
     FensterLaden();
 }
Esempio n. 4
0
 public Backgroundmanager(Player player, Backgrounddatabase backgrounddatabase, DebugFlag flag ,Contents contents)
 {
     this.Backgrounddatabase = backgrounddatabase;
     this.debugFlag = flag;
     this.stringBuilder = new StringBuilder();
     this.Contents = contents;
     this.Player = player;
 }
Esempio n. 5
0
 //Kontruktor Ladevorgang
 public Eventtrigger(Enemymanager enemymanager, Mathe mathe, Player player, Triggertype type, Vector2 position)
 {
     this.Mathe = mathe;
     this.Player = player;
     this.Type = type;
     this.Position = position;
     this.Enemymanager = enemymanager;
 }
Esempio n. 6
0
 public Levermanager(SpriteFont font, Player player, Cursor cursor, Mathe mathe, Animationsmanager animationsmanager, Contents contents)
 {
     this.Font = font;
     this.Player = player;
     this.Cursor = cursor;
     this.Mathe = mathe;
     this.Animationsmanager = animationsmanager;
     this.Contents = contents;
 }
Esempio n. 7
0
        public Objectmanager(Objectdatabase objektdatenbank, Animationsmanager animationsmanager, Player player, DebugFlag flag)
        {
            this.debugFlag = flag;
            this.stringBuilder = new StringBuilder();

            this.Objektdatenbank = objektdatenbank;
            this.Animationsmanager = animationsmanager;
            this.Player = player;
            Player.Objectmanager = this;
        }
Esempio n. 8
0
 public Eventmanager(Mathe mathe, Player player, Enemymanager enemymanager, DepressionHandler depressionhandler, Objectmanager objectmanager, Objectdatabase objectdatabase, Levermanager levermanager)
 {
     this.Mathe = mathe;
     this.Player = player;
     this.Enemymanager = enemymanager;
     this.DepressionHandler = depressionhandler;
     this.Objectmanager = objectmanager;
     this.Objectdatabase = objectdatabase;
     this.Levermanager = levermanager;
 }
Esempio n. 9
0
 public Enemymanager(Objectmanager objectmanager, Mathe mathe, ContentManager contentManager, Enemydatabase enemydatabase, Player player)
 {
     this.Objectmanager = objectmanager;
     this.Mathe = mathe;
     this.ContentManager = contentManager;
     this.Enemydatabase = enemydatabase;
     this.Player = player;
     //AddEnemy(Enemytype.Wolf, new Vector2(6300, 714), Richtung.Links, 1f);
     //AddEnemy(Enemytype.Skelett, new Vector2(900, 735), Richtung.Links, 1f);
 }
Esempio n. 10
0
 //Konstruktor Manager
 //public Item(ContentManager contentmanager, Player player, string textur, Vector2 position, bool kuriert)   //Konstruktor Manager
 //{
 //    this.Player = player;
 //    this.Contentmanager = contentmanager;
 //    this.Textur = contentmanager.Load<Texture2D>(@"Items\" + textur);
 //    this.Position = position;
 //    this.Feld = new Rectangle((int)(Position.X - (Textur.Width / 2)), (int)(Position.Y - (Textur.Height / 2)), Textur.Width, Textur.Height);
 //    this.Kuriert = kuriert;
 //}
 public Item(Player player, DepressionHandler depressionhandler, string name, Texture2D textur, Vector2 position, bool kuriert)
 {
     this.Player = player;
     this.DepressionHandler = depressionhandler;
     //this.Contentmanager = contentmanager;
     //this.Textur = contentmanager.Load<Texture2D>(@"Items\" + textur);
     this.Name = name;
     this.Textur = textur;
     this.Position = position;
     this.Feld = new Rectangle((int)(Position.X - (Textur.Width / 2)), (int)(Position.Y - (Textur.Height / 2)), Textur.Width, Textur.Height);
     this.Kuriert = kuriert;
 }
Esempio n. 11
0
        public Itemmanager(Mathe mathe, DepressionHandler depressionHandler, ContentManager contentManager, Player player)
        {
            this.Mathe = mathe;
            this.DepressionHandler = depressionHandler;
            this.ContentManager = contentManager;
            this.Player = player;

            if (System.IO.Directory.Exists(Quellpfad))
            {
                string[] folders = System.IO.Directory.GetFiles(Quellpfad);
                foreach (string s in folders)
                {
                    Datenbank.Add(new Item(ContentManager, s.Substring(14, s.Length - 18)));
                }
            }
        }
Esempio n. 12
0
 public Levelmanager(Player player, Objectmanager objectmanager, Animationsmanager animationsmanager, Backgroundmanager backgroundmanager, Enemymanager enemymanager, Itemmanager itemmanager, Levermanager levermanager, Eventmanager eventmanager, Contents contents)
 {
     this.Player = player;
     this.Objectmanager = objectmanager;
     this.Objectmanager.Levelmanager = this;
     this.Animationsmanager = animationsmanager;
     this.Backgroundmanager = backgroundmanager;
     this.Enemymanager = enemymanager;
     this.Levermanager = levermanager;
     this.Itemmanager = itemmanager;
     this.Eventmanager = eventmanager;
     this.Eventmanager.Levelmanager = this;
     this.Contents = contents;
     player.Levelmanager = this;
     if (System.IO.Directory.Exists(Quellpfad))
     {
         string[] folders = System.IO.Directory.GetDirectories(Quellpfad);
         foreach (string name in folders)
         {
             Levels.Add(new Level(name.Substring(7)));
         }
     }
     LoadLevel("Stadt");
 }
Esempio n. 13
0
 public void Draw(SpriteBatch spritebatch, Player player)
 {
     if (Betätigt) Animation.Draw(spritebatch, new Rectangle((int)(Position.X - player.PositionCurrent.X), (int)Position.Y, (int)Maße.X, (int)Maße.Y), Color.White, Richtung.Links);
     else Animation.Draw(spritebatch, new Rectangle((int)(Position.X - player.PositionCurrent.X), (int)Position.Y, (int)Maße.X, (int)Maße.Y), Color.White, Richtung.Rechts);
 }
Esempio n. 14
0
 //Konstruktor Editor
 //public Enemy Gegner;
 public Eventaction(Mathe mathe, Player player, Levelmanager levelmanager, Enemymanager enemymanager, DepressionHandler depressionhandler, Eventmanager eventmanager, Objectmanager objectmanager, Objectdatabase objectdatabase,BackgroundMusic musik)
 {
     this.Mathe = mathe;
     this.Player = player;
     this.Levelmanager = levelmanager;
     this.Name = levelmanager.Levels[0].Name;
     this.Enemymanager = enemymanager;
     this.DepressionHandler = depressionhandler;
     this.Eventmanager = eventmanager;
     this.Objectmanager = objectmanager;
     this.Objectdatabase = objectdatabase;
     this.Objecttyp = Objectdatabase.Auslesen(ObjectClass.Stadtdekoration);
     this.bgMusik = musik;
 }
Esempio n. 15
0
 //Konstruktor Editor
 public Eventtrigger(Enemymanager enemymanager, Mathe mathe, Player player)
 {
     this.Mathe = mathe;
     this.Player = player;
     this.Enemymanager = enemymanager;
 }
Esempio n. 16
0
 public void Draw(SpriteBatch batch,Player player)
 {
     batch.Draw(texture,new Vector2( pos.X - player.PositionCurrent.X,pos.Y), null, (Color.White) * percent, angular, origin, scale, SpriteEffects.None, 1f);
 }
Esempio n. 17
0
        protected override void Initialize()
        {
            //primBatch = new PrimitiveBatch(GraphicsDevice);
            World = new World(new Vector2(0, 9.81f));
            Mathe = new Mathe();
            Settings = new Settings(graphics);
            Camera = new Camera(GraphicsDevice.Viewport, Settings.Widescreen);
            Contents = new Contents(Content, GraphicsDevice);
            Debug = new DebugView(Contents,Camera);
            Objectdatabase = new Objectdatabase(Content);
            Backgrounddatabase = new Backgrounddatabase(Content);
            Enemydatabase = new Enemydatabase(Content);
            Animationsmanager = new Animationsmanager();
            Keymanager = new Keymanager(Contents, DebugFlag.Inputstats);
            Player = new Player(Mathe, Contents, World, DebugFlag.PlayerStats);
            Cursor = new Cursor(Camera, Keymanager, Contents, Settings);
            Windowmanager = new Windowmanager(Settings, Cursor, DebugFlag.WindowStats, Contents, GraphicsDevice);
            DepressionHandler = new DyingHope.DepressionHandler();
            Itemmanager = new Itemmanager(Mathe, DepressionHandler, Content, Player);
            Backgroundmanager = new Backgroundmanager(Player, Backgrounddatabase, DebugFlag.BackgrundStats, Contents);
            Levermanager = new Levermanager(Contents.Meiryo8, Player, Cursor, Mathe, Animationsmanager, Contents);
            Objectmanager = new Objectmanager(Objectdatabase, Animationsmanager, Player, (DebugFlag.ObjectInformation | DebugFlag.CollisonShape | DebugFlag.ObjectmanagerStats));
            Enemymanager = new Enemymanager(Objectmanager, Mathe, Content, Enemydatabase, Player);
            Windowmanager.Windowdatabase = new Windowdatabase(Contents, Player, Inputmanager);
            Windowmanager.AddWindow(Windowtype.MainMenue);
            Eventmanager = new Eventmanager(Mathe, Player, Enemymanager, DepressionHandler, Objectmanager, Objectdatabase, Levermanager);
            Levelmanager = new Levelmanager(Player, Objectmanager, Animationsmanager, Backgroundmanager, Enemymanager, Itemmanager, Levermanager, Eventmanager, Contents);
            Editor = new Editor(Windowmanager, Enemymanager, Backgroundmanager, Backgrounddatabase, Objectmanager, Objectdatabase, Eventmanager, Contents, Cursor, Player, Keymanager, Levelmanager, Itemmanager, Levermanager);
            Debugview = new DebugViewXNA(World);
            Console.WriteLine(((DebugFlag.ObjectInformation | DebugFlag.CollisonShape | DebugFlag.ObjectmanagerStats)& DebugFlag.ObjectmanagerStats));
            light = new SoundObjekt(Settings, Contents.Emitter, Contents.Light, new Vector2(3500 - 576, 700), new Vector2(100, 0), 200);
            rain = new SoundObjekt(Settings, Contents.Emitter, Contents.Rain, new Vector2(6000 - 576, 0), new Vector2(1000, 0), 400);
            levelTheme = new List<MSong> { new MSong(Contents.StadtAnfang, 0), new MSong(Contents.StadtLoop, -1), new MSong(Contents.StadtEnde, 0), new MSong(Contents.ParkAnfang, 0), new MSong(Contents.ParkLoop, -1), new MSong(Contents.ParkEnde, 0), new MSong(Contents.SchuleAnfang, 0), new MSong(Contents.SchuleLoop, -1), new MSong(Contents.StadtEnde, 0), new MSong(Contents.MonsterAnfang, 0), new MSong(Contents.MonsterLoop, -1), new MSong(Contents.Ende, 0) };
            menueTheme = new List<MSong> { new MSong(Contents.Menue_Theme, 99) };
            BackgroundMusic = new BackgroundMusic(Settings, menueTheme);
            Inputmanager = new Inputmanager(Contents, Camera, Player, Keymanager, Cursor, Enemymanager, Windowmanager, Backgroundmanager, Backgrounddatabase, Objectmanager, Objectdatabase, Eventmanager, Levelmanager, Levermanager, Content, Editor, Debug, DepressionHandler, Mathe, Itemmanager, BackgroundMusic);

            //Testemitter-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            //testEmitter = new Emitter(new Vector2(3000, 850), DebugFlag.Pertikle);
            //testEmitter.startParticel = 50;
            //testEmitter.EmitterAngel = new List<Vector2> { new Vector2(180, 180) };
            //testEmitter.EmitterRange = new Vector2(1000, 50);
            //testEmitter.EmitterMaxParticel = 100;
            //testEmitter.EmitterUpdate = 100f;
            //testEmitter.EmitterTexture = Contents.Emitter;
            //testEmitter.ParticelStayOnMax = new Vector2(0, 0);
            //testEmitter.ParticelLifeDrain = new Vector2(1, 1);
            //testEmitter.ParticelLifeTime = new Vector2(5000f, 50000f);
            //testEmitter.ParticelSize = new Vector2(0.1f, 0.5f);
            //testEmitter.ParticelTexture = new List<Texture2D> { Contents.Nebel, Contents.Nebel2 };
            //testEmitter.Origin = new Vector2(Contents.Emitter.Width / 2, Contents.Emitter.Height / 2);
            //testEmitter.PerticelPower = new Vector2(0.50f, 0.8f);
            //testEmitter.particelNeverDie = false;
            //testEmitter.spawnprofile = Spawnprofile.FadeIn;
            //testEmitter.bewegungsprofil = Bewegungsprofile.Linear;
            //testEmitter.Start();

            //rainEmitter = new Emitter(new Vector2(6000, -10), DebugFlag.Pertikle);
            //rainEmitter.startParticel = 0;
            //rainEmitter.particelPerUpdate = new Vector2(1, 100);
            //rainEmitter.EmitterAngel = new List<Vector2> { new Vector2(270, 270) };
            //rainEmitter.EmitterRange = new Vector2(1000, 0);
            //rainEmitter.EmitterMaxParticel = 60000;
            //rainEmitter.EmitterUpdate = 10f;
            //rainEmitter.EmitterTexture = Contents.Emitter;
            //rainEmitter.ParticelStayOnMax = new Vector2(0, 0);
            //rainEmitter.ParticelLifeDrain = new Vector2(1, 1);
            //rainEmitter.ParticelLifeTime = new Vector2(500f, 2000f);
            //rainEmitter.ParticelSize = new Vector2(0.5f, 1.5f);
            //rainEmitter.ParticelTexture = new List<Texture2D> { Contents.Rain1 };
            //rainEmitter.Origin = new Vector2(Contents.Emitter.Width / 2, Contents.Emitter.Height / 2);
            //rainEmitter.PerticelPower = new Vector2(10.50f, 20.8f);
            //rainEmitter.particelNeverDie = false;
            //rainEmitter.spawnprofile = Spawnprofile.Instant;
            //rainEmitter.bewegungsprofil = Bewegungsprofile.Linear;
            //rainEmitter.Start();

            menue = new Emitter(new Vector2(GraphicsDevice.Viewport.Width / 2, (GraphicsDevice.Viewport.Height / 2)+20), DebugFlag.Pertikle);
            menue.startParticel = 0;
            menue.particelPerUpdate = new Vector2(1, 5);
            menue.EmitterAngel = new List<Vector2> { new Vector2(0, 360) };
            menue.EmitterRange = new Vector2(250, 50);
            menue.EmitterMaxParticel = 6000;
            menue.EmitterUpdate = 100f;
            menue.EmitterTexture = Contents.Emitter;
            menue.ParticelStayOnMax = new Vector2(0, 100);
            menue.ParticelLifeDrain = new Vector2(1, 1);
            menue.ParticelLifeTime = new Vector2(1000f, 3000f);
            menue.ParticelSize = new Vector2(0.065f, 0.09f);
            menue.ParticelTexture = new List<Texture2D> { Contents.Partikel1, Contents.Partikel2, Contents.Partikel3 };
            menue.Origin = new Vector2(Contents.Emitter.Width / 2, Contents.Emitter.Height / 2);
            menue.PerticelPower = new Vector2(0.2f, 0.9f);
            menue.particelNeverDie = false;
            menue.spawnprofile = Spawnprofile.FadeIn;
            menue.bewegungsprofil = Bewegungsprofile.LinearRandom;
            menue.Start();

            //Debug-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            Debug.Add(Player);
            Debug.Add(Objectmanager);
            Debug.Add(Keymanager);
            Debug.Add(Backgroundmanager);
            Debug.Add(Windowmanager);
            Debug.Add(DepressionHandler);
            //Debug.Add(testEmitter);
            //Debug.AppendFlag(DebugFlag.PlayerStats, false);
            //Debug.AppendFlag(DebugFlag.ObjectmanagerStats,false);
            //Debug.AppendFlag(DebugFlag.ObjectInformation, true);
            //Debug.AppendFlag(DebugFlag.CollisonShape, true);
            Debugview.DebugPanelPosition = new Vector2(500, 100);
            Debugview.AppendFlags(DebugViewFlags.DebugPanel);
            Debugview.LoadContent(GraphicsDevice, Content);

            base.Initialize();
        }
Esempio n. 18
0
 //Kontruktor Editor
 //public Item(ContentManager contentmanager, Player player)  //Kontruktor Editor
 public Item(Player player)
 {
     this.Player = player;
     //this.Contentmanager = contentmanager;
 }
Esempio n. 19
0
 public Editor(Windowmanager windowmanager, Enemymanager enemymanager, Backgroundmanager backgroundmanager, Backgrounddatabase backgrounddatabase, Objectmanager objectmanager, Objectdatabase objectdatabase, Eventmanager eventmanager, Contents contents, Cursor cursor, Player player, Keymanager keymanager, Levelmanager levelmanager, Itemmanager itemmanager, Levermanager levermanager)
 {
     Tool = Editortool.Start;
     this.Windowmanager = windowmanager;
     this.Enemymanager = enemymanager;
     this.Enemydatabase = enemymanager.Enemydatabase;
     this.Backgroundmanager = backgroundmanager;
     this.Backgroundmanager.Editor = this;
     this.Backgrounddatabase = backgrounddatabase;
     this.Objectmanager = objectmanager;
     this.Objectdatabase = objectdatabase;
     this.Eventmanager = eventmanager;
     this.Contents = contents;
     this.Cursor = cursor;
     this.Cursor.Editor = this;
     this.Player = player;
     this.Keymanager = keymanager;
     this.Levelmanager = levelmanager;
     this.Itemmanager = itemmanager;
     this.Levermanager = levermanager;
 }
Esempio n. 20
0
 public void Draw(SpriteBatch spriteBatch, Player player)
 {
     Animation.Draw(spriteBatch, new Vector2(PositionCurrent.X - player.PositionCurrent.X, PositionCurrent.Y), Color.White, Blickrichtung, Skalierung);
 }
Esempio n. 21
0
 public void Draw(SpriteBatch spriteBatch, Player player, Color color)
 {
     if (Animation != null) Animation.Draw(spriteBatch, new Vector2(PositionCurrent.X - player.PositionCurrent.X, PositionCurrent.Y), color);
     else spriteBatch.Draw(Objektvariante.Textur, new Rectangle((int)(PositionCurrent.X - player.PositionCurrent.X), (int)(PositionCurrent.Y), (int)(Skalierung * Objektvariante.Texturausschnitt.Width), (int)(Skalierung * Objektvariante.Texturausschnitt.Height)), new Rectangle(Objektvariante.Texturausschnitt.X, Objektvariante.Texturausschnitt.Y, Objektvariante.Texturausschnitt.Width, Objektvariante.Texturausschnitt.Height), color);
 }
Esempio n. 22
0
 private void CollisionCheck(Player player)
 {
     if ((Geschwindigkeit.Y < 1) && (PositionCurrent.Y + (Texturmaße.Y * Skalierung) - 10 > player.Ground + 200))
     {
         PositionCurrent.Y = PositionLast.Y;
         Geschwindigkeit.Y = 0;
     }
     Objectcollision TempCollision = Objectmanager.Kollisionsabfrage(new Rectangle((int)(PositionLast.X + (Kollision.X * Skalierung)), (int)(PositionCurrent.Y + (Kollision.Y * Skalierung)), (int)(Kollision.Width * Skalierung), (int)(Kollision.Height * Skalierung)), false);
     if (TempCollision != null)
     {
         PositionCurrent.Y = TempCollision.Zone.Y - ((Kollision.Y * Skalierung) + (int)(Kollision.Height * Skalierung));
         Geschwindigkeit.Y = 0;
     }
 }
Esempio n. 23
0
        public void Update(float elapsed, Player player)
        {
            switch (State)
            {
                case Enemystate.Idle:
                    PositionLast = new Vector2(PositionCurrent.X, PositionCurrent.Y);   //Alte Position speichern für Kollisionsrücksetzung
                    PositionCurrent += Geschwindigkeit; //Geschwindigkeit verarbeiten
                    Physik();
                    CollisionCheck(player);

                    float Distanz = Mathe.Distanzberechnung(new Vector2(PositionCurrent.X + (Texturmaße.X / 2), player.PositionCurrent.Y), new Vector2(player.PositionCurrent.X + 640, player.PositionCurrent.Y));
                    if (Distanz < (Texturmaße.X / 2) + 60) //Spieler nah genug für umdrehen
                    {
                        float DistanzX = Mathe.Distanzberechnung(new Vector2(PositionCurrent.X + (Texturmaße.X / 2), PositionCurrent.Y + (Texturmaße.Y / 2)), new Vector2(player.PositionCurrent.X + 640, player.PositionCurrent.Y));
                        if ((PositionCurrent.X + (Texturmaße.X / 2) < player.PositionCurrent.X + 640) && (Blickrichtung == Richtung.Links)) Blickrichtung = Richtung.Rechts;
                        if ((PositionCurrent.X + (Texturmaße.X / 2) > player.PositionCurrent.X + 640) && (Blickrichtung == Richtung.Rechts)) Blickrichtung = Richtung.Links;
                        if (DistanzX < (Texturmaße.X / 2) + 40)  //Spieler nah genug für Angriff
                        {
                            ChangeStatus(Enemystate.Attack);
                            player.DepressionSoll += (float)35 / 100;
                        }
                    }
                    break;
                case Enemystate.Attack:
                    if (Animation.Abgeschlossen) ChangeStatus(Enemystate.Idle);
                    break;
            }
            Animation.Update(elapsed);
        }
Esempio n. 24
0
 public void Draw(SpriteBatch batch,Player player)
 {
     foreach (Particel p in particels)
     {
         p.Draw(batch,player);
     }
 }
Esempio n. 25
0
 //Konstruktor Editor
 public Eventcondition(Mathe mathe, Player player)
 {
     this.Mathe = mathe;
     this.Player = player;
 }