コード例 #1
0
 public ButtonPedestalEntity(string texture, string jumpAnimation, string walkAnimation, Vector2 position, int lives, float size, string job,
                             SquareObject.Damage dmg, SquareObject.Bounce bnce, float speed, byte friction, string OppositeDir, bool staticTexture, int id,
                             byte startCheckpoint, byte endCheckpoint, Color?colour = null, int startDelay = 0)
     : base(texture, jumpAnimation, walkAnimation, position, lives, size, job, dmg, bnce, speed, friction, OppositeDir, staticTexture, id,
            startCheckpoint, endCheckpoint, colour, startDelay)
 {
     isButtonPressed  = false;
     wasButtonPressed = false;
 }
コード例 #2
0
ファイル: Entity.cs プロジェクト: EoinF/CupOfEthanol
        public Entity(string texture, string jumpAnimation, string walkAnimation, Vector2 position, int lives, float size,
                      string job, SquareObject.Damage dmg, SquareObject.Bounce bnce, float speed, int friction, string OppositeDir,
                      bool staticTexture, int id, byte startCheckpoint, byte endCheckpoint, Color?colour = null, int startDelay = 0)
        {
            if (colour == null)
            {
                colour = Color.White;
            }
            if (job == "Lazer")
            {
                Sounds.Play("lazer", position);
            }
            StartPoint = position;
            _lives     = lives;
            Job        = job;
            sqobject   = new SquareObject(texture, position, dmg, bnce, 0.9f, size, friction, (Color)colour);
            Speed      = speed;
            _walkAnim  = walkAnimation;
            _jumpAnim  = jumpAnimation;
            if (OppositeDir == "t")
            {
                this.sqobject.Flipeffect = SpriteEffects.FlipHorizontally;
            }
            this.StaticTexture = staticTexture;
            this.ID            = id;
            Active             = true;

            DeathTimer         = -1;
            StartDelay         = startDelay;
            PreviousStartDelay = startDelay;
            JumpTimeout        = -1;
            MaxID        = 1;
            VariableA    = 0f;
            VariableB    = 0f;
            VariableC    = 0f;
            VariableD    = 0f;
            VariableE    = -1;
            VariableF    = 0;
            OnGround     = false;
            Walking      = false;
            timer        = -1;
            currentFrame = 0;

            SaveStatus();
            OriginalColour     = sqobject.Colour;
            OriginalFlipEffect = this.sqobject.Flipeffect;

            StartCheckpoint = startCheckpoint;
            EndCheckpoint   = endCheckpoint;

            TopEdgePlus = new Rectangle(this.sqobject.TopEdge.X, this.sqobject.TopEdge.Y - 20, this.sqobject.TopEdge.Width, this.sqobject.TopEdge.Height + 20);
        }