예제 #1
0
        public static vec2 KeyboardDir(Keys Left = Keys.Left, Keys Right = Keys.Right, Keys Up = Keys.Up, Keys Down = Keys.Down)
        {
            vec2 dir = vec2.Zero;

            if (Up.Down())    dir.y =  1;
            if (Down.Down()) dir.y = -1;
            if (Right.Down()) dir.x = 1;
            if (Left.Down()) dir.x = -1;

            return dir;
        }