コード例 #1
0
ファイル: MascotActor.cs プロジェクト: splitandthechro/nginz
 public void Action(GameTime time, KeyboardBuffer keyboard, MouseBuffer mouse)
 {
     if (keyboard.IsKeyDown (Key.W))
         Position.Y -= 1;
     if (keyboard.IsKeyDown (Key.S))
         Position.Y += 1;
     if (keyboard.IsKeyDown (Key.A))
         Position.X -= 1;
     if (keyboard.IsKeyDown (Key.D))
         Position.X += 1;
 }
コード例 #2
0
ファイル: FPSCamera.cs プロジェクト: parhelia512/nginz
        /// <summary>
        /// Initializes a new instance of the <see cref="nginz.FPSCamera"/> class.
        /// </summary>
        /// <param name="fieldOfView">Field of view.</param>
        /// <param name="resolution">Resolution.</param>
        /// <param name="mouse">Mouse.</param>
        /// <param name="keyboard">Keyboard.</param>
        public FPSCamera(float fieldOfView, Resolution resolution, MouseBuffer mouse, KeyboardBuffer keyboard)
        {
            // Create the base camera
            Camera = new Camera(fieldOfView, resolution, 0.01f, 256f);

            // Set the mouse and the keyboard
            Mouse    = mouse;
            Keyboard = keyboard;

            // Initialize the mouse sensitivity
            MouseXSensitivity = .1f;
            MouseYSensitivity = .1f;

            // Initialize the actor speed
            Speed = 5f;
        }
コード例 #3
0
ファイル: FPSCamera.cs プロジェクト: splitandthechro/nginz
        /// <summary>
        /// Initializes a new instance of the <see cref="nginz.FPSCamera"/> class.
        /// </summary>
        /// <param name="fieldOfView">Field of view.</param>
        /// <param name="resolution">Resolution.</param>
        /// <param name="mouse">Mouse.</param>
        /// <param name="keyboard">Keyboard.</param>
        public FPSCamera(float fieldOfView, Resolution resolution, MouseBuffer mouse, KeyboardBuffer keyboard)
        {
            // Create the base camera
            Camera = new Camera (fieldOfView, resolution, 0.01f, 256f);

            // Set the mouse and the keyboard
            Mouse = mouse;
            Keyboard = keyboard;

            // Initialize the mouse sensitivity
            MouseXSensitivity = .1f;
            MouseYSensitivity = .1f;

            // Initialize the actor speed
            Speed = 5f;
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: parhelia512/nginz
        /// <summary>
        /// Initializes a new instance of the <see cref="nginz.Game"/> class.
        /// </summary>
        /// <param name="conf">Conf.</param>
        public Game(GameConfiguration conf)
        {
            // Set the configuration
            Configuration = conf;

            // Initialize the keyboard buffer
            Keyboard = new KeyboardBuffer();

            // Initialize the actions
            ContextActions = new ConcurrentQueue <Action> ();
            UIActions      = new ConcurrentQueue <Action> ();

            // Initialize scripting enviroment
            IsRunningInScriptedEnvironment = false;

            // Set UI controller
            UI = UIController.Instance;
        }
コード例 #5
0
ファイル: Game.cs プロジェクト: splitandthechro/nginz
        /// <summary>
        /// Initializes a new instance of the <see cref="nginz.Game"/> class.
        /// </summary>
        /// <param name="conf">Conf.</param>
        public Game(GameConfiguration conf)
        {
            // Set the configuration
            Configuration = conf;

            // Initialize the keyboard buffer
            Keyboard = new KeyboardBuffer ();

            // Initialize the actions
            ContextActions = new ConcurrentQueue<Action> ();
            UIActions = new ConcurrentQueue<Action> ();

            // Initialize scripting enviroment
            IsRunningInScriptedEnvironment = false;

            // Set UI controller
            UI = UIController.Instance;
        }