~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/tron/arena.php

  • Committer: zodiacsohma1 at gmail
  • Date: 2014-03-02 08:09:55 UTC
  • Revision ID: zodiacsohma1@gmail.com-20140302080955-r5ot6eipfe0nlpww
Simplified all fields and code in all areas for better as they seem to repeat themselves.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
                $rand = rand(0, count(Base::$base->MAP->spawns) - 1);
60
60
 
61
61
                $spawn = Base::$base->MAP->spawns[$rand];
62
 
                if (isset($spawn) && !is_null($spawn) && $spawn instanceof Spawn)
 
62
                if (isset($spawn) && $spawn instanceof Spawn)
63
63
                {
64
64
                    $pos = $spawn->pos;
65
65
                    $dir = $spawn->dir;
92
92
                for($i = 0; $i < count(Base::$base->MAP->spawns); $i++)
93
93
                {
94
94
                    $spawn = Base::$base->MAP->spawns[$i];
95
 
                    if (isset($spawn) && !is_null($spawn) && $spawn instanceof Spawn)
 
95
                    if (isset($spawn) && $spawn instanceof Spawn)
96
96
                    {
97
97
                        $newLocation = new Coord($pos->x - $spawn->pos->x, $pos->y - $spawn->pos->y);
98
98
                        $tempDistance = $newLocation->Norm();
106
106
                }
107
107
            }
108
108
 
109
 
            if (isset($ret) && !is_null($ret) && $ret instanceof Spawn)
 
109
            if (isset($ret) && $ret instanceof Spawn)
110
110
            {
111
111
                $ret->numberOfUses++;
112
112
                $ret->lastTimeUsed = Base::$base->TIMER->gameTimer();