public void StepBegin(IScene scene, float stepSize) { if (Controller.Input != null) { if (FollowPlayer) { if (KeyLeftDown() != KeyRightDown()) { if (KeyLeftDown()) { Actor.ApplyForce(new Vector2(-10, 0)); } else { Actor.ApplyForce(new Vector2(10, 0)); } } if (Camera != null) { Camera.ViewOffset = CameraExt.ScreenToClip(Camera, Controller.Input.MousePos, Vector2Ext.ToOtk(Controller.CanvasSize)) * 0.8f; } } else { } } }
public void StepBegin(IScene scene, float stepSize) { if (Tank != null) { //Camera.ViewOffset = CameraExt.ScreenToClip(Camera, Controller.InputExt.MousePos, Vector2Ext.ToOtk(Controller.CanvasSize)) * 0.4f; Transform2 t = new Transform2(Tank.WorldTransform.Position, Camera.WorldTransform.Size, Camera.WorldTransform.Rotation, Camera.WorldTransform.MirrorX); Camera.WorldTransform = t; } else { Camera.ViewOffset = new OpenTK.Vector2(); } }
public void ChangeScene(IScene scene) { if (_scene == null) { _scene = scene; _scene.Initial(); _scene.Load(); } else { _scene.UnLoad(); _scene.Exit(); _scene = scene; _scene.Initial(); _scene.Load(); } }
public SceneManager() { _scene = null; }
public void StepEnd(IScene scene, float stepSize) { }
public void StepBegin(IScene scene, float stepSize) { }
public void StepEnd(IScene scene, float stepSize) { if (Camera != null) { Transform2 transform = Camera.WorldTransform; transform.Position = Actor.GetTransform().Position; Camera.WorldTransform = transform; } }