Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exploding fireworks

Comments in 'Plugin Development' started by xBeastMode, Mar 19, 2016.

  1. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    How to make smoke particles that go up into the sky 1 block each second and when it goes up 30 blocks it explodes lots of different color ink? Sorry, I would do it but I'm really bad at calculating the math xD
  2. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    You don't even help at all...
    applqpak likes this.
  3. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Tell me what i did wrong
  4. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Everything.
    Oneeb and applqpak like this.
  5. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    This isn't helping you neither me.
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    My way: Create a custom object (Entity) for example:
    PHP:
    class FireWorks extends Arrow {
    }
    I did this once when creating Bazooka
    applqpak likes this.
  7. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    I am not trying to create a projectile firework.
    applqpak likes this.
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    It's easier tho. Creating FireWork projectile is easier to calculate colisions, easier manage multi fireworks at once etc.
    PHP:
    public function onRun($tick) {
      if(
    alive){ // Don't bother about this
         
    if($this->$this->startY 30){
            
    $this->explode();
        } else {
           
    // Add smoke particle
           
    $this->y++;
        }
      }
      
    $this->updateMovement();
    }
    Last edited: Mar 19, 2016
    applqpak likes this.
  9. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Is there anyone that can explain good?
    applqpak likes this.
  10. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
  11. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    applqpak likes this.
  12. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Then tune it... -_-
  13. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    You do it.
  14. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    What the f*ck was that? He is trying to help you. It's you who need it not he. You just act like an #ass -.-
    Last edited: Mar 20, 2016
  15. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Profanity. Please remove the f-word.
  16. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    DUde, I come here because I need help to do it, if I could do it myself, why would I even aks. #Y-U-SO-DUM
  17. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
  18. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    OMG!!!!! I know how to spawn particles. PEOPLE DON'T READ THAT I want to spawn LOTS OF DIFFERENT COLOR DYE/INK when particles reach 30 BLOCKS HIGH!
  19. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    WTF is dye/ink? You mean those ones that dye wool?
    Primus likes this.
  20. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    So, look in my initial post i explained you how to make an particle go up 30 blocks. Now if the 30 blocks are reached, you just spawn particles with mt_rand again my (improved) ROUGH DRAFT:
    Make repeating task (1 tick) //or all 2 ticks
    __construct accepts x y z (start position)
    make var (CurrentStartOffset = 0)
    onRun:
    spawn Particle(x ,y + CurrentStartOffset ,z)
    CurrentStartOffset = CurrentStartOffset + 0.1;
    if(CurrentStartOffset == 30)
    for(100){
    spawn Particle(mt_rand(x-2, x+2),mt_rand(y+CurrentStartOffset-2, y+CurrentStartOffset+2)mt_rand(y-2, y+2))
    }
    Primus likes this.

Share This Page

Advertisement