public static function addParticles(Level $level, $name, Position $pos1, $count = 5) { $xd = (double) 280; $yd = (double) 260; $zd = (double) 280; $particle1 = self::getParticle($name, $pos1, $xd, $yd, $zd, 0); $random = new Random((int) (\microtime(\true) * 1000) + \mt_rand()); for ($i = 0; $i < $count; ++$i) { $particle1->setComponents($pos1->x + $random->nextSignedFloat() * $xd, $pos1->y + $random->nextSignedFloat() * $yd, $pos1->z + $random->nextSignedFloat() * $zd); $level->addParticle($particle1); } }
public function deleteParticles(FloatingTextParticle $particle, Level $level) { $particle->setInvisible(); $level->addParticle($particle); }
public static function addParticles(Level $level, $name, Position $pos1, $count = 5) { // $pos = new Vector3((float) $args[1], (float) $args[2], (float) $args[3]); $xd = (double) 380; $yd = (double) 360; $zd = (double) 380; // $count = 8; // $data = isset($args[8]) ? (int) $args[8] : \null; // $pos = new Vector3((float) $args[1], (float) $args[2], (float) $args[3]); $particle1 = self::getParticle($name, $pos1, $xd, $yd, $zd, 0); $random = new Random((int) (\microtime(\true) * 1000) + \mt_rand()); for ($i = 0; $i < $count; ++$i) { $particle1->setComponents($pos1->x + $random->nextSignedFloat() * $xd, $pos1->y + $random->nextSignedFloat() * $yd, $pos1->z + $random->nextSignedFloat() * $zd); $level->addParticle($particle1); } }