void Start() { kitty = GameObject.FindGameObjectWithTag("Player").GetComponent <Kitty>(); anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); translation = 1; }
// Start is called before the first frame update void Awake() { //Load text from jsonfile into the string string myLoadedKitty = ApiHelper.LoadsJsonAsResources("GetKitty/MyKitty/NewKitty.json"); Debug.Log(myLoadedKitty); //loads value into item myKitty = JsonUtility.FromJson <Kitty>(myLoadedKitty); }
void OnTriggerEnter2D(Collider2D collider) { Kitty kitty = collider.GetComponent <Kitty>(); if (kitty != null) { this.OnKittyHit(kitty); } }
void Start() { kitty = GameObject.FindGameObjectWithTag("Player").GetComponent <Kitty>(); anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); //print(kitty.getXPos); }
void OnTriggerEnter2D(Collider2D collider) { Debug.Log("death here"); Kitty kitty = collider.GetComponent <Kitty>(); if (kitty != null) { kitty.removeHealth(); LevelController.current.onKittyDeath(kitty); } }
// Use this for initialization void Awake() { instance = this; trans = transform; LivesTextAnim = GameObject.Find("Lives").GetComponent <Animator> (); LivesTVAnim = GameObject.Find("LivesTV").GetComponent <Animator> (); animator = GetComponentInChildren <DoodleAnimator>(); allSprites = GetComponentsInChildren <SpriteRenderer>(); mySource = GetComponent <AudioSource> (); lives = DataBetweenScenes.kittyLives; }
public static void Main(string[] args) { Console.WriteLine("*************************** Toy ***************************************"); var babyCube = new BabyCube(10, "VTech"); babyCube.Describe(); babyCube.SetLevel(1); Console.WriteLine("*************************** Birds ***************************************"); //Birds (the parent constructor was executed first before the child constructor) var goose = new Goose(true, 2, "seeds", "gray"); Console.WriteLine("*************************** Pets ***************************************"); //Pets(child can have its own methods Bark or Climb) var puppy = new Puppy(false, 4, "bones", "yellow"); puppy.Bark(); Console.WriteLine("---------------------------------"); var kitty = new Kitty(false, 4, "fish", "yellow"); kitty.Climb(); Console.WriteLine("*************************** Crawls ***************************************"); //Crawls(child can use its implemented interface methods and call the parent public methods) var turtle = new Turtle(false, 4, "insects", "brown"); turtle.Crawl(); turtle.Eat(); //turtle.Confidential(); turtle.MakePublic(); Console.WriteLine("---------------------------------"); var crocodile = new Crocodile(false, 4, "fish", "gray"); crocodile.Sleep(); crocodile.Crawl(); Console.WriteLine("---------------------------------"); var tortoise = new Tortoise(true, 4, "grass", "gray"); tortoise.Sleep(); tortoise.Crawl(); tortoise.Walk(); }
public void OnTriggerEnter2D(Collider2D collision) { Kitty k = collision.gameObject.GetComponent <Kitty>(); if (k != null) { k.swagLevel++; k.UpdateScore(); } else { Debug.Log("Trying to give swag to not kitty"); } Destroy(gameObject); }
void OnTriggerEnter2D(Collider2D collider) { Kitty kitty = collider.GetComponent <Kitty>(); if (kitty != null) { onKittyHit(kitty); return; } else { StartCoroutine(destroyLater()); } }
private void Start() { manageHolder = GameObject.FindGameObjectWithTag("Manager"); money = manageHolder.GetComponent <Money>(); kitty = manageHolder.GetComponent <Kitty>(); mainButtonHolder = GameObject.FindGameObjectWithTag("SPHolder"); mainClick = mainButtonHolder.GetComponent <ButtonScript>(); sellHolder = GameObject.FindGameObjectWithTag("PetShop"); sell = sellHolder.GetComponent <DropNDrag>(); scoreHolder = GameObject.FindGameObjectWithTag("Cross"); dontDestroy = scoreHolder.gameObject.GetComponent <DontDestroy>(); }
public void Run() { Animal aCat = new Cat("Bagira"); aCat.Eat(); aCat.GetInfo(); aCat.Roar(); aCat.Name = "Zotoshka"; aCat.GetInfo(); aCat.Run(); aCat.Walk(); Cat aKitty = new Kitty("Myokao"); aKitty.Eat(); Console.ReadKey(); }
public void OnCollisionEnter2D(Collision2D collision) { InverseDirection(); if (collision.gameObject.tag == "Kitty") { Kitty other = collision.gameObject.GetComponent <Kitty>(); if (other.swagLevel < swagLevel) { Debug.Log("Getting Swag from other kitty"); swagLevel += other.RemoveSwag(); } else { Debug.Log("Couldn't get others swag, mine" + swagLevel + " theirs" + other.swagLevel); } } }
public static void Main(string[] args) { Kitty kt = new Kitty(); kt.name = "Founder #3"; kt.owner = "ctkim"; kt.id = 3; kt.cattributes = new Kitty.CAttribute[10]; kt.cattributes[0] = Kitty.CAttribute.TOPAZ; kt.cattributes[1] = Kitty.CAttribute.JAGUAR; kt.children = new Kitty[10]; kt.children[0] = new Kitty(); kt.children[0].name = "Genesis"; Console.WriteLine(kt.name); Console.WriteLine(kt.cattributes[0]); Console.WriteLine(kt.children[0].name); }
public static void Main(string[] args) { Kitty kt = new Kitty(); kt.name = "Founder #3"; kt.owner = "0x243fdfsfd2fdf3df23effdfd"; kt.id = 3; kt.cattributes = new Kitty.CAttribute[10]; kt.cattributes[0] = Kitty.CAttribute.TOPAZ; kt.cattributes[1] = Kitty.CAttribute.JAGUAR; kt.children = new Kitty[10]; kt.children[0] = new Kitty(); kt.children[0].name = "Genensis"; Console.WriteLine(kt.name == "Founder #3"); Console.WriteLine(kt.cattributes[0] == Kitty.CAttribute.TOPAZ); Console.WriteLine(kt.children[0].name == "Genensis"); }
public static void Main(string[] args) { Kitty kt = new Kitty(); kt.name = "Founder #3"; kt.owner = "0x243fdfsfd2fd"; kt.id = 3; kt.CatTributes = new Kitty.CatTribute[10]; kt.CatTributes[0] = Kitty.CatTribute.Topaz; kt.CatTributes[1] = Kitty.CatTribute.Jaguar; kt.children = new Kitty[10]; kt.children[0] = new Kitty(); kt.children[0].name = "Genesis"; Console.WriteLine(kt.name == "Founder #3"); Console.WriteLine(kt.CatTributes[0]); Console.WriteLine(kt.children[0].name == "Genesis"); }
// Boolean method to display whether or not user enters letters in either upper or lowercase public bool IsVisible(Kitty kitty) { if (string.IsNullOrEmpty(Filter)) { return(true); } if (kitty.name.Contains(Filter, StringComparison.OrdinalIgnoreCase)) { return(true); } if (kitty.name.ToString().StartsWith(Filter)) { return(true); } return(false); }
private static void TestAnimals() { Random rng = new Random(); var doge = new Dog("Doge", 5, Gender.Male); // chance a dog to find a stick is about 80% :D Console.WriteLine(doge.FollowTheStick(rng.Next(10))); Console.WriteLine(doge.FollowTheStick(rng.Next(10))); Console.WriteLine(doge.FollowTheStick(rng.Next(10))); Console.WriteLine(doge.FollowTheStick(rng.Next(10))); Console.WriteLine(doge.Sound()); var otherDoge = new Dog("OtherDoge", 0, Gender.Male); Console.WriteLine(otherDoge.FollowTheStick(rng.Next(10))); otherDoge.Sound(); PrintLine(); var froggy = new Frog("Froggy", 2, Gender.Female, "green"); Console.WriteLine(froggy.Sound()); Console.WriteLine(froggy.Talk()); Console.WriteLine(froggy.Sound()); PrintLine(); var cat = new Cat("Stamat", 3, Gender.Male); Console.WriteLine(cat.Play(rng.Next(10))); var kitty = new Kitty("Kitty", 1); Console.WriteLine(kitty.Play(rng.Next(10))); kitty.IncreaseAge(1); var tomcat = new Tomcat("TomCat", 2); Console.WriteLine(tomcat.Play(rng.Next(10))); PrintLine(); }
public IActionResult Create([FromBody] Kitty kitten) { //Genera namn och id string id = Guid.NewGuid().ToString(); var kitty = new Kitty { Id = id, Name = NameFaker.Name(), Body = kitten.Body, Pattern = kitten.Pattern, Mouth = kitten.Mouth, Eye = kitten.Eye }; kittyContext.KittyItems.Add(kitty); kittyContext.SaveChanges(); var result = new ObjectResult(kitty); result.StatusCode = 201; return(result); }
public void Start() { scaled = transform.Find("HealthBar/FillHold"); kitty = gameObject.GetComponent <Kitty>(); dropNDrag = gameObject.GetComponent <DropNDrag>(); currentFood = 0.5f; StartCoroutine(Scale()); catSprite = transform.Find("CSprite").gameObject; rend = catSprite.GetComponent <SpriteRenderer>(); rend.color = new Color(255f, 255f, 255f, 1f); warnSprite = transform.Find("!").gameObject; warnRend = warnSprite.GetComponent <SpriteRenderer>(); warnRend.color = new Color(255f, 255f, 255f, 0f); switch (gameObject.tag) { case "K1": currentTimer = 0.1f; break; case "K2": currentTimer = 0.17f; break; case "K3": currentTimer = 0.24f; break; case "K4": currentTimer = 0.31f; break; case "K5": currentTimer = 0.38f; break; case "K6": currentTimer = 0.45f; break; case "K7": currentTimer = 0.52f; break; case "K8": currentTimer = 0.59f; break; case "K9": currentTimer = 0f; break; default: Debug.Log("not sure what to do with this right now lol"); break; } }
void onKittyHit(Kitty kitty) { kitty.removeHealth(); Destroy(this.gameObject); }
protected virtual void OnKittyHit(Kitty kitty) { }
void ButtonPress(string button, int player) { Kitty selected = kitties.Find(x => x.player.Equals(player)); selected.Button(button); }
protected override void OnKittyHit(Kitty kitty) { Kitty.current.removeHealth(); CollectedHide(); }
void Start() { owner = (Kitty)_owner; GetComponent<PointEffector2D>().forceMagnitude = owner.setting.KittyEnrage.targetForce.x; Destroy(gameObject, owner.setting.KittyEnrage.attackDuration); }
public void onKittyDeath(Kitty kitty) { kitty.transform.position = this.startingPosition; }
protected override void OnKittyHit(Kitty kitty) { LevelController.current.addCandy(); CollectedHide(); }
// Use this for initialization void Start() { kitty = FindObjectOfType<Kitty> (); }
void Awake() { current = this; }
public KittyAI(Enemy kitty) : base(kitty) { viewRange = 15f; person = (Kitty)kitty; }
public void init(float direction, Kitty owner) { this.direction = direction; this.owner = owner; }
protected override void OnKittyHit(Kitty kitty) { Debug.Log("flower collected"); LevelController.current.addFlower(); CollectedHide(); }