示例#1
0
        private static void Battery_BatterySpent(object sender, GameObjectEventArgs e)
        {
            Battery battery = (Battery)sender;

            logger(sender, "Battery_BatterySpent", e.EventType.ToString());
            ToBeRemovedObjects.Add(battery);
        }
示例#2
0
 public void OnEntityWalkIn(GameObjectEventArgs e, GameTime gametime)
 {
     if (AsSE)
     {
         Audio.SoundEffectEngine.PlaySoundEffects(SE);
     }
 }
示例#3
0
 private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e)
 {
     if (this.camObj == e.Object)
     {
         this.SetCurrentCamera(null);
     }
 }
示例#4
0
 public void OnDraw(GameObjectEventArgs e, SpriteBatch spritebatch, GameTime gametime)
 {
     Variant[e.ParrentEntity.Variant].Draw(spritebatch, new Rectangle(
                                               e.OnScreenLocation.X + (int)(e.World.Camera.Zoom * (this.SpriteLocation.X + e.ParrentEntity.OnTileLocation.X)),
                                               e.OnScreenLocation.Y + (int)(e.World.Camera.Zoom * (this.SpriteLocation.Y + +e.ParrentEntity.OnTileLocation.Y)),
                                               this.DrawBox.Width * e.World.Camera.Zoom, this.DrawBox.Height * e.World.Camera.Zoom), Color.White, gametime);
 }
示例#5
0
 public void Battery_BatterySpent(object sender, GameObjectEventArgs e)
 {
     if (e.EventType == GameObjectEventArgsType.SHIP_COLLIEDED_WITH_BATTERY)
     {
         Battery battery = (Battery)sender;
         EnergyUp(battery.Energy);
     }
 }
示例#6
0
 private static void OnGameObjectRemoved(GameObjectEventArgs args)
 {
     if (GameObjectRemoved != null)
     {
         GameObjectRemoved(current, args);
     }
     args.Object.OnDeactivate();
 }
示例#7
0
 private static void OnGameObjectAdded(GameObjectEventArgs args)
 {
     args.Object.OnActivate();
     if (GameObjectAdded != null)
     {
         GameObjectAdded(current, args);
     }
 }
示例#8
0
    public void OnCollisionWithGoal(object source, GameObjectEventArgs args)
    {
        SnowBallStatusHolder snowBallStatusManager = args.GameObject.GetComponent <ISnowBallStatusHolder>().GetSnowBallStatusHolder();
        int ballPointValue = snowBallStatusManager.SnowBallPointValue;
        int goalID         = snowBallStatusManager.LastContactedGoalID;

        AddScorePoints(ballPointValue, goalID);
    }
示例#9
0
 private void objectManager_GameObjectRemoved(object sender, GameObjectEventArgs e)
 {
     this.RemoveFromManagers(e.Object);
     if (this.IsCurrent)
     {
         OnGameObjectRemoved(e);
     }
 }
示例#10
0
 private void objectManager_GameObjectAdded(object sender, GameObjectEventArgs e)
 {
     this.AddToManagers(e.Object);
     if (this.IsCurrent)
     {
         OnGameObjectAdded(e);
     }
 }
示例#11
0
 private static void Ship_ShipDamaged(object sender, GameObjectEventArgs e)
 {
     logger(sender, "Ship_ShipDamaged", e.EventType.ToString());
     if (Score > 0)
     {
         Score--;
     }
     logger(null, "Score", Score.ToString());
 }
示例#12
0
 private void removeFromLists(object sender, GameObjectEventArgs e)
 {
     GItemList.Remove(e.Guid);
     GUnitList.Remove(e.Guid);
     GPlayerList.Remove(e.Guid);
     GNodeList.Remove(e.Guid);
     GDynamicList.Remove(e.Guid);
     GCorpsesList.Remove(e.Guid);
     ObjectList.Remove(e.Guid);
     GuidList.Remove(e.Guid);
 }
示例#13
0
 private static void OnGameObjectRemoved(GameObjectEventArgs args)
 {
     if (GameObjectRemoved != null)
     {
         GameObjectRemoved(current, args);
     }
     if (args.Object.Active || args.Object.Disposed)
     {
         args.Object.OnDeactivate();
     }
 }
示例#14
0
        private static void Bullet_BulletSpent(object sender, GameObjectEventArgs e)
        {
            Bullet bullet = (Bullet)sender;

            logger(sender, "Bullet_BulletSpent", e.EventType.ToString());
            if (e.EventType == GameObjectEventArgsType.BULLET_COLLIEDED_WITH_ASTEROID)
            {
                Score += 5;
            }
            logger(null, "Score", Score.ToString());
            ToBeRemovedObjects.Add(bullet);
        }
