Exemple #1
0
        static void Main(string[] args)
        {
            var meb            = new UnityMechanicEngineBuilder();
            var mechanicEngine = meb.Build(null, null);

            mechanicEngine.StartEngine();

            var player = mechanicEngine.LoadPlayerBody(Guid.NewGuid());

            player.Shoot();

            new Task(
                () =>
            {
                while (true)
                {
                    player.Move(0, new Vector(1, 1), new TimeSpan(0, 0, 0, 0, 70));
                    player.ChangeDirection(1, new Vector(1, 1));
                    Console.WriteLine("New Era");
                    foreach (var body in mechanicEngine.ViewPort.GetFrame(player.Id, null).Bodies)
                    {
                        Console.WriteLine("Body Id: {0}, new position: {1}", ((ActiveBody)body).Id, body.Shape.Position.ToString());
                    }

                    Thread.Sleep(1000);
                }
            }).Start();

            Console.ReadLine();
        }
Exemple #2
0
        public static void Run(ILogger logger)
        {
            _logger = logger;
            var meb = new UnityMechanicEngineBuilder();

            SlowpokeHub.MechanicEngine = meb.Build(UpdatePlayerState, _engineConfiguration);

            SlowpokeHub.MechanicEngine.StartEngine();
        }