コード例 #1
0
ファイル: Player.cs プロジェクト: hxzpily/arkanoid_battle
        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);
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: hxzpily/arkanoid_battle
 protected void dispatchTickData(TickArgs args)
 {
     tick(this, args);
 }
コード例 #3
0
ファイル: NPCPlayer.cs プロジェクト: hxzpily/arkanoid_battle
        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();
        }