Example #1
0
        public FoodArgs getArgs()
        {
            FoodArgs args = new FoodArgs();

            args.addFood(food);

            return(args);
        }
Example #2
0
        //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);
        }