private void Form1_KeyPress(object sender, KeyPressEventArgs e) { deplacement = mouvement.Rien; if (e.KeyChar == 's') { deplacement = mouvement.Bas; } else if (e.KeyChar == 'd') { deplacement = mouvement.Droite; } else if (e.KeyChar == 'a') { deplacement = mouvement.Gauche; } else if (e.KeyChar == 'n') { deplacement = mouvement.RotationAntihoraire; } else if (e.KeyChar == 'm') { deplacement = mouvement.RotationHoraire; } if (deplacement != mouvement.Rien) { GererDeplacement(); } }
private void OnTriggerEnter2D(Collider2D collision) { //Debug.Log("collision" + collision.gameObject.name); mouvement joueur = null; joueur = collision.gameObject.GetComponent <mouvement>(); //Debug.Log("hit"); if (joueur != null && estEnMain != true && collision.gameObject.GetComponent <ManagerJoueur>().objetEnMain == null) { demanderSiRamassable(collision.gameObject.name); } }
public void tuerJoueur() { this.vie.setIfAlive(false); this.changeSpriteColor(Color.red); if (this.estLocal) { mouvement playerMovement = this.gameObject.GetComponent <mouvement>(); if (playerMovement) { playerMovement.setStatut(false); } else { Debug.LogWarning("WARN DegatsJoueur:playerDeath(vie, respawnPoints): Failed to freeze player movement (missing 'mouvement' component)."); } } }
public void reapparaitreJoueur(int number) { vie.setVieAuMaximum(); GestionnaireEvenement.declancherEvenement("vieChanger"); this.clignoterJoueur(); if (this.estLocal) { mouvement playerMovement = this.gameObject.GetComponent <mouvement>(); this.gameObject.transform.position = this.selectSpawnPoint(number); this.reinitialiserMouvement(); if (playerMovement) { playerMovement.setStatut(true); } else { Debug.LogWarning("WARN DegatsJoueur::respawnPlayer: Failed to resume player movement (missing 'mouvement' component)."); } this.vie.setIfAlive(true); } }
// Use this for initialization void Start() { avion = GetComponentInParent <mouvement>(); }
void Start() { camTop = GameObject.Find("CameraTop"); camFP = transform.Find("tete").gameObject.transform.Find("CameraFP").gameObject; camOblique = transform.Find("tete").gameObject.transform.Find("CameraOblique").gameObject; maxJauge=1; nbChangementsDispo=1; scriptMouvement = gameObject.transform.Find("tete").GetComponent<mouvement>(); //scriptMouvement = gameObject.GetComponent<mouvement>(); controleur = ControlleurJeu.instance; jauge =transform.Find("tete").gameObject.transform.Find("jaugeMouvementsDispos").gameObject; rendererJauge = jauge.GetComponent<Renderer>(); }