public void SwitchState(FlxState newscreen) { FlxG.unfollow(); FlxG.keys.reset(); FlxG.gamepads.reset(); FlxG.mouse.reset(); FlxG.flash.stop(); FlxG.fade.stop(); FlxG.quake.stop(); if (_state != null) { _state.Destroy(); } _state = newscreen; _state.Create(); }