Esempio n. 1
0
        protected override void ConsumePacket(Connection connection, ItemDropPacket packet)
        {
            var itemDrop = new ItemDrop
            {
                Item = ContentChest.ItemData[packet.ItemId],
                X    = packet.X,
                Y    = packet.Y
            };

            var moveComponent = itemDrop.AddComponent(new MoveComponent());

            itemDrop.AddComponent(new GravityComponent());
            moveComponent.XVelocity = Randomizer.Next(-10, 10);
            moveComponent.YVelocity = Randomizer.Next(0, 5);

            // TODO NETWORKED GAME AREAS
            _gameWorld.GameAreas[0].DropItem(itemDrop);
        }