Example #1
0
    public Block(ArkanoidLevelScreen _levelInst, TiledObject _obj) : base("ArkanoidSprites/Breakout-006-A.png", 5, 5)
    {
        SetXY(_obj.X, _obj.Y);
        _blockHealth = _obj.GetIntProperty("health");

        _level = _levelInst;

        _canBlockBeDestroyed = _obj.GetBoolProperty("canBeDestroyed");
        SetFrame(_obj.GetIntProperty("type"));

        _destroyableBlockSound = new Sound("ArkanoidSounds/BallHitBox.mp3");
    }
Example #2
0
    // Constructor that needs an instance of type Block, a TiledObject instance and a Level instance.
    // Again this is used so I can call certain methods from those classes and get property information of Ball from Tiled.
    public Ball(TiledObject _obj, PlayerArkanoid _playerInst) : base("ArkanoidSprites/ball.png", addCollider: true)
    {
        // Scales the sprite of Ball to 25% of its original width and height.
        this.scale = 0.25f;

        // Sets the X and Y pos of ball to X and Y values defined in Tiled.
        xPos = _obj.X;
        yPos = _obj.Y;
        SetXY(xPos, yPos);


        _moveSpeedX = 0;
        _moveSpeedY = 0;

        _ballSpeedX = -_obj.GetIntProperty("speedX");
        _ballSpeedY = -_obj.GetIntProperty("speedY");

        _player = _playerInst;
    }
Example #3
0
    public PlayerArkanoid(TiledObject _obj, ArkanoidLevelScreen _levelInst, MainGame tempGame) : base("ArkanoidSprites/paddle.png")
    {
        this.scale = 0.2f;
        SetXY(_obj.X, _obj.Y);
        _moveSpeedPlayer = 12;

        _lives = _obj.GetIntProperty("lives");

        score = 0;

        _level = _levelInst;

        _playerHitSound = new Sound("ArkanoidSounds/BallHitPaddle.mp3");

        _game = tempGame;
        _game.ticketsReceived = 0;
    }