public Hero(int x, int y) //Konstruktor, setzt Anfangsposition
 {
     checkpoint = new Vector2(x, y);
     position.X = x;
     position.Y = y;
     cbox = new CollisionBox(Convert.ToInt32((double)Game1.luaInstance["heroCollisionOffsetX"]), Convert.ToInt32((double)Game1.luaInstance["heroCollisionOffsetY"]), Convert.ToInt32((double)Game1.luaInstance["heroCollisionWidth"]), Convert.ToInt32((double)Game1.luaInstance["heroCollisionHeight"]));
     heroStartTime = Convert.ToInt32((double)Game1.luaInstance["heroStartTime"]);
     spine = new Spine();
 }
 public PrincessSpieler(int x, int y) : base(x,y) //Konstruktor, setzt Anfangsposition
 {
     checkpoint = new Vector2(x, y);
     position.X = x;
     position.Y = y;
     lastPosition = position;
     cbox = new CollisionBox(-25, -150, 50, 140);
     lifes = Game1.leben;
     spine = new Spine();
     initAcceleration = (float)Convert.ToInt32((double)Game1.luaInstance["playerAcceleration"]) / 100;
     smashInitIntensity = Convert.ToInt32((double)Game1.luaInstance["playerSmashIntensity"]);
     smashCooldown = 10 * 1000;
 }
 public Player(int x, int y) //Konstruktor, setzt Anfangsposition
 {
     checkpoint = new Vector2(x, y);
     position.X = x;
     position.Y = y;
     lastPosition = position;
     cbox = new CollisionBox(Convert.ToInt32((double)Game1.luaInstance["playerCollisionOffsetX"]), Convert.ToInt32((double)Game1.luaInstance["playerCollisionOffsetY"]), Convert.ToInt32((double)Game1.luaInstance["playerCollisionWidth"]), Convert.ToInt32((double)Game1.luaInstance["playerCollisionHeight"]));
     lifes = Game1.leben;
     spine = new Spine();
     initAcceleration = (float)Convert.ToInt32((double)Game1.luaInstance["playerAcceleration"]) / 100;
     smashInitIntensity = Convert.ToInt32((double)Game1.luaInstance["playerSmashIntensity"]);
     smashCooldown = (float)Convert.ToDouble(Game1.luaInstance["playerMegaSchlagCooldown"]) * 1000;
 }
 public Vector2 CollisionCheckedVector(int x, int y, List<Block> list)
 {
     CollisionBox cboxnew = new CollisionBox((int)cbox.offset.X, (int)cbox.offset.Y, cbox.box.Width, cbox.box.Height);
     cboxnew.Update(cbox.position);
     Vector2 move = new Vector2(0, 0);
     int icoll;
     bool stop;
     //Größere Koordinate als Iteration nehmen
     if (Math.Abs(x) > Math.Abs(y))
     {
         icoll = Math.Abs(x);
     }
     else
     {
         icoll = Math.Abs(y);
     }
     //Iteration
     for (int i = 1; i <= icoll; i++)
     {
         stop = false;
         //Box für nächsten Iterationsschritt berechnen
         cboxnew.box.X = this.cbox.box.X + ((x / icoll) * i);
         cboxnew.box.Y = this.cbox.box.Y + ((y / icoll) * i);
         //Gehe die Blöcke der Liste durch
         foreach (Block block in list)
         {
             //Wenn Kollision vorliegt: Keinen weiteren Block abfragen
             if (cboxnew.box.Intersects(block.cbox)&&block.block)
             {
                 stop = true;
                 break;
             }
         }
         if (stop == true) //Bei Kollision: Kollisionsabfrage mit letztem kollisionsfreien Zustand beenden
         {
             break;
         }
         else //Kollisionsfreien Fortschritt speichern
         {
             move.X = cboxnew.box.X - cbox.box.X;
             move.Y = cboxnew.box.Y - cbox.box.Y;
         }
     }
     return move;
 }
 public Monkey(Vector2 pos, int t,bool mover)
     : base(pos, t,mover)//Konstruktor, setzt Anfangsposition
 {
     spine.Load(position, "skullmonkey", (float)Convert.ToDouble(Game1.luaInstance["monkeySize"]), acceleration);
     cbox = new CollisionBox(Convert.ToInt32((double)Game1.luaInstance["monkeyCollisionOffsetX"]), Convert.ToInt32((double)Game1.luaInstance["monkeyCollisionOffsetY"]), Convert.ToInt32((double)Game1.luaInstance["monkeyCollisionWidth"]), Convert.ToInt32((double)Game1.luaInstance["monkeyCollisionHeight"]));
 }