Beispiel #1
0
        public void onTick(double bouncerX, string criticalHits, string executedRequestsData)
        {
            sim.simulateEightTicks(criticalHits, executedRequestsData);
            var args = new TickArgs(bouncerX, criticalHits, string.Join("$", sim.requestsExecutedAt8Ticks.ToArray()));
            if (finishedGame)
                Console.WriteLine("Sending last piece of data to opp (with finish req): ex req: " +
                                  args.executedRequests + " crit hits: " + args.criticalHits);

            dispatchTickData(args);
        }
Beispiel #2
0
 protected void dispatchTickData(TickArgs args)
 {
     tick(this, args);
 }
Beispiel #3
0
        private void onTick()
        {
            (sim as NPCFieldSimulation).simulateEightTicks();
            var args = new TickArgs(sim.bouncer.x, string.Join(",", (sim as NPCFieldSimulation).criticalHits.ToArray()),
                string.Join("$", sim.requestsExecutedAt8Ticks.ToArray()));
            Console.WriteLine("SENDING NPCS HITS: " +
                              string.Join(",", (sim as NPCFieldSimulation).criticalHits.ToArray()));
            dispatchTickData(args);

            if (sim.ballsManager.currentTick%2 == 0 && !finishedGame)
                //every 0.5 sec frequency of _tickTimer's ticks is adjusted so that both player and NPC run on the same pace
                syncTimer();
        }