Example #1
0
        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
                {

                }
            }
        }
Example #2
0
 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();
     }
 }
Example #3
0
        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();
            }

        }
Example #4
0
 public SceneManager()
 {
     _scene = null;
 }
Example #5
0
 public void StepEnd(IScene scene, float stepSize)
 {
 }
Example #6
0
 public void StepBegin(IScene scene, float stepSize)
 {
 }
Example #7
0
 public void StepEnd(IScene scene, float stepSize)
 {
     if (Camera != null)
     {
         Transform2 transform = Camera.WorldTransform;
         transform.Position = Actor.GetTransform().Position;
         Camera.WorldTransform = transform;
     }
 }