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; }
//end steve void Start() { _PowerupManager = GameObject.FindObjectOfType <PowerupManager> (); _AIWaveManager = this.GetComponent <AIWaveManager>(); StageSpawn(); }
//Singleton setup, Delegate and powerup setup //as well as acquiring the player stats script private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } OnPickupCollected += ApplyEffect; OnPickupCollected += AddPowerupTime; OnPickupExpired += RemoveEffect; RegisterPowerup(Pickup.PICKUP_TYPE.fast); RegisterPowerup(Pickup.PICKUP_TYPE.slow); RegisterPowerup(Pickup.PICKUP_TYPE.platform); playerStats = GameManager.instance.player.GetComponent <PlayerStats>(); DontDestroyOnLoad(gameObject); }
void Start() { facingRight = true; rigidBody = GetComponent <Rigidbody2D>(); //myCollider = GetComponent<Collider2D>(); myAnimator = GetComponent <Animator>(); jumpTimeCounter = jumpTime; speedMilestoneCount = speedIncreaseMilestone; moveSpeedStore = speed; speedMilestoneCountStore = speedMilestoneCount; speedIncreaseMilestoneStore = speedIncreaseMilestone; stoppedJumping = true; footEmission = footsteps.emission; powerup1Emission = powerup1.emission; powerup2Emission = powerup2.emission; thePowerupManager = FindObjectOfType <PowerupManager>(); mace = GameObject.Find("Mace").GetComponent <Collider2D>(); restarted = false; }
public void ApplyTo(PowerupManager car) { if (attached) { return; } attached = true; PowerupAttachable pAttachable = GetComponent <PowerupAttachable>(); PowerupEvent pEvent = GetComponent <PowerupEvent>(); PowerupBoost pBoost = GetComponent <PowerupBoost>(); PowerupStats pStats = GetComponent <PowerupStats>(); if (pAttachable != null) { appliedManager = car.Attach(pAttachable, pAttachable.attachType); } else if (pEvent != null) { appliedManager = car.AddEvent(pEvent); } else if (pBoost != null) { appliedManager = car.ApplyBoost(pBoost); } }
//public Text BallsRemText; // Use this for initialization void Start() { m_curBallsRem = m_startingBallsRem; m_curScore = 0; m_multiplyer = 1; m_PowerMan = GetComponent <PowerupManager>(); }
void Start() { activeShield = false; shield.SetActive(false); powerupManager = FindObjectOfType <PowerupManager>(); playerHealth = FindObjectOfType <HealthPlayer>(); }
// Use this for initialization void Start() { myRigidbody = GetComponent <Rigidbody2D> (); //myCollider = GetComponent<Collider2D> (); myAnimator = GetComponent <Animator> (); if (GameController.getVelocity() != 0) { moveSpeed = GameController.getVelocity(); } if (GameController.getNextMilestone() != 0) { speedupMilestone = GameController.getNextMilestone(); } if (GameController.getNextMilestone() != 0) { backgroundSound.time = GameController.getBgSoundTime(); } jumpTimeCounter = jumpTime; speedMilestoneCount = speedupMilestone; moveSpeedStore = moveSpeed; speedMilestoneCountStore = speedMilestoneCount; speedupMilestoneStore = speedupMilestone; stoppedJumping = true; theEnergyManager = FindObjectOfType <EnergyManager> (); thePowerupManager = FindObjectOfType <PowerupManager> (); theScoremanager = FindObjectOfType <ScoreManager> (); }
public void Init(PowerupManager.types type) { if(Data.Instance.musicManager.volume==1) Events.OnMusicVolumeChanged(0.2f); anim = GetComponent<Animator>(); anim.updateMode = AnimatorUpdateMode.UnscaledTime; Invoke("onComplete", 0.1f); anim.Play("powerupSign", 0, 0); switch (type) { case PowerupManager.types.CHUMBO: title.text = "MEGA-CHUMBO"; desc.text = "TREMENDO CHUMBO + 1 AGUANTE"; break; case PowerupManager.types.GIL: title.text = "GIL-POWA"; desc.text = "PODER DE EXTRA PUNGUEO + 1 AGUANTE"; break; case PowerupManager.types.MOTO: title.text = "RATI-CICLO"; desc.text = "APLASTA COBANIS Y CIVILES + 1 AGUANTE"; break; } Time.timeScale = 0.05f; }
// Use this for initialization void Start() { if (PlayerPrefs.HasKey("deathCount")) { storedDeathCount = PlayerPrefs.GetInt("deathCount"); } platformStartPoint = platformGenerator.position; playerStartPoint = thePlayer.transform.position; backgroundStartPoint = theBackgroundGenerator.transform.position; theDayNightController = FindObjectOfType <DayNightController> (); theAdManager = FindObjectOfType <AdManager> (); theParallaxController = FindObjectOfType <Parallax> (); theScoreManager = FindObjectOfType <ScoreManager> (); thePowerupController = FindObjectOfType <PowerupManager> (); firstMovingBackgroundStartPoint = theParallaxController.backgrounds[0].transform.localPosition; if (!PlayerPrefs.HasKey("InstructionShown")) { theGameInstructionsScreen.SetActive(true); PlayerPrefs.SetString("InstructionShown", "true"); Time.timeScale = 0f; } }
void Start() { PwUpManager = FindObjectOfType <PowerupManager>(); //MagnetOn = false; sound = GetComponent <AudioSource>(); }
void Start() { sRender = GetComponent <SpriteRenderer>(); pwupManager = FindObjectOfType <PowerupManager>(); //sRender.material.SetColor("_Color", Color.black); // the bottom color //sRender.material.SetColor("_Color2", Color.white); }
public void Construct(Ball ball, ScoreManager scoreManager, BallTimer ballTimer, PowerupManager pwManager) { this.ball = ball; this.scoreManager = scoreManager; this.ballTimer = ballTimer; this.pwManager = pwManager; }
public void SetSliders() { float damage = 0f; PowerupManager car = controller.GetCar().GetComponent <PowerupManager>(); Slider slider = transform.Find("FrontSlider").GetComponent <Slider>(); damage = car.GetWeaponDamage(WeaponMount.Grill); slider.value = GarageSlider.SliderPosition(GarageStats.minDamage, GarageStats.maxDamage, damage); slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f); slider = transform.Find("RearSlider").GetComponent <Slider>(); damage = car.GetWeaponDamage(WeaponMount.Hitch); slider.value = GarageSlider.SliderPosition(GarageStats.minDamage, GarageStats.maxDamage, damage); slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f); slider = transform.Find("RoofSlider").GetComponent <Slider>(); damage = car.GetWeaponDamage(WeaponMount.Roof); slider.value = GarageSlider.SliderPosition(GarageStats.minDamage, GarageStats.maxDamage, damage); slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f); slider = transform.Find("DoorSlider").GetComponent <Slider>(); damage = car.GetWeaponDamage(WeaponMount.Doors); slider.value = GarageSlider.SliderPosition(GarageStats.minDamage, GarageStats.maxDamage, damage); slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f); slider = transform.Find("WheelSlider").GetComponent <Slider>(); damage = car.GetWeaponDamage(WeaponMount.Wheels); slider.value = GarageSlider.SliderPosition(GarageStats.minDamage, GarageStats.maxDamage, damage); slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f); }
private void Awake() { myRigidBody = GetComponent <Rigidbody2D>(); powerupManager = GameObject.FindObjectOfType <PowerupManager>(); spriteStateAnimator = GetComponent <SpriteStateAnimator>(); selfCollider2D = GetComponent <BoxCollider2D>(); }
public override void OnCollect() { PowerupManager.ResetPowerups(); GetTree().CallGroup("BALLS", "ResetSpeed"); base.OnCollect(); }
// Start is called before the first frame update void Start() { powerManager = FindObjectOfType <PowerupManager>(); //shield = GetComponent<Shield>(); activeShield = false; shield.SetActive(false); rb = GetComponent <Rigidbody2D>(); }
private void Awake() { mover = GetComponent <ShipMover>(); shooter = GetComponent <ShipShooter>(); health = gameObject.GetComponent <TakeDamage>(); powerupManager = GetComponent <PowerupManager>(); forwardMoveSpeed = maxSpeed; }
public virtual void Initialize(PowerupManager owner) { _Owner = owner; _PlayerController = _Owner.GetComponent <PlayerController>(); _PowerupActivatedEvent = _PlayerController.PlayerData.PowerupActivatedEvent; _PowerupDeactivatedEvent = _PlayerController.PlayerData.PowerupDeactivatedEvent; Activate(); }
public void OnWorldSpawn() { worldSpawned = true; if (PowerupManager.GetPowerupStatus(Powerups.ExtraAmmo)) { ammo += ammo; } }
// Use this for initialization void Start() { PM = GameObject.Find("GameController").GetComponent <PowerupManager> (); spawnNum++; this.gameObject.name = "Powerup " + spawnNum; }
void OnPowerUpShoot(PowerupManager.types newType) { if (type == types.GUN && newType == PowerupManager.types.CHUMBO) { collider2d.enabled = true; Invoke("PowerUpReady", 0.2f); } }
void Start() { PwnManager = FindObjectOfType <PowerupManager>(); if (PwnManager.MagnetOn) { PowerAbsorbCoin = GameObject.Find("AbsorbCoin"); } }
void Start() { playerPositions = new ArrayList(); // add in player movement in list // counting from the last player position ItemPosition = new ArrayList(); pwnManager = FindObjectOfType <PowerupManager>(); //- 1 count so we go back one step for Array List }
public override void OnCollect() { PowerupManager.ResetPowerups(); var ball = (Ball)GetTree().GetNodesInGroup("BALLS")[0]; ball.GlueToBoard = true; base.OnCollect(); }
public override void OnCollect() { PowerupManager.ResetPowerups(); var board = GetNode <Board>("/root/Main/Board"); board.EnableLaser(); base.OnCollect(); }
// Use this for initialization void Start() { thePowerupManager = FindObjectOfType <PowerupManager>(); audioManager = AudioManager.instance; if (audioManager == null) { Debug.LogError("Freak out"); } }
void Start() { theFruitGenerator = FindObjectOfType <FruitGenerator> (); theEnemyGenerator = FindObjectOfType <EnemyGenerator> (); theObstacleGenerator = FindObjectOfType <ObstacleGenerator> (); //controller = new GameController (); fruitCount = enemyCount = obstacleCount = powerupCount = 0; thePowerupManager = FindObjectOfType <PowerupManager> (); }
public override void ApplyPowerup() { // award the credits to the player GameManager.AwardCredits(bonusAmount); // display an on screen message GameManager.ShowInfo(infoText + " +" + bonusAmount); // nothing else to do. PowerupManager.OnPowerupCompleted(this); }
public override void OnTriggerEnter(Collider other) { PowerupManager test = other.gameObject.GetComponent <PowerupManager>(); if (test != null) { powerupData.data = other.GetComponent <ShipData>(); test.AddPowerup(powerupData); Destroy(gameObject); } }
public override void OnCollect() { PowerupManager.ResetPowerups(); ball = (Ball)GetTree().GetNodesInGroup("BALLS")[0]; SpawnBalls(); GD.Print(GetTree().GetNodesInGroup("BALLS").Count); base.OnCollect(); }
// Start is called before the first frame update void Start() { this.scoreManager = FindObjectOfType <ScoreManager>(); this.PowerupManager = FindObjectOfType <PowerupManager>(); pos_speedY = speedY; neg_speedY = -speedY; this.random = Random.Range(0, 1); }
void OnBarInit(PowerupManager.types type) { switch (type) { case PowerupManager.types.CHUMBO: title.text = "MEGA-CHUMBO"; break; case PowerupManager.types.GIL: title.text = "GIL-POWA"; break; case PowerupManager.types.MOTO: title.text = "RATI-CICLO"; break; } panel.SetActive(true); isOn = true; percent = 1; powerUpSign.gameObject.SetActive(true); powerUpSign.Init(type); }
void Awake() { s_Singleton = this; spawnIndex = 0; timer = 0.0f; seekersPopulated = false; /*spawnPosition1 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition2 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition3 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition4 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition5 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition6 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition7 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition8 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition9 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f)); spawnPosition10 = new Vector3(Random.Range(119.0f, 130.0f), 6.5f, Random.Range(23.0f, 33.0f));*/ for(int i=0; i<50; i++) { if (Random.Range(0.0f, 1.0f) > 0.5f){ spawnList.Add(new Vector3(Random.Range(-5.0f, 175.0f), 1.5f, Random.Range(-5.0f, 45.0f))); } else{ spawnList.Add(new Vector3(Random.Range(-5.0f, 45.0f), 1.5f, Random.Range(-5.0f, 185.0f))); } } /*spawnList.Add(spawnPosition1); spawnList.Add(spawnPosition2); spawnList.Add(spawnPosition3); spawnList.Add(spawnPosition4); spawnList.Add(spawnPosition5); spawnList.Add(spawnPosition6); spawnList.Add(spawnPosition7); spawnList.Add(spawnPosition8); spawnList.Add(spawnPosition9); spawnList.Add(spawnPosition10);*/ }
// Use this for initialization void Start() { powerupManager = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<PowerupManager>(); StartCoroutine(Spawn()); }
void Awake() { powerupManagerInstance = this; }
// Use this for initialization void Start() { UnityEngine.Random.seed = (int)Time.time; frustumPlanes = GeometryUtility.CalculateFrustumPlanes(Camera.main); powerupManager = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<PowerupManager>(); }
public void AssignPowerup(PowerupManager.PowerupType randomPowerupType) { powerupType = randomPowerupType; }
void OnPowerUp(PowerupManager.types type) { if (Game.Instance.characterManager.character.powerupManager.type == PowerupManager.types.CHUMBO) ChumboRun(); else { state = states.RUN; animator.Play("pungaRun", 0, 0); } }