1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to make explodepartice with dustparicle?

Discussion in 'Development' started by korado531m7, Apr 9, 2018.

  1. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    I want to make explodeparticle, but it’s not default. i want to replace default particle with dustparticle.
    how to make it? thank you for answering.
     
  2. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Please elaborate.
     
  3. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    well, i want to make hugeexplodeparticle. but, default is like smoke. i wanna replace like smoke with dust particle (that is to say, set color to the particle)
     
  4. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    Create an incomplete cube using for(). Enter the color for the particle using rgb symbols (red, green, blue). You can generate it here.

    PHP:
            /** @var Level $level */
            
    $level null;
            
    /** @var Vector3 $center */
            
    $center = new Vector3();
            
    /** @var int $size */
            
    $size 5;


            for(
    $x $center->getX()-$size$x <= $center->getX()+$size$x++) {
                for(
    $y $center->getY()-$size$y <= $center->getY()+$size$y++) {
                    for(
    $z $center->getZ()-$size$x <= $center->getZ()+$size$z++) {
                        if(
    rand(13) === 1) {
                            
    $level->addParticle(new DustParticle(new Vector3($center->add($x/10$y/10$z/10)), 130130130));
                        }
                    }
                }
            }
     
    korado531m7 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.