Esempio n. 1
0
        private void SpawnPlayer()
        {
            GameObjectManager     manager = sSystemRegistry.GameObjectManager;
            PyroGameObjectFactory factory = (PyroGameObjectFactory)sSystemRegistry.GameObjectFactory;

            GameObject playerGameObject = factory.SpawnPlayer(0, 0);

            manager.Add(playerGameObject);

            //spawn at center
            Point gameCenter = new Point(GameWidthInSlots / 2, GameHeightInSlots / 2);

            //gameCenter = new Point(19,19);//test wrap
            playerSlot.SetPosition(gameCenter.X, gameCenter.Y);
            playerSlot.Setup(GameSlotStatus.Player, playerGameObject);
            GetGameSlot(gameCenter).Setup(GameSlotStatus.Player, null);

            //spawn facing right
            playerSlot.Child.facingDirection.X = 1;
            playerSlot.Child.facingDirection.Y = 0;

            playerGameObject.SetPosition(GetSlotLocation(playerSlot.Position));
        }