Beispiel #1
0
        public override void OnEvent(Event evt)
        {
            switch (evt.Type)
            {
            case AwardPointsEvent.AWARD_POINTS: {
                AwardPointsEvent msg = (AwardPointsEvent)evt;

                int points = entity[Key_PointsCollected];
                points += msg.Points;
                entity[Key_PointsCollected] = points;

                HudEvent hudEvent = HudEvent.UpdateScore(points);
                eventManager.Queue(hudEvent);

                Console.WriteLine("[" + this.GetType().Name + "] " + entity + " collected " + msg.Points
                                  + " points for destroying " + msg.SourceEntityID + " (total points: " + points + " )");

                break;
            }
            }
        }