private void Jump() { //jump abhängig vom food if (p1JumpInput != 0) { if (OwlGrounded()) { if (Gamedata.Instance.Food > 0) { Owl.GetComponent <Rigidbody2D>().AddForce(Vector2.up * moveSettings.JumpVelocity * 1.5f, ForceMode2D.Impulse); Gamedata.Instance.Food -= 1; UpdateStats(); } else { Owl.GetComponent <Rigidbody2D>().AddForce(Vector2.up * moveSettings.JumpVelocity, ForceMode2D.Impulse); } Debug.Log(moveSettings.JumpVelocity); } } if (p2JumpInput != 0 && LemurGrounded()) { Lemur.GetComponent <Rigidbody2D>().AddForce(Vector2.up * moveSettings.JumpVelocity, ForceMode2D.Impulse); Debug.Log(moveSettings.JumpVelocity); } }
/// <summary> /// Creates an array of objects that represent each class that inherits from Primate /// </summary> /// <returns>Array of classes that inherit from Primate</returns> public static Primate[] CreatePrimates() { Primate[] primates = new Primate[3]; primates[0] = new Lemur(); primates[1] = new Chimpanzee(); primates[2] = new Proboscis(); return(primates); }
public void FamousLemurs() { Lemur testLemur = new Lemur(); string result = testLemur.LemurOnAvatar(); string expected = "Lemur's were also on the show Avatar the Last Airbender"; Assert.Equal(expected, result); }
public void LoadTRObject(TRObject trobject) { MyStatus newStatus = (MyStatus)trobject; transform.position = newStatus.myPosition; //transform.rotation = newStatus.myRotation; Owl.GetComponent <Rigidbody2D> ().isKinematic = true; Lemur.GetComponent <Rigidbody2D> ().isKinematic = true; }
public bool Lemurs() { Lemur testLemur = new Lemur(); string result = testLemur.Zaboomafu(); string expected = "Lemur's were on the show Zaboomafu and they're very small"; Assert.Equal(expected, result); return(true); }
//fuer TimeReverse #region ITR implementation public void SaveTRObject() { MyStatus status = new MyStatus(); status.myPosition = transform.position; //status.myRotation = transform.rotation;, gibts doch nicht, oder? trscript.PushTRObject(status); Lemur.GetComponent <Rigidbody2D> ().isKinematic = false; Owl.GetComponent <Rigidbody2D> ().isKinematic = false; }
void FixedUpdate() { if (Gamedata.Instance.Paused && gameObject.GetComponent <TimeReverse> () != null) { return; } //hae????? if (!Owl.GetComponent <Rigidbody2D> ().isKinematic&& !Lemur.GetComponent <Rigidbody2D> ().isKinematic) { Run(); Jump(); } }
static void Main(string[] args) { Lemur myLemur = new Lemur(); myLemur.animalSound(); //You can access enum items with the dot syntax: Level myLevel = Level.High; Console.WriteLine(myLevel); //To get the integer value from an item, you must explicitly convert the item to an int: //output is '0' int myMonths = (int)Months.January; Console.WriteLine(myMonths); //output is '6' int myColors = (int)Colors.Purple; Console.WriteLine(myColors); //Enums are often used in switch statements to check for corresponding values: Level nextLevel = Level.Medium; switch (nextLevel) { case Level.Low: Console.WriteLine("Level is Low"); break; case Level.Medium: Console.WriteLine("Level is Medium"); break; case Level.High: Console.WriteLine("Level is High"); break; } //output is 'Level is Medium' }
public static string LemurSound() { Lemur l = new Lemur(); return(l.Sound()); }
public static string LemurEats() { Lemur l = new Lemur(); return(l.Eats()); }
void JumpedOnEnemy2(float bumpSpeed) { Lemur.GetComponent <Rigidbody2D> ().velocity = new Vector2(Lemur.GetComponent <Rigidbody2D> ().velocity.x, bumpSpeed); }