public override void OnCollide(GameObject obj2) { if (IsHead && obj2.Type == ObjectType.Player) { Program.lost = true; } }
//prop Points public override void OnCollide(GameObject obj2) { if (obj2.Type == ObjectType.Player) { Program.player.Eat(this); } }
public void Eat(GameObject t) { Add(); Program.GameObjects.Remove(t); Random rng = new Random(); Program.GameObjects.Add(new Treat() { Position = new Position() {X = rng.Next(1,79), Y=rng.Next(1, 23) }, Symbol="@", Type=ObjectType.Treat }); this.Score++; }
public virtual void OnCollide(GameObject obj2) { }