static void Main(string[] args) { RenderEngine.SetScreenSize(20); Board board = new Board(); Player playerOne = new Player(); Player playerTwo = new Player(); WinLose winlose = new WinLose(); LoopController loopController = new LoopController(); KeyHandler keyHandler = new KeyHandler(); while (winlose.Check(board)) { // Clear the screen Console.Clear(); // Render the screen //RenderEngine.FillScreen(); RenderEngine.Draw(); // Get player Input keyHandler.Input(); keyHandler.Update(board); // Slow GameLoop loopController.Wait(10); } }
public static void UnsubscribeFromLoop(this ILooper iLooper) { LoopController loop = getLoop(); if (loop == null) { return; } loop.Unsubscribe(iLooper); }
public static void SubscribeToLoop(this ILooper iLooper) { LoopController loop = getLoop(); if (loop == null) { Debug.LogError("Could not find LoopController to subscribe to!"); return; } loop.Subscribe(iLooper); }
private static LoopController getLoop() { if (loop == null) { GameObject gb = GameObject.FindGameObjectWithTag("GameController"); if (gb == null) { return(null); } loop = gb.GetComponent <LoopController>(); } return(loop); }
public static void Accept(PlayerController player, GameObject npc) { //Chest chest = Chest.Spawn(GameManager.Instance.RewardManager.Rainbow_Chest, npc. + Vector2.down, npc.sprite.WorldCenter.GetAbsoluteRoom(), true); npc.GetComponent <tk2dSpriteAnimator>().PlayForDuration("doEffect", -2f, "idle", false); // string header = "LEVEL 1"; // string text = "MAY THE GUN GODZ BE WITH YOU"; // Notify(header, text); HandleStats(player); NuclearShrine.HandleLoadout(player); //LootEngine.SpawnItem(ETGMod.Databases.Items["Nuclear Talisman"].gameObject, new Vector3(189.8f, 18.3f, 18.9f), Vector2.zero, 1f, false, true, false); NuclearShrine.storedPlayer = player; LoopController loopController = new LoopController(); loopController.victem = player; loopController.Init(); }
// Use this for initialization void Start() { m_settings = Settings.Instance; m_locationBar = Component.FindObjectOfType <LocationBar>().transform; m_lastComeLastServe = Component.FindObjectOfType <LastComeLastServe>(); m_tokenposition = TokenPosition.Instance; serialBaudrate = m_settings.serialBaudrate; serialPortNames = m_settings.serialPortNames; tunesPerString = m_settings.tunesPerString; enableChords = m_lastComeLastServe.enableChords; oldTactPos = -1; // Get loop controllers var x = Component.FindObjectsOfType <LoopController>(); startController = x[0].startMarker ? x[0] : x[1]; endController = x[0].startMarker ? x[1] : x[0]; Boolean serialConnected = false; for (int i = 0; i < serialPortNames.Length && !serialConnected; i++) { try { Debug.Log("Trying to open serial connection on port: " + serialPortNames[i]); serialPort = new SerialPort(serialPortNames[i], serialBaudrate); serialPort.WriteTimeout = 100; // ms serialPort.Open(); Debug.Log("Opened serial connection on port: " + serialPortNames[i]); serialConnected = true; } catch (IOException) { Debug.Log("Failed to open serial connection on port: " + serialPortNames[i]); } } if (!serialConnected) { Debug.LogWarning("No serial connection established, no music will be played"); } }
public void Awake() { Transform UITrans = GameObject.FindGameObjectWithTag("UI").transform; loopSlider = UITrans.Find("LoopSlider").GetComponent <Slider>(); chargeSlider = UITrans.Find("BreakMeter").GetComponent <Slider>(); shiftButton = UITrans.Find("ButtonShift"); loopSlider.gameObject.SetActive(this.isActiveAndEnabled); chargeSlider.gameObject.SetActive(this.isActiveAndEnabled); shiftButton.gameObject.SetActive(this.isActiveAndEnabled); spriteRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); loop = GameObject.FindGameObjectWithTag("GameController").GetComponent <LoopController>(); breakMeter = GameObject.FindGameObjectWithTag("UI").transform.Find("BreakMeter").GetComponent <Slider>(); cam = GameObject.FindGameObjectWithTag("MainCamera").transform.parent.GetComponent <CameraBehavior>(); musicController = loop.GetComponent <MusicController>(); soundController = loop.GetComponent <SoundController>(); camShake = cam.transform.Find("Main Camera").GetComponent <CamShake>(); plc = GetComponent <PlayerLifeController>(); }
/** * Set the sampler controller. * * @param c * the sampler controller. */ public void SetSamplerController(LoopController c) { c.SetContinueForever(false); SetProperty(new TestElementProperty(MAIN_CONTROLLER, c)); }
/** * Set the sampler controller. * * @param c * the sampler controller. */ public void SetSamplerController(LoopController c) { c.SetContinueForever(false); SetProperty(new TestElementProperty(MAIN_CONTROLLER, c)); }