Пример #1
0
        public Block()
        {
            type = ChooseTypeBlock();
            if (type == Type.Black)
            {
                sprite = ContentPipe.LoadTexture("klocek1.png");
            }
            else if (type == Type.Silver)
            {
                sprite = ContentPipe.LoadTexture("klocek2.png");
            }


            if (Count == 0)
            {
                Position       = startPosition;
                prevPosition   = Position;
                platformIsBusy = true;
                direction      = Direction.X0;
            }
            else
            {
                //ustawianie bloczków w podajniku
                Position     = new Vector2(prevPosition.X, (prevPosition.Y - sprite.Height - 1));
                prevPosition = Position;
                direction    = Direction.Y1;
            }
            newPosition = Position;

            velocity = Vector2.Zero;
            size     = new Vector2(40, 40);

            Count++;
        }
Пример #2
0
        public CustomButton(Vector2 pos, RectangleF size)
        {
            position  = pos;
            this.size = size;

            texButton = ContentPipe.LoadTexture("button.png");
        }
Пример #3
0
 public Sensor(Vector2 pos, RectangleF size, string name)
 {
     position          = pos;
     this.size         = size;
     sensorOnSprite    = ContentPipe.LoadTexture("sensorOn.png");
     sensorOffSprite   = ContentPipe.LoadTexture("sensorOff.png");
     actualStateSensor = sensorOffSprite;
     Name = name;
 }
Пример #4
0
        public Piston()
        {
            Position    = startPosition;
            newPosition = Position;
            direction   = Direction.A0;
            velocity    = Vector2.Zero;

            size         = new Vector2(40, 40);
            playerSprite = ContentPipe.LoadTexture("piston.png");
        }
Пример #5
0
        public Player()
        {
            Position    = startPosition;
            newPosition = Position;
            direction   = Direction.A0;
            velocity    = Vector2.Zero;

            size           = new Vector2(40, 40);
            spriteForOpen  = ContentPipe.LoadTexture("chwytak4.png");
            spriteForClose = ContentPipe.LoadTexture("chwytak5.png");
            sprite         = spriteForOpen;
        }
Пример #6
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     button1 = new CustomButton(new Vector2(818, 440), new RectangleF(0, 0, 64, 36));
     //texture2 = ContentPipe.LoadTexture("Process.png");
     texture2 = ContentPipe.LoadTexture("procesik2.png");
     player   = new Player();
     for (int i = 0; i < 6; i++)
     {
         blocks.Add(new Block());
     }
     piston   = new Piston();
     gripper  = new Gripper();
     conveyor = new Conveyor();
     InitializeSensors();
     conveyor = new Conveyor();
     ControlMode.Init();
 }