コード例 #1
0
ファイル: TurretBullet.cs プロジェクト: JdeHaan2001/TankGame
    public TurretBullet(Vec2 pPosition, Vec2 pVelocity, Turret pTurret) : base("assets/bulletGreen.png")
    {
        MyGame myGame = (MyGame)game;

        SetOrigin(width / 2, height / 2);
        _position = pPosition;
        _velocity = pVelocity;
        _tank     = myGame.GetTank();
    }
コード例 #2
0
    public Turret(int pRadius, Vec2 pPosition) : base(pRadius * 2 + 1, pRadius * 2 + 1)
    {
        MyGame myGame = (MyGame)game;

        SetOrigin(width / 2, height / 2);
        _radius   = pRadius;
        _position = pPosition;
        _tank     = myGame.GetTank();
        drawTurretBody(255, 255, 255);
        _turret = new TurretBarrel(x, y);
        AddChild(_turret);
    }