Пример #1
0
        protected override void Execute(List <InputEntity> entities)
        {
            var inputEntity = entities.SingleEntity();
            var touchPos    = inputEntity.touchPosition.Value;
            var shooterPos  = _contexts.game.shooterPosition.Value;

            var validTrajectory = CollisionFinder.GetTrajectory(shooterPos, touchPos, out var trajectory);
            var validEndPoint   = CollisionFinder.GetRealCollisionPoint(shooterPos, touchPos, out var endPoint);

            UpdateTrajectory(validEndPoint & validTrajectory, trajectory);
            UpdateGhostBubble(validEndPoint & validTrajectory, endPoint);
        }
Пример #2
0
        public void SaveGame(Game1 Game)
        {
            ClearTemp();
            foreach (IKoopa minion in Game.koopaList)
            {
                koopaList.Add(minion);
            }
            foreach (Goomba goomba in Game.goombaList)
            {
                goombaList.Add(goomba);
            }
            foreach (Bowser boss in Game.bowserList)
            {
                bowserList.Add(boss);
            }
            foreach (IPiranaPlant minion in Game.piranaPlantList)
            {
                piranaPlantList.Add(minion);
            }
            foreach (IBlock block in Game.blocks)
            {
                blocks.Add(block);
            }
            foreach (IItem item in Game.items)
            {
                items.Add(item);
            }
            foreach (IObject obj in Game.objects)
            {
                objects.Add(obj);
            }
            foreach (IObject back in Game.backGround)
            {
                backGround.Add(back);
            }
            foreach (ICollisionFinder collision in Game.CollisionFinder)
            {
                CollisionFinder.Add(collision);
            }

            keyboard = Game.keyboard;
            gamepad  = Game.gamepad;
        }