예제 #1
0
        public void KeyboardUpdate(KeyboardStateEventArgs args)
        {
            KeyboardState st = args.keyState;

            if (st.IsKeyDown(Keys.Left))
            {
                this.xSpeed = -5;
            }
            else if (st.IsKeyDown(Keys.Right))
            {
                this.xSpeed = 5;
            }
            else
            {
                this.xSpeed = 0;
            }

            if (st.IsKeyDown(Keys.Up))
            {
                if (this.ground)
                {
                    this.ySpeed = -24;
                    this.ground = false;
                }
            }
            else if (st.IsKeyDown(Keys.Down))
            {
                this.ySpeed = 5;
            }
        }
예제 #2
0
파일: Jump.cs 프로젝트: tekktonic/Apphack6
 protected virtual void OnKeyboard(KeyboardStateEventArgs args)
 {
     if (KeyboardEvent != null)
         KeyboardEvent (args);
 }