home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / CHIP_4_98.ISO / Java / applet / flozoids / flozoids.txt < prev    next >
Encoding:
Text File  |  1998-02-21  |  14.2 KB  |  320 lines

  1.  
  2.           Anfy Flozoids - Copyright (C) by Fabio Ciucci 1997/98
  3.  
  4.  
  5. This applet can animate in realtime an artificial life algorithm, where
  6. some "flozoids" are flying (or swimming) around.
  7. I have to thank Jeff Cragg and Alex Vulliamy for this idea.
  8. Remember that are needed both flozoids.class and Lware.class.
  9. You must upload these 2 .class files and insert the <applet> tag on your
  10. html document to add this applet to your page.
  11. This applet is fully parametrized, so you can change many things to
  12. adapt the effect to your pages and purposes.
  13. Here an example of what you have to write in the html (the things anfter
  14. the ; are comments with min-max values acceptet):
  15.  
  16.  
  17. <applet code=flozoids.class width=500 height=100>  ; Name, Width, Height
  18. <param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
  19. <param name=regcode value="NO">         ; Register code (if you have it)
  20. <param name=reglink value="NO">         ; URL where go optionally when clicked
  21. <param name=regnewframe value="YES">    ; Reglink opened in new frame?
  22. <param name=regframename value="_blank"> ; Name of new frame for reglink
  23. <param name=statusmsg value="Flozoids applet">  ; Statusbar message
  24. <param name=numfloz value="50">          ; Number of flozoids
  25. <param name=flozdistance value="200">    ; Distance allowed between flozoids
  26. <param name=tocenter value="20">         ; How flozoids tends to go to center
  27. <param name=acceleration value="30">     ; Acceleration of flozoids
  28. <param name=speed value="5">            ; Speed of flozoids
  29. <param name=sidebouncing value="80">    ; Side bounding factor
  30. <param name=fheads value="YES">         ; Flozoids have heads? ("YES", "NO")
  31. <param name=overtext value="YES">       ; Flozoids go over text? ("YES", "NO")
  32. <param name=backimage value="NO">       ; Background image (it's name or "NO")
  33. <param name=backR value="0">            ; Background color (red component)
  34. <param name=backG value="0">            ; Background color (green component)
  35. <param name=backB value="0">            ; Background color (blue component)
  36. <param name=flozR1 value="255">         ; Flozoids color1 (red component)
  37. <param name=flozG1 value="240">         ; Flozoids color1 (green component)
  38. <param name=flozB1 value="240">         ; Flozoids color1 (blue component)
  39. <param name=flozR2 value="60">          ; Flozoids color2 (red component)
  40. <param name=flozG2 value="70">          ; Flozoids color2 (green component)
  41. <param name=flozB2 value="80">          ; Flozoids color2 (blue component)
  42. <param name=textscroll value="flozscr.txt"> ; File for scrolltext or "NO"
  43. <param name=textoffset value="140">         ; Txtscroll y offset
  44. <param name=textspeed value="1">          ; Txtscroll speed
  45. <param name=textfont value="Arial">       ; Txtscroll font name
  46. <param name=textbold value="NO">          ; Txtscroll bold ("YES" or "NO")
  47. <param name=textsize value="24">          ; Txtscroll font size
  48. <param name=textshadow value="YES">       ; Txtscroll shadow ("YES" or "NO")
  49. <param name=TextColR value="200">         ; Txtscroll color (red component)
  50. <param name=TextColG value="255">         ; Txtscroll color (green component)
  51. <param name=TextColB value="190">         ; Txtscroll color (blue component)
  52. <param name=TextSColR value="20">         ; Txtscroll shadow col. (red c.)
  53. <param name=TextSColG value="20">         ; Txtscroll shadow col. (green c.)
  54. <param name=TextSColB value="50">         ; Txtscroll shadow col. (blue c.)
  55. <param name=TextJumpAmp value="0">        ; Txtscroll jump aplitude
  56. <param name=TextJumpSpd value="0">        ; Txtscroll jump speed
  57. <param name=TextSineAmp value="0">        ; Txtscroll sineshape amplitude        
  58. <param name=TextSineSpd value="0">        ; Txtscroll sineshape movement
  59. <param name=TextSineAngle value="0">      ; Txtscroll sineangle / pixel
  60. <param name=memdelay value="1000">        ; Memory deallocation delay
  61. <param name=priority value="3">           ; Task priority (1..10)
  62. <param name=MinSYNC value="10">           ; Min. milliseconds/frame for sync
  63. Sorry, your browser doesn't suppor Java.  ; Message for no java browsers.
  64. </applet>                                 ; End of applet tag
  65.  
  66.  
  67. NOTE: Don't place "; comments" on final HTML!!!
  68.  
  69. Copy and paste in your html document this cleared and correct tag:
  70.  
  71.  
  72. <applet code=flozoids.class width=500 height=100>
  73. <param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
  74. <param name=regcode value="NO">
  75. <param name=reglink value="NO">
  76. <param name=regnewframe value="YES">
  77. <param name=regframename value="_blank">
  78. <param name=statusmsg value="Flozoids applet">
  79. <param name=numfloz value="50">
  80. <param name=flozdistance value="200">
  81. <param name=tocenter value="20">
  82. <param name=acceleration value="30">
  83. <param name=speed value="5">
  84. <param name=sidebouncing value="80">
  85. <param name=fheads value="YES">
  86. <param name=overtext value="YES">
  87. <param name=backimage value="NO">
  88. <param name=backR value="0">
  89. <param name=backG value="0">
  90. <param name=backB value="0">
  91. <param name=flozR1 value="255">
  92. <param name=flozG1 value="240">
  93. <param name=flozB1 value="240">
  94. <param name=flozR2 value="60">
  95. <param name=flozG2 value="70">
  96. <param name=flozB2 value="80">
  97. <param name=textscroll value="flozscr.txt">
  98. <param name=textoffset value="120">
  99. <param name=textspeed value="4">
  100. <param name=textfont value="Arial">
  101. <param name=textbold value="NO">
  102. <param name=textsize value="24">
  103. <param name=textshadow value="NO">
  104. <param name=TextColR value="250">
  105. <param name=TextColG value="230">
  106. <param name=TextColB value="120">
  107. <param name=TextSColR value="20">
  108. <param name=TextSColG value="20">
  109. <param name=TextSColB value="50">
  110. <param name=TextJumpAmp value="0">
  111. <param name=TextJumpSpd value="0">
  112. <param name=TextSineAmp value="8">
  113. <param name=TextSineSpd value="2">
  114. <param name=TextSineAngle value="3">
  115. <param name=memdelay value="1000">
  116. <param name=priority value="3">
  117. <param name=MinSYNC value="10">
  118. Sorry, your browser doesn't suppor Java.
  119. </applet>
  120.  
  121.                              ---------
  122.  
  123.  
  124. Here detailed instructions about how to change parameters:
  125.  
  126. The credits parameter can't be changed otherwise the applet will not work.
  127.  
  128. To activate the reg parameters read the shareware registration notes.
  129. In the "regcode" parameter you have to place the registration code you
  130. purchase from the author. If it is correct and the applet is run from the
  131. registered domain name, you can use "reglink" parameter, where you can specify
  132. an URL where bring user when the applet is clicked.
  133. If you set to "YES" regnewframe, you can specify a frame where load the
  134. reglink:
  135.  
  136. "_blank"  : To load the link in a new blank unnamed browser window.
  137. "_self"   : To load the link into the same window the applet occupies.
  138. "_parent" : To load the link into the immediate FRAMESET parent.
  139. "_top"    : To load the link into the top body of the window.
  140.  
  141. Otherwise the frame name, for example "myframe1".
  142.  
  143. The size of the applet is determined by width and height tags.
  144.  
  145. The number of flozoids is determined by "numfloz" parameter: more flozoids
  146. mean slower execution.
  147.  
  148. The behaviour of flozoids can be altered with these parameters:
  149.  
  150. "flozdistance" : it determine how much a flozoid can go far from others
  151. "tocenter" : it determine the tendence to go to center of screen
  152. "acceleration" : it determine the acceleration power of flozoids
  153. "speed" : it determine the max speed a flozoid can reach
  154. "sidebouncing" : it determine the intensity of bouncing when edges of the
  155.                  applets are reached.
  156. "fheads" : it determine if flozoids have heads or not.
  157. "overtext" : it determine if flozoids can overwrite textscroll.
  158.  
  159. You can change the colours for best results over your web page, the RGB
  160. values are same as HTML tags, but in decimal values.
  161. Use backR,backG,backB to change background color.
  162.  
  163. If you want to display an image in the background, place it's name in the
  164. place of "NO" at backimage parameter (for example "back.jpg").
  165. The only requirement is that the background image must be same size as the
  166. applet to completely cover it.
  167.  
  168. About flozoids color, you can choose the first and last color of a gradient
  169. that will be spread over all the flozoids: flozR1,flozG1,flozB1 for first
  170. color, flozR2,flozG2,flozB2 for last color of gradient.
  171. Examples: to make ALL the flozoids white, place 255 as value for all the
  172. flozR1,flozG1,flozB1 and flozR2,flozG2,flozB2.
  173. To make flozoids coloured from black to white (all the intermediate grays),
  174. place a value of 255 for flozR1,flozG1,flozB1 and a value of 0 for second
  175. color: flozR2,flozG2,flozB2.
  176. Offcourse you can make rainbows (from red to blue, etc.).
  177.  
  178.  
  179.                              ---------
  180.  
  181.  
  182. Optional Scrolltext parameters:
  183.  
  184.  
  185. You can optionally activate a scrolltext that will scroll over the applet.
  186. If you don't need the scrolltext, deactivate it placing "NO" at the
  187. "textscroll" parameter.
  188. Otherwise you must supply the name of an ASCII text file, where you must
  189. write the text that you want to be scrolled.
  190. Is supported one only line of text, that can be long as you want.
  191. Remember to upload the text file too, if you activate the scrolltext!
  192.  
  193. If activated, here are the parameters:
  194.  
  195. With "textoffset" you choose the Y offset from the top: placing it to 0 the
  196. scroll will be placed on the top, for example, and placing a value near the
  197. height of the applet it will scroll at the bottom.
  198.  
  199. With "textspeed" parameter you decide the scrolling speed.
  200.  
  201. With "textfont" you choose the font of text. Don't choose a strange or not
  202. standard font, not present in all systems.
  203. The most common fonts are "Arial", "TimesRoman" and "Courier".
  204. If the required font is not present, the most "near" will be used.
  205.  
  206. Setting "textbold" to "YES" you will enlarge a bit the font, otherwise set
  207. it to "NO" for normal contours.
  208.  
  209. With "textsize" you can change the size of text font.
  210. The most common sizes are: 8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72.
  211. Intermediate values will be scaled to nearest available size.
  212.  
  213. Setting "textshadow" to "YES", a shadow will be added to textscroll.
  214. Otherwise, setting it to "NO", any shadow will be "projected".
  215.  
  216. You can choose the color of text with:
  217.  
  218. TextColR = Red component of color (0-255)
  219. TextColG = Green component of color (0-255)
  220. TextColB = Blue component of color (0-255)
  221.  
  222. For example, 0,0,0 is black, 255,255,255 is white, 255,0,0 is red,
  223. 255,255,0 is yellow, 128,128,128 is grey.
  224. You can compose any color you want, do it trying manually or use any paint
  225. program's color selector to find Red Green Blue components of your desired
  226. colors.
  227.  
  228. With TextSColR,TextSColG,TextSColB you can select the color for text shadow.
  229.  
  230. If you like, you can activate the text jumping function.
  231. If "TextJumpAmp" is set to "0", any jumping will be shown.
  232. But increasing the value will result in text jumping: more aplitute, more
  233. high jumps.
  234.  
  235. With "TextJumpSpd" parameter you can select the jumping speed.
  236.  
  237. If you like, you can also activate the sine scroll function.
  238. If "TextSineAmp" is set to 0, no sine distortion will be generated.
  239. But increasing the value will result in the that the text is waving. The
  240. higher amplitude, the more waving.
  241.  
  242. With the "TextSineSpd" parameter you can select the speed of the wave.
  243.  
  244. With the "TextSineAngle" parameter you control how many degrees in a sinewave
  245. shape the text will be deformed for each pixel. A higher value gives more
  246. distortion.
  247.  
  248.  
  249.                              ---------
  250.  
  251.  
  252. Compatibility parameters:
  253.  
  254.  
  255. The "memdelay" parameter is useful only to run the applets without problems
  256. on some bugged versions of Netscape 3, that don't deallocate correctly
  257. the memory allocated, resulting in filling all the memory after a minute
  258. the applet is running. This can cause also a system crash in some cases.
  259. Last versions of browsers have fixed this problem, but if you want to run
  260. the applets on old bugged browsers too, set "memdelay" to low values, like
  261. "10" or "16", for example.
  262. But this will slow down a lot the applet speed, so you have to choose
  263. between speed (memdelay set to 1000 or higher) or slow compatibility with
  264. old browsers (memdelay set to 20 or lower).
  265.  
  266. The "priority" parameter is useful mainly when you are running more than
  267. one applet in same page, and one slows down or hangs.
  268. If this applet run too slow or hangs because other one steal all the CPU
  269. power, try increasing the priority.
  270. Otherwise, if this applet runs well and others slows down, decrease the
  271. priority. Consider the min priority is 1, normal priority is 5, and the
  272. max priority is 10. Usually a priority of 3 is ok for single applets.
  273.  
  274. The "MinSYNC" parameter must be set to a value between 8 and 16 to slow
  275. down animation in the case it runs too faster on faster computers or because
  276. the applet size is very small. The optimal value seems to be 10, but you can
  277. disable this feature placing a value of 0 if you see flickerings or excessive
  278. slow down.
  279. If the applets steal 100% of CPU power or slows down the browser and Operating
  280. System, try increasing MinSYNC until all runs ok.
  281. Usually values between 40 and 400 fixes all problems, even if applet slows
  282. down for compatibility.
  283.  
  284.  
  285.                              ---------
  286.  
  287.  
  288. Copyright and distribution notices
  289.  
  290.  
  291. Fabio Ciucci is the author and owner of this applet.
  292. You can use freely this applet to enhance your web pages. But since I am
  293. the author of the applet, I placed a secret linkware window that will appear
  294. if the applet is clicked with mouse, only when the applet is online on a site:
  295. it is external to the web browser, so it will not hit the design of your
  296. beautyful html page.
  297. This small window will simply show my name and ask for a link to my java
  298. applets page.. the user can connect to it or cancel, or hide the window and
  299. connect after visiting all your pages.
  300. I hope this credit part is not a problem for you...
  301. In any case, if link is accepted a new browser window will appear and your
  302. page will remain on the original window, so you will not lost the visitor.
  303. Consider you will use an effect programmed by me, without pay, for FREE!
  304.  
  305. NOTE: You can include the applets archive on CD-ROMS or shareware collections
  306. and shareware sites without ask me, but only if you leave the archive(s)
  307. unchanged.
  308.  
  309.                              ---------
  310.  
  311.  
  312.  
  313. Fabio Ciucci (Randy/Ram Jam)
  314.  
  315. fabioc@anfiteatro.it
  316.  
  317. http://www.anfiteatro.it/java.html
  318.  
  319.  
  320.