Beispiel #1
0
        public Biker(bool copy, String mask, Texture2D[] frames, abstractKeys keys, int engI, Engine eng, Texture2D FirstFrame, Vector2 position,
                     Rectangle?sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale,
                     SpriteEffects effects, float layerDepth, PhysicsManager pm, float jumpForce) : base(frames, keys, engI, eng, FirstFrame, position, sourceRectangle, color,
                                                                                                         rotation, origin, scale, effects, layerDepth, pm)
        {
            //this.fWheel = new Circle();
            //this.bWheel = new Circle();
            //this.coliisionPoints = new List<Circle>();
            this.mask                = mask;
            this.jumpForce           = jumpForce;
            this.ID                  = engI;
            this.collideWithObstacle = false;
            this.touchesGround       = collisionState.noCollision;
            //this.area = Tools.findArea(mask, new Point(2, 0));
            this.start = new Vector2(this.Position.X, this.Position.Y);
            this.cam   = new Camera(this, new Viewport(0, 0, Tools.W, Tools.H), Vector2.Zero, Global.zoom);
            ////setBikerMask();
            fWheel          = Global.fWheel;
            bWheel          = Global.bWheel;
            area            = Global.area;
            coliisionPoints = Global.cp;

            Game1.Event_Update         += update;
            Background.Event_NextLevel += nxtLevel;
        }
Beispiel #2
0
 public Cop(String mask, Texture2D[] frames, abstractKeys keys, int engI, Engine eng, Texture2D FirstFrame, Vector2 position,
            Rectangle?sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale,
            SpriteEffects effects, float layerDepth, PhysicsManager pm, float jf)
     : base(true, mask, frames, keys, engI, eng, FirstFrame, position, sourceRectangle, color, rotation, origin, scale,
            effects, layerDepth, pm, jf)
 {
     nn = new NeuralNet(inputNum, inputNum + 3, outputNum);
     Game1.Event_Update += shouldJump;
 }
