Exemple #1
0
        /// <summary>
        /// OnCollisionCommander method takes as input a commander
        /// and checks if the commander has been shot once or twice. If
        /// once, then then change the image of the commander. If twice,
        /// then eliminate the commander from canvas
        /// </summary>
        /// <param name="commander">Commander object</param>
        public void OnCollisionCommander(Commander commander)
        {
            if (commander.getIsShot() == true)
            {
                destroy(commander);
            }

            if (commander.getIsShot() == false)
            {
                commander.setIsShot(true);
                commander.changeImage();
            }
        }