public override void init() { Gamepad_Util.vibrate(0, 0.0f, 0.0f); Gamepad_Util.vibrate(1, 0.0f, 0.0f); Gamepad_Util.vibrate(2, 0.0f, 0.0f); Gamepad_Util.vibrate(3, 0.0f, 0.0f); graphicsDevice = Starburst.inst().GraphicsDevice; sprite_batch = new SpriteBatch(graphicsDevice); add_subsystems( new Menu_Input_Handler(), new Sound() ); font = Starburst.inst().get_content <SpriteFont>("sector034"); // hämta inputs från föregående state var inputs = last_state.get_entities_fast(typeof(Input)); for (int i = 0; i < inputs.Count; i++) { var input = inputs[i].get_component <Input>(); var gamepadPlayer = create_entity(Player.create_components(input)); } restore_vol = MediaPlayer.Volume; MediaPlayer.Volume *= 0.4f; }
public List <Entity> get_entities_fast(Type component_type) { if (top_state != null) { return(top_state.get_entities_fast(component_type)); } return(null); }