Beispiel #3
0
 public Animation(Texture2D[] frames, abstractKeys keys, DRC drc, int pase, Texture2D firstFrame, Vector2 position,
                  Rectangle?sourceRectangle, Color color,
                  float rotation, Vector2 origin, Vector2 scale,
                  SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(keys, pase, drc, firstFrame, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth, pm)
 {
     this.frames           = frames;
     Game1.Event_Update   += update;
     this.spriteActive     = false;
     this.timeBetweenFrame = 2;
     this.switchF          = order.none;
     index = 1;
 }
Beispiel #4
0
 public Animation(Texture2D tex, Texture2D spriteSheet, Texture2D spriteMask, abstractKeys keys, int engI, Engine eng, Vector2 position,
                  Rectangle?sourceRectangle, Color color,
                  float rotation, Vector2 origin, Vector2 scale,
                  SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(keys, engI, eng, tex, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth, pm)
 {
     this.spriteSheet      = new SpriteSheet(spriteSheet, spriteMask);
     Game1.Event_Update   += update;
     this.spriteActive     = false;
     this.timeBetweenFrame = 2;
     this.switchF          = order.none;
     index = 1;
 }
Beispiel #5
0
 public MovingObj(abstractKeys keys, int pase, DRC drc, Texture2D texture, Vector2 position,
                  Rectangle?sourceRectangle, Color color,
                  float rotation, Vector2 origin, Vector2 scale,
                  SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(texture, position,
                                                                                     sourceRectangle, color, rotation, origin, scale, effects, layerDepth)
 {
     Game1.Event_Update += update;
     Game1.Event_Update += updateMO;
     this.keys           = keys;
     speed     = 0;
     this.pm   = pm;
     this.pase = pase;
     this.drc  = drc;
 }
Beispiel #6
0
 public Animation(int delay, Texture2D[] frames, abstractKeys keys, int engI, Engine eng, Texture2D firstFrame, Vector2 position,
                  Rectangle?sourceRectangle, Color color,
                  float rotation, Vector2 origin, Vector2 scale,
                  SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(keys, engI, eng, firstFrame, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth, pm)
 {
     this.delay            = delay;
     this.saveDelay        = delay;
     this.frames           = frames;
     Game1.Event_Update   += updateDelay;
     this.spriteActive     = false;
     this.timeBetweenFrame = 2;
     this.switchF          = order.regular;
     index = 1;
 }
Beispiel #7
0
 /// <summary>
 /// constructor for moving object
 /// </summary>
 /// <param name="keys">AbstructKeys, keys that control the character</param>
 /// <param name="engI">the index of the engine </param>
 /// <param name="eng">engine for the biker</param>
 /// <param name="texture">tetxture2D picture/firstframe</param>
 /// <param name="position">Vector2, where to draw</param>
 /// <param name="sourceRectangle">which ractangl to draw</param>
 /// <param name="color">Color, which color</param>
 /// <param name="rotation">float, angle in radians</param>
 /// <param name="origin">Vector2, where to draw the Dmoot from</param>
 /// <param name="scale">Vector2, picture scale</param>
 /// <param name="effects"></param>
 /// <param name="layerDepth"></param>
 /// <param name="pm">PhysicsManager, the physics manager for the game</param>
 public MovingObj(abstractKeys keys, int engI, Engine eng, Texture2D texture, Vector2 position,
                  Rectangle?sourceRectangle, Color color,
                  float rotation, Vector2 origin, Vector2 scale,
                  SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(texture, position,
                                                                                     sourceRectangle, color, rotation, origin, scale, effects, layerDepth)
 {
     speed     = 0;
     this.engI = engI;
     this.eng  = eng;
     this.keys = keys;
     this.pm   = pm;
     if (eng != null)
     {
         pm.createNewEngine(eng);
     }
     Game1.Event_Update += updateMO;
     if (keys != null)
     {
         keys.WhoAmI(this);
     }
 }
Beispiel #8
0
 public Obstacle(Texture2D tex, String mask, Texture2D spriteSheet, Texture2D spriteMask, abstractKeys keys, int engI, Engine eng, Vector2 position,
                 Rectangle?sourceRectangle, Color color,
                 float rotation, Vector2 origin, Vector2 scale,
                 SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(tex, spriteSheet, spriteMask, keys, engI, eng, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth, pm)
 {
     this.frame          = Collision.strechVectors(mask);
     this.region         = Tools.findArea(mask, new Point(1, 0));
     Game1.Event_Update += update;
 }
Beispiel #9
0
        public Gunner(DRC shootDrc, Texture2D tex, Texture2D spriteSheet, Texture2D spriteMask, abstractKeys keys, int engI, Engine eng, Vector2 position,
                      Rectangle?sourceRectangle, Color color,
                      float rotation, Vector2 origin, Vector2 scale,
                      SpriteEffects effects, float layerDepth, PhysicsManager pm) : base(tex, spriteSheet, spriteMask, keys, engI, eng, position, sourceRectangle, color
                                                                                         , rotation, origin, scale, effects, layerDepth, pm)
        {
            //bullet
            bulletSpeed = 100;
            Texture2D bulletTex = Tools.cm.Load <Texture2D>("moreObj/bullet");

            Tools.makeTransparent(bulletTex);
            Vector2 firePos = new Vector2(0, 910);
            Vector2 pos     = position - (origin * scale) + (firePos * scale);

            bulletScale = new Vector2(0.1f);
            bullet      = new Bullet(this, Tools.cm.Load <Texture2D>("masks/bulletM"),
                                     bulletSpeed, shootDrc, bulletTex, pos, null, color, 0, new Vector2(280, 140), bulletScale, effects, 0, pm);
            this.spriteActive           = true;
            Game1.Event_Update         += update;
            Background.Event_NextLevel += nextLevel;
        }