Пример #1
0
 public Button(int column, int row)
     : base(column, row)
 {
     LinkedDoors = new List<SwitchableObject>();
     animmodel = new GameAnimatedModel("Button", column, row, this);
     base.isCollidable = true;
     base.IsPassable = true;
     HitboxHeightOffset = 17;
     Translate(Position.X, Position.Y - GameConstants.SINGLE_CELL_SIZE/2 + 1, Position.Z); //Matt: this is for offsetting the model position so it's flat on the floor
 }
Пример #2
0
        public Character(int startRow, int startCol)
            : base(startRow, startCol)
        {
            Scale(0.06f, 0.06f, 0.06f);
            Rotate(0, 90f, 0);

            // create model with offset of position
            charModel = new GameAnimatedModel("SciTry", startRow, startCol, this);
            charModel.VerticalOffset = 22;
            health = GameConstants.HEALTH;
        }
Пример #3
0
        public Enemy(int column, int row, RenderContext rendeerContext)
            : base(column, row)
        {
            texture = new Texture2D(rendeerContext.GraphicsDevice, 1, 1);
            texture.SetData(new Color[] { Color.Gray });

            animmodel = new GameAnimatedModel("Doomba", column, row, this);
            animmodel.PlayAnimation("Move", true, 0f);

            isCollidable = false;

            wallsToCheck = new List<GameObject3D>();
            Scale(40f, 40f, 40f); // 48,48,48
            Position = new Vector3(Position.X, Position.Y - 18, Position.Z);  // position.y - 18
        }
Пример #4
0
        public BoxDropper(int column, int row, int numberOfBoxes)
            : base(column, row)
        {
            this.row = row;
            this.column = column;
            this.ReservedBoxes = 0;
            base.Model = GameplayScreen._models["BlockDropper"];

            //Set up animations
            animmodel[0] = new GameAnimatedModel("BoxDropperAnimated", column, row, this);
            animmodel[1] = new GameAnimatedModel("BoxDropperEmptyAnimated", column, row, this);
            animmodel[0].SetAnimationSpeed(1.2f);
            animmodel[1].SetAnimationSpeed(1.2f);

            Scale(10f, 10f, 10f);
            NumberOfBoxes = numberOfBoxes;
            isCollidable = true;
            IsPassable = false;
        }
Пример #5
0
        public ToggleSwitch(int column, int row, Boolean infinitelytoggleable)
            : base(column, row)
        {
            LinkedDoors = new List<SwitchableObject>();
            base.isCollidable = true;
            base.IsPassable = true;
            RemainingToggles = 1; //Default; # times is not set in the constructor, but is done as a modification of the object after creation in the LevelBuilder
            InfinitelyToggleable = infinitelytoggleable;
            Translate(Position.X, Position.Y - GameConstants.SINGLE_CELL_SIZE / 2, Position.Z); //Matt: this is for offsetting the model position so it's flat on the floor

            //Load both green (full) and red (empty) models
            animmodel[0] = new GameAnimatedModel("LeverFull", column, row, this);
            animmodel[1] = new GameAnimatedModel("LeverEmpty", column, row, this);

            Translate(Position.X, Position.Y + GameConstants.SINGLE_CELL_SIZE/2, Position.Z - GameConstants.SINGLE_CELL_SIZE/2);
            Scale(72f, 72f, 48f);

            // Matt- Steven's code for auto-calculating hitbox not working for this, so I've hardcoded it here.
               // HitboxHeight = HitboxWidth = GameConstants.SINGLE_CELL_SIZE;
        }