Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.Xna.Framework.Input;
- using Microsoft.Xna.Framework;
- using Cerios.Miner.Cameras;
- namespace Cerios.Miner.Entities
- {
- public class SPlayer : Player
- {
- private Camera camera;
- public SPlayer()
- {
- camera = new Camera(CeriosMiner.Instance.GraphicsDevice.Viewport);
- }
- public Camera GetCamera()
- {
- return camera;
- }
- public override void Update()
- {
- Vector2 position = camera.Position;
- if (Keyboard.GetState().IsKeyDown(Keys.A))
- {
- position.X += 1;
- }
- else if (Keyboard.GetState().IsKeyDown(Keys.D))
- {
- position.X -= 1;
- }
- if (Keyboard.GetState().IsKeyDown(Keys.W))
- {
- position.Y += 1;
- }
- else if (Keyboard.GetState().IsKeyDown(Keys.S))
- {
- position.Y -= 1;
- }
- camera.Position = position;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement