Sideways growth

  • tian110796
    4th Jan 2011 Member 0 Permalink
    Does it grow slowly or not?
    if not:

    delete_part(x+1, y);
    create_part(-1, x+1, y, PT_GROW);
    delete_part(x-1, y);
    create_part(-1, x-1, y, PT_GROW);

    if yes:

    if(rand()%slow < 1){
    delete_part(x+1, y);
    create_part(-1, x+1, y, PT_GROW);
    }
    if(rand()%slow < 1){
    delete_part(x-1, y);
    create_part(-1, x-1, y, PT_GROW);
    }

    Again PT_GROW is the something that grows and slow the part on how slow it is. The first slow may be different from the other slow(means that it grows faster on a certain direction)
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    Thank you so much, I can finally try it (when my code works again)
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    One problem, it grows upwards whenever it touches anything.
  • Dragonfree97
    4th Jan 2011 Member 0 Permalink
    it's like a vine... it grows up things...
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    but it's annoying, cos it's meant to be a a laser.
  • Dragonfree97
    4th Jan 2011 Member 0 Permalink
    you don't want laser moving like photons?
  • tian110796
    4th Jan 2011 Member 0 Permalink
    If it is supposed to be a laser then find around line 667:
    if(t==PT_ACID)
    {
    parts[i].life = 75;
    }

    put after that:

    if(t==PT_GROW)
    {
    switch(rand()%2){
    case 0:
    parts[i].vx = -1;
    case 1:
    parts[i].vx = 1;
    }
    }

    You could change 1 and -1 to a higher rate (It would be faster that way). But if it is very high, it would be unappealing to display.
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    thanks, I'll try when I get back from school.
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    It doesn't stop it growing upwards when it touches something though!
  • PizzaPlatypus
    4th Jan 2011 Member 0 Permalink
    bump