@verb #2711:"flame*s" any any any rxdo #9620 @program #2711:"flame*s" any any any "args[1] parsed as maximum seeds created this round" "args[2] parsed as boom ( will the flame be returned a line or have a dynamic width )" "vars to consider: fuel, combustion dynamic, delay" "Delay could be performed externally" flame = 0 combustion = 0 progression = 0 boom = 0 "seedNum is how many points of flame will be generated this round ( matrix effect looks good at random(4))" "Max seeds is 40" if (length(args) > 0) if (length(args) > 1) boom = args[2] endif if (toint(args[1]) > 40) seedNum = random(40) else seedNum = random(toint(args[1])) endif else seedNum = 0 "just run what we have, no new seeds today." endif "Initialize the output line." screen = $su:space(78) "ignite this round of seeds" for i in [1..seedNum] "gas up the seeds ( will determine length of flame )." fuel = random(20) "Start them in a random location along the bottom of the screen." location = random(40) this.genRay = {@this.genRay, {location, fuel, flame, combustion}} "The seed now gets stored at the end of the current flame/seed/generation array: location ( point where the middle of the flame is ), fuel ( how long the flame will burn for ), flame ( the width of the flame ), combustion ( the amount of fuel being burned, which ramps the way the flame is shaped over tyme )" endfor "blow away ashes" j = 0 for i in [1..length(this.genRay)] j = j + 1 if (this.genRay[j][2] <= 0) "fuel is gone" this.genRay = {@this.genRay[1..j - 1], @this.genRay[j + 1..$]} j = j - 1 endif endfor "Begin genRay processing." "The fire must be burned in reverse for this to work: The flames are drawn from top to bottom on the screen ( no frame buffering yet ), and each update, a new section of the bottom of the flame is updated to screen." for i in [1..length(this.genRay)] "This fuel burns perfectly evenly for the tyme being- no point of maximum flamage, just constantly decreasing in fuel" burn = this.genRay[i][2] = this.genRay[i][2] / 2 "The burn value is added to the width of the flame for the combustion value plus a slight modifier for dynamic effect." this.genRay[i][3] = burn + this.genRay[i][4] "the modifier... *shrug*" this.genRay[i][4] = burn / 2 "draw flamewidths to the screen if boom enabled" if (boom != 0) for j in [1..this.genRay[i][3]] if (this.genRay[i][1] + j <= length(screen)) screen[this.genRay[i][1] + j] = "0" endif if (this.genRay[i][1] - j > 0) screen[this.genRay[i][1] - j] = "0" endif endfor else screen[this.genRay[i][1]] = "0" endif endfor return screen "Last modified by Velusip (#9620) on Wed Nov 6 18:37:46 2002 MST." .