public FoodArgs getArgs() { FoodArgs args = new FoodArgs(); args.addFood(food); return(args); }
//This region contains all in-game events #region Events void EatenFood(object sender, FoodArgs args) { SnakeType snake = sender as SnakeType; FoodType foodEaten = args.getFood(snake.Vector); snake.addSegment(foodEaten.Growth); foodEaten.spawn(level.Grid); SoundManager.playSound("Munch"); updateScore(foodEaten); }