示例#15
0
        //public GMain Form
        //{
        //    get
        //    {
        //        return form;
        //    }
        //}

        #region List stuff
        private void addToLists(object sender, GameObjectEventArgs e)
        {
            GObject ObjectToAdd = PopulateObject(e.Guid);

            if (ObjectToAdd != null)
            {
                try
                {
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_ITEM))
                    {
                        GItemList.Add(ObjectToAdd.ObjectGUID, new GItem(this, ObjectToAdd.ObjectPointer));
                    }
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_UNIT))
                    {
                        GUnitList.Add(ObjectToAdd.ObjectGUID, new GUnit(this, ObjectToAdd.ObjectPointer));
                    }
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_PLAYER))
                    {
                        GPlayerList.Add(ObjectToAdd.ObjectGUID, new GPlayer(this, ObjectToAdd.ObjectPointer));
                    }
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_NODE))
                    {
                        GNodeList.Add(ObjectToAdd.ObjectGUID, new GNode(this, ObjectToAdd.ObjectPointer));
                    }
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_DYNAMICOBJECT))
                    {
                        GDynamicList.Add(ObjectToAdd.ObjectGUID, new GDynamic(this, ObjectToAdd.ObjectPointer));
                    }
                    if (ObjectToAdd.Type.Equals((int)eObjectType.G_CORSPE))
                    {
                        GCorpsesList.Add(ObjectToAdd.ObjectGUID, new GCorpses(this, ObjectToAdd.ObjectPointer));
                    }
                    ObjectList.Add(ObjectToAdd.ObjectGUID, new GObject(this, ObjectToAdd.ObjectPointer));
                    GuidList.Add(e.Guid);
                }
                catch { };
            }
        }
示例#16
0
        public override void Tick(GameObjectEventArgs e, KeyboardState KeyBoard, MouseState Mouse, GameTime gameTime)
        {
            if (KeyBoard.IsKeyDown(Config.Controls.MoveRun))
            {
                Speed = 10;
            }
            else
            {
                Speed = 5;
            }

            if (e.ParrentEntity.IAToDo.Count == 0)
            {
                e.ParrentEntity.Variant = IdleVariant;
                if (KeyBoard.IsKeyDown(Config.Controls.MoveUp))
                {
                    e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Up, Speed));
                    e.ParrentEntity.Variant = MoveUpVariante;
                }
                else if (KeyBoard.IsKeyDown(Config.Controls.MoveDown))
                {
                    e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Down, Speed));
                    e.ParrentEntity.Variant = MoveDownVariante;
                }
                else if (KeyBoard.IsKeyDown(Config.Controls.MoveLeft))
                {
                    e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Left, Speed));
                    e.ParrentEntity.Variant = MoveLeftVariante;
                }
                else if (KeyBoard.IsKeyDown(Config.Controls.MoveRight))
                {
                    e.ParrentEntity.IAToDo.Add(new Helper.Action(Helper.ActionType.Move, Helper.Direction.Right, Speed));
                    e.ParrentEntity.Variant = MoveRightVariante;
                }
            }
        }
示例#17
0
 private void owner_OnDestroy(object sender, GameObjectEventArgs e)
 {
     Console.WriteLine("Owner destroyed.");
 }
示例#18
0
 public override void OnUpdate(GameObjectEventArgs e, KeyboardState keyboard, MouseState mouse, GameTime gametime)
 {
     IA.Tick(e, keyboard, mouse, gametime);
     IA.ExecuteAction(e, gametime);
 }
示例#19
0
 public override void OnTick(GameObjectEventArgs e, GameTime gametime)
 {
 }
 protected virtual void OnAfterWallHit(GameObjectEventArgs e)
 {
     AfterWallHit?.Invoke(this, e);
 }
示例#21
0
 private void spit_OnDestroyed(object sender, GameObjectEventArgs e)
 {
     spits.Remove(sender as BossSpit);
 }
 public override void Tick(GameObjectEventArgs e, KeyboardState KeyBoard, MouseState Mouse, GameTime gameTime)
 {
     base.Tick(e, KeyBoard, Mouse, gameTime);
 }
示例#23
0
文件: Slime.cs 项目: Jntz/jamipeli
 private void spit_OnDestroyed(object sender, GameObjectEventArgs e)
 {
     spit.OnDestroyed -= spit_OnDestroyed;
     spit = null;
 }
示例#24
0
文件: Slime.cs 项目: Babelz/jamipeli
 private void spit_OnDestroyed(object sender, GameObjectEventArgs e)
 {
     spit.OnDestroyed -= spit_OnDestroyed;
     spit              = null;
 }
示例#25
0
 protected virtual void OnBatterySpent(GameObjectEventArgs e)
 {
     BatterySpent?.Invoke(this, e);
 }
示例#26
0
 public void OnDraw(GameObjectEventArgs e, SpriteBatch spritebatch, GameTime gametime)
 {
     Variant[e.ParrentTile.Variant].Draw(spritebatch, new Microsoft.Xna.Framework.Rectangle(new Microsoft.Xna.Framework.Point(e.OnScreenLocation.X - e.World.Camera.Zoom / 2, e.OnScreenLocation.Y - e.World.Camera.Zoom / 2), new Microsoft.Xna.Framework.Point(e.World.Camera.Zoom * 2, e.World.Camera.Zoom * 2)), Microsoft.Xna.Framework.Color.White, gametime);
 }
示例#27
0
 public virtual void OnTick(GameObjectEventArgs e, GameTime gametime)
 {
 }
示例#28
0
 public void OnUpdate(GameObjectEventArgs e, KeyboardState keyboard, MouseState mouse, GameTime gametime)
 {
 }
示例#29
0
文件: Megablob.cs 项目: Jntz/jamipeli
 private void spit_OnDestroyed(object sender, GameObjectEventArgs e)
 {
     spits.Remove(sender as BossSpit);
 }
示例#30
0
 protected virtual void OnBulletSpent(GameObjectEventArgs e)
 {
     BulletSpent?.Invoke(this, e);
 }