public function cleanShips() { echo "lastShipHit after = {$this->lastShipHit}<br>"; echo "lastShots after={$this->lastShots}<br>"; echo "currentLife before={$this->currentLife}<br>"; $sc = new ShipsCleaner($this, $this->lastShipHit, $this->lastShots); $sc->start(); $this->decrement($sc->getExplodedShips()); $this->currentLife -= $sc->getRemainLife(); $this->lastShipHit = 0; $this->lastShots = 0; echo "currentLife after={$this->currentLife}<br>"; return $sc; }
/** * ShipType::cleanShips() * Start the task of explosion system. * @return ShipsCleaner */ public function cleanShips() { log_var('lastShipHit after', $this->lastShipHit); log_var('lastShots after', $this->lastShots); log_var('currentLife before', $this->currentLife); $sc = new ShipsCleaner($this, $this->lastShipHit, $this->lastShots); $sc->start(); $this->decrement($sc->getExplodedShips(), $sc->getRemainLife(), 0); $this->lastShipHit = 0; $this->lastShots = 0; log_var('currentLife after', $this->currentLife); return $sc; }