/// <summary> /// Called during initial app startup, this function performs all the /// permanent initialization. /// </summary> protected override void OneTimeSceneInitialization() { // Initialize the font's internal textures m_pFont.InitializeDeviceObjects(device); m_Engine.Initialize(this, device); CGameEngine.Inputs.MapKeyboardAction(Key.Escape, new ButtonAction(Terminate), true); CGameEngine.Inputs.MapKeyboardAction(Key.A, new ButtonAction(MoveCameraXM), false); CGameEngine.Inputs.MapKeyboardAction(Key.W, new ButtonAction(MoveCameraZP), false); CGameEngine.Inputs.MapKeyboardAction(Key.S, new ButtonAction(MoveCameraXP), false); CGameEngine.Inputs.MapKeyboardAction(Key.Z, new ButtonAction(MoveCameraZM), false); CGameEngine.Inputs.MapKeyboardAction(Key.P, new ButtonAction(ScreenCapture), true); CGameEngine.Inputs.MapMouseAxisAction(0, new AxisAction(PointCamera)); CGameEngine.Inputs.MapMouseAxisAction(1, new AxisAction(PitchCamera)); m_Console = new GameEngine.Console(m_pFont, @"..\..\Resources\console.jpg"); GameEngine.Console.AddCommand("QUIT", "Terminate the game", new CommandFunction(TerminateCommand)); GameEngine.Console.AddCommand("STATISTICS", "Toggle statistics display", new CommandFunction(ToggleStatistics)); m_OptionScreen = new OptionScreen(@"..\..\Resources\Options2.jpg"); m_OptionScreen.AddButton(328, 150, @"..\..\Resources\PlayOff.bmp", @"..\..\Resources\PlayOn.bmp", @"..\..\Resources\PlayHover.bmp", new ButtonFunction(Play)); m_OptionScreen.AddButton(328, 300, @"..\..\Resources\QuitOff.bmp", @"..\..\Resources\QuitOn.bmp", @"..\..\Resources\QuitHover.bmp", new ButtonFunction(Terminate)); m_Engine.SetOptionScreen(m_OptionScreen); music = new Jukebox(); music.AddSong("nadine.mp3"); music.AddSong("ComeOn.mp3"); music.AddSong("Rock.mp3"); music.Volume = 0.75f; music.Play(); }
// Update is called once per frame void Update() { if (gInstance == null) { gInstance = this; } }
private void RetrieveMediaInformation() { //Syntactic sugar, cause a MediaMetadata and a Mediaplayback event to be fired in the Publisher class. //(MusicController class) //Or in Catcher class, if its Kitkat. Jukebox.RetrieveMediaInformation(); }
/// <summary> /// Creates and aligns the jukebox sprite. /// </summary> private void CreateJukebox() => Jukebox = new Jukebox { Parent = Container, Alignment = Alignment.TopLeft, Y = Header.Y + Header.Height + 20 + 16, X = 25 };
public KinectRagdollGame() { Main = this; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = WIDTH; graphics.PreferredBackBufferHeight = HEIGHT; Content.RootDirectory = "Content"; FarseerTextures.Init(); FarseerTextures.SetGame(this); kinectManager = new KinectManager(); farseerManager = new FarseerManager(true, this); ragdollManager = new RagdollManager(); actionCenter = new ActionCenter(this); inputManager = new InputManager(this); //spriteHelper = new SpriteHelper(); objectiveManager = new ObjectiveManager(this); powerupManager = new PowerupManager(ragdollManager, farseerManager); jukebox = new Jukebox(); hazardManager = new HazardManager(farseerManager, ragdollManager); particleEffectManager = new ParticleEffectManager(graphics, ref farseerProjection); toolbox = new Toolbox(this); this.IsMouseVisible = true; bkColor = Color.CornflowerBlue; }
public void PickUp(Item item) { if (item == currItem) { return; } DropItem(); if (item == shovel) { (shovel as Shovel).TakeOut(); } Jukebox.Play("Pickup"); currItem = item; // REPARENT FX TO THIS currItem.fx.parent = fx.pose.rightHand; currItem.fx.localPosition = Vector3.zero; currItem.fx.localScale = Vector3.one; currItem.StopPhysics(); fx.Flash(Color.white); currItem.OnPickUp(); }
public override void LoadContent() { input = new Input(); dfp20 = ScreenManager.Content.Load <SpriteFont>("Font/dfp20"); donIdleSheet = ScreenManager.Content.Load <Texture2D>("Texture/Don/Anim/SongSelect/idle"); bgMask = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/bgMask"); timerBg = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/timer"); selectSongText = ScreenManager.Content.Load <Texture2D>("Texture/SongSelect/selectText"); menu = new Menu(ScreenManager.Content, ScreenManager.SpriteBatch); menu.LoadContent(); animator = new SpriteAnimator(ScreenManager.SpriteBatch); donIdle = new SpriteAnimation(donIdleSheet, new Vector2(291, 291), new Vector2(10, 3), 30, 1000f / ((30 * 116) / 60), true); animator.Add("idle", donIdle); animator.Switch("idle"); idleLoop = new WaveFileReader("Content/Music/SongSelect/idle.wav"); idleLoopStream = new LoopStream(idleLoop, 254437); music = new Jukebox(); music.Play(idleLoopStream); sfx = new Jukebox(); kat = ScreenManager.Content.Load <SoundEffect>("kat"); base.LoadContent(); }
new void Awake() { Cursor.visible = false; runner = GetComponent <Runner>(); data = GetComponent <DataManager> (); options = GetComponent <OptionsManager> (); state = GetComponent <StateManager> (); logger = GetComponent <Logger>(); sync = GetComponent <GameSync>(); network = GetComponent <WinnitronNetwork>(); logOutput = GetComponent <LogOutputHandler>(); VersionNumber = versionNumber; GM.logger.Info("##### VERSION " + versionNumber + " #####"); writeProcessInfo(); //Not 100% sure why the jukebox is here. :S if (GameObject.Find("Jukebox")) { jukebox = GameObject.Find("Jukebox").GetComponent <Jukebox>(); } //Do Windows window management shizzle ResetScreen(); }
void Awake() { inst = this; foreach(var src in transform.GetComponentsInChildren<AudioSource>()) { sources[src.name.ToLower()] = src; } }
// Use this for initialization void Start() { jukebox = GameObject.FindObjectOfType <Jukebox> (); scoreKeeper = GameObject.Find("Score").GetComponent <ScoreKeeper> (); shotCooldown = Random.Range(60, 240); currentHealth = maxHealth; }
// Use this for initialization void Start() { pans = FindObjectsOfType <CountingPanContents>(); eggTimerOriginalLocalAngle = eggTimerTop.transform.localEulerAngles; eggTimerOriginalQuaternion = eggTimerTop.rotation; //Debug.Log("Final Rot " + eggTimerFinalPos.transform.localRotation.eulerAngles.y); //Debug.Log("Start Rot " + eggTimerOriginalPos.localRotation.eulerAngles.y); //Debug.Log(eggTimerFinalPos.transform.localRotation.eulerAngles.y - eggTimerOriginalPos.localRotation.eulerAngles.y); // TODO: Find out why we are rotating around Z but the correct values seem to be stored in Y ... !!! rotationSpeed = (eggTimerFinalPos.transform.localRotation.eulerAngles.y - eggTimerOriginalLocalAngle.y) / countdown; windUpSpeed = (eggTimerFinalPos.transform.localRotation.eulerAngles.y - eggTimerOriginalLocalAngle.y) / windUpTime; roundLength = countdown; concierge = FindObjectOfType <Concierge>(); if (concierge == null) { Debug.LogError("Your restaurant does not have a Concierge!"); } audioSource = GetComponent <AudioSource>(); animator = GetComponent <Animator>(); jukebox = FindObjectOfType <Jukebox>(); eggTimerTop.transform.localEulerAngles = eggTimerFinalPos.transform.localEulerAngles; }
/// <summary> /// Creates and aligns the jukebox sprite. /// </summary> private void CreateJukebox() => Jukebox = new Jukebox { Parent = Container, Alignment = Alignment.TopRight, Y = Navbar.Line.Y + 20, X = -44 };
void Awake() { inst = this; foreach (var src in transform.GetComponentsInChildren <AudioSource>()) { sources[src.name.ToLower()] = src; } }
private void Start() { jq = FindObjectOfType <Jukebox>(); originalIntensity = light.intensity; invisIntensity = originalIntensity / 2; }
/// <summary> /// Loads the music categories and prepares to play them /// </summary> private Jukebox() { instance = this; categories = SimulationParameters.Instance.GetMusicCategories(); PauseMode = PauseModeEnum.Process; }
public Jukebox GetJukebox() { if (jukebox == null) { jukebox = new Jukebox(); } return(jukebox); }
public override void DoPickupAction(RagdollMuscle ragdoll) { ApplyPowerup(ragdoll); if (Song != null) { Jukebox.Play(Song); } }
public override void Init() { spriteRenderer.sprite = frames[0]; frame = 0; time = 0f; if (sfx.Length > 0) { Jukebox.Play(sfx); } }
void Start() { //ShowText("Move with Left stick/WASD. Dash with A/X/Spacebar. Hide by standing still. Take down enemies after hiding or dashing with B/O/E."); jq = FindObjectOfType <Jukebox>(); cs = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasStore>(); textBg = cs.textBg; txt = cs.txt; dashImg = cs.dashImg; HideText(); }
void DoKillscreen() { Jukebox.Play("MetalRiff" + Random.Range(0, 3)); DropItem(); StartCoroutine(DoSlowDownTime()); input.Halt(); Jukebox.Play("Kill"); Music.KillMusic(); Dup(killScreenPrefab); }
public static Jukebox instance; //Singleton private void Awake() { if (instance == null) { instance = this; } audi = GetComponent <AudioSource>(); audi.clip = charSelect; audi.Play(); }
private void Awake() { if(instance == null){ instance = this; footstepsRandomList = new List<AudioClip>(); } else{ GameObject.Destroy(this); } }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="gameTime"></param> public override void Update(GameTime gameTime) { Container?.Update(gameTime); Jukebox.Update(gameTime); if (DialogManager.Dialogs.Count != 0) { Searchbox.Focused = false; } }
void UpdateWaiting() { if (initialWait) { if (!FindObject <Title>()) { initialWait = false; } else { return; } } if (Cam.inst.tracking < 0.999f || Cam.inst.trackingPatch == null) { return; } // respawn respawnTime = Time.time; Jukebox.Play("truck_respawn"); Jukebox.Play("cheer"); status = Status.Active; fx.gameObject.SetActive(true); shadow.gameObject.SetActive(true); cone.gameObject.SetActive(true); var spawnPos = Cam.inst.p - Cam.inst.offset; spawnPos.y += 8f; spawnPos.x = 0.5f * (Cam.inst.trackingPatch.x0 + Cam.inst.trackingPatch.x1) - 0.001f; body.position = spawnPos; body.rotation = Quaternion.identity; speed = maxSpeed; velocity = Vec(0, 0, speed); rotationSpeed = 0f; rotation = 0f; pitch = 0f; grounded = false; patch = null; leaveGroundTime = -999f; hitGroundTime = -999f; scaleY = 1f; coneSpeed = 0f; coneY = coneAnchor.position.y; cone.position = coneAnchor.position; explosionTime = -999f; }
void OnCollisionEnter(Collision collision) { if (collision.collider.IsTile()) { if (playOnce) { Jukebox.Play("GrenadeBounce"); playOnce = false; } } }
public void Jukebox_Should_Throw_PlayAllSongsByArtist_If_No_CD() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.PlaySongsByArtist(new Artist(1, string.Empty)); //assert act.ShouldThrow <InvalidOperationException>(); }
public void Jukebox_Should_Throw_PlayAllSongsByArtist_If_Null() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.PlaySongsByArtist(null); //assert act.ShouldThrow <ArgumentNullException>(); }
public void Jukebox_Should_Throw_PlaySong_If_Song_Cost_Negative() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.PlaySong(new Song(1, String.Empty, -1, null)); //assert act.ShouldThrow <ArgumentOutOfRangeException>(); }
public void Jukebox_Should_Throw_PlayAllSongs_If_No_CD() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.PlayAllSongs(); //assert act.ShouldThrow <InvalidOperationException>(); }
public void Jukebox_Should_InsertCD_If_Null() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.InsertCD(null); //assert act.ShouldThrow <ArgumentNullException>(); }
public void Jukebox_Should_Increase_Balance() { //arrange var jukebox = new Jukebox(); //act jukebox.IncreaseBalance(new Coin(2)); //assert jukebox.Balance.ShouldBeEquivalentTo(2); }
public void another_example_of_some_client_code_that_uses_our_jukebox_model() { var playlist = new List<string> { "barry-white.m4a", "blahblah.mp3" }; var player = new HighQualityMusicPlayer(new StandardMusicPlayer()); var systemUnderTest = new Jukebox(playlist, player); systemUnderTest.PlayTracks(); Assert.Pass("All tracks played"); }
public void Jukebox_Should_Throw_IncreaseBalance_If_Cost_Negative() { //arrange var jukebox = new Jukebox(); //act Action act = () => jukebox.IncreaseBalance(new Coin(-1)); //assert act.ShouldThrow <ArgumentOutOfRangeException>(); }
public void PlayUserSelection(int userId) { var playlist = PlaylistRepository.GetById(userId); var player = PlayerFactory.Create(playlist); var jukebox = new Jukebox(playlist, player); jukebox.PlayTracks(); Assert.Pass("All tracks played"); }
// Use this for initialization void Awake() { if (me == null) { me = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad (gameObject); Play(); }
private Jukebox EnsureJukebox(string id) { Jukebox jukebox; if (jukeboxes.ContainsKey(id)) { jukebox = jukeboxes[id]; } else { jukebox = new Jukebox(id); jukeboxes.Add(id, jukebox); } return (jukebox); }
public PlayerInformation() { NakedArmorInventory = new Inventory(); MainInventory = new Inventory(); ArmoryInventory = new Inventory(); jukeBox = new Jukebox(); playerShopInventory = new Inventory(); Equip = new Equipment(); questLog = new QuestLog(); profile = new PlayerProfile(); playerData = new ParseObject("PlayerData"); parseObjectID = " "; PlayerName = " "; }
public void Init(string clipName, Vector3 position, Jukebox jukebox, float delay) { this.jukebox = jukebox; AudioClip clipToPlay = null; foreach (AudioInfo ai in jukebox.audioList){ if(ai.id.Equals(clipName)){ clipToPlay = ai.clip; break; } } audio.clip = clipToPlay; StartCoroutine(PlaySound(delay)); }
public void SetJukebox(Jukebox juke) { jukebox = juke; }
void OnDestroy() { if (inst == this) { inst = null; } }
void Awake() { if (GameObject.Find("Jukebox")) jukebox = GameObject.Find("Jukebox").GetComponent<Jukebox>(); }