public void HandleCameraMovement() { if (WindowLayer.GetKey(ctx, 'I')) { camera2D.position += vec2.UnitY * CAMERA_SPEED * deltaTime; } if (WindowLayer.GetKey(ctx, 'K')) { camera2D.position += -vec2.UnitY * CAMERA_SPEED * deltaTime; } if (WindowLayer.GetKey(ctx, 'J')) { camera2D.position += -vec2.UnitX * CAMERA_SPEED * deltaTime; } if (WindowLayer.GetKey(ctx, 'L')) { camera2D.position += vec2.UnitX * CAMERA_SPEED * deltaTime; } }
// -- public void HandleQuadMovement() { if (WindowLayer.GetKeyDown(ctx, 'W') && Math.Abs(quad.body.GetVelocity().y) <= 0.01f) { quad.body.ApplyImpulse(IMPULSE_POWER); } if (WindowLayer.GetKey(ctx, 'A')) { quad.Move(-vec2.UnitX * deltaTime); } if (WindowLayer.GetKey(ctx, 'D')) { quad.Move(vec2.UnitX * deltaTime); } if (WindowLayer.GetKey(ctx, 'Q')) { quad.Rotate(deltaTime * (float)Math.PI); } if (WindowLayer.GetKey(ctx, 'E')) { quad.Rotate(-deltaTime * (float)Math.PI); } }