Пример #1
0
 public PaddleLogic(IPositionAdapter positionAdapter, PaddleData paddleData, PaddleInput paddleInput, PaddleSimulation paddleSimulation)
 {
     this.positionAdapter  = positionAdapter;
     this.paddleData       = paddleData;
     this.paddleInput      = paddleInput;
     this.paddleSimulation = paddleSimulation;
 }
Пример #2
0
        public PongGame()
        {
            //Setup the graphics device
            cGraphDevMgr = new GraphicsDeviceManager(this);
            cGraphDevMgr.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            cGraphDevMgr.PreferredBackBufferWidth  = 1024;
            cGraphDevMgr.PreferredBackBufferHeight = 768;
            cGraphDevMgr.ApplyChanges();

            //Setup monogame class variables
            IsMouseVisible = true;

            //Setup class specific variables
            cTextureDict  = new Dictionary <Textures, Texture2D>();
            cRandom       = new Random(DateTime.Now.Millisecond);
            cBoundaryBars = new GameObject[2];

            cLeftPaddleControl  = PaddleInput.Mouse;
            cRightPaddleControl = PaddleInput.Computer;

            cScoreLeft  = 0;
            cScoreRight = 0;

            cBallSpeedMag = BALL_MINSPEED;
        }
Пример #3
0
    void Awake()
    {
        bounceSfx = GetComponent <AudioSource>();

        paddleInput      = new PaddleInput(InputAxisName);
        paddleSimulation = new PaddleSimulation();
        paddleLogic      = new PaddleLogic(this, PaddleData, paddleInput, paddleSimulation);
    }
Пример #4
0
 private void LeftPaddleInputBtnCLick(object Sender, MouseButton ButtonDown, MouseState CurrMouse)
 {
     if (ButtonDown == MouseButton.Left)               //Cycle through the available control schemes
     {
         cLeftPaddleControl += 1;
         if (cLeftPaddleControl == PaddleInput.EndOfList)
         {
             cLeftPaddleControl = 0;
         }
     }
 }