[Programming Game] presents a gift at the age of a new year. (Ignite the fireworks of kitegirl on the first floor of the resumed post)
Source: Internet
Author: User
[Programming Game] presents a gift at the age of a new year. (The first prize is 10000 available points)
Author:
Ignition[Ctrl + A select all tips: you can modify some code and then press run]
<HTML> <br/> <pead> <br/> <title> </title> <br/> </pead> <br/> <body bgcolor = "#000000 "text =" # ffffff "style =" overflow: hidden; "> <br/> <p id =" idinsertobject "> </P> <br/> </body> <br/> <SCRIPT type =" text/JavaScript "> <br/> function RGB (B, g, R) {<br/> return "#" + <br/> ("00" + math. floor (R ). tostring (16 )). replace (/^. * (/W {2} $)/g, "$1") + <br/> ("00" + math. floor (g ). tostring (16 )). replace (/^. * (/W {2} $)/g, "$1") + <br/> ("00" + math. floor (B ). tostring (16 )). replace (/^. * (/W {2} $)/g, "$1"); <br/>}< br/> function $ (ID) {return document. getelementbyid (ID) ;}</P> <p> var pubcellnumber <br/> var puborbits_x = new array (256*16 ); <br/> var puborbits_y = new array (256*16); <br/> var pubofflist = new array (256); <br/> var publimit_x = []; <br/> var publimit_y = []; <br/> var pubspanobjects = new array (32*16); <br/> var pubcolors = new array (256*16) <br/> var pubstepon = 0; <br/> var pubworkon = 0; <br/> var pubx = 0; <br/> var puby = 0; <br/> var pubscale = 0; <br/> var pubtime = 0; <br/> var pubcelllength = 0; <br/> var publightlength = 0; <br/> var pubspeed = 0; <br/> var pubglimit = 0; </P> <p> window. onload = function () {<br/> pubcelllength = 24; <br/> publightlength = 15; </P> <p> createobjects (pubcelllength, publightlength ); <br/> createcolors (); <br/> createlimits (); <br/> newskyrocket (); <br/> showskyrocket (); <br/>}< br/> function newskyrocket () {<br/> pubx = math. floor (math. random () * 640); <br/> puby = math. floor (math. random () * 480); <br/> pubscale = math. random () * 1 + 1; <br/> pubstepon = 10; <br/> for (VAR tindex = 0; tindex <= pubcelllength; tindex ++) {<br/> pubofflist [tindex] = math. floor (math. random () * 20) + 44; <br/>}< br/> cellsclear (); <br/> createcolors (); <br/> createlimits (); <br/> pubtime = setTimeout ("showskyrocket ();", 10); <br/>}</P> <p> function showskyrocket () {<br/> If (pubworkon <64) {<br/> pubworkon ++; <br/> If (pubspeed> 3) pubspeed = pubspeed-2; <br/> viewobjects (pubcelllength, publightlength, pubscale, pubx, puby); <br/> cellsmove (puborbits_x, puborbits_y, publimit_x, publimit_y, pubcelllength, publightlength, pubspeed ); <br/> pubtime = setTimeout ("showskyrocket ();", 1); <br/>}else {<br/> pubworkon = 0; <br/> pubspeed = 24; <br/> newskyrocket (); <br/>}</P> <p> function viewobjects (pcelllength, plightlength, pscale, PX, Py) {<br/> for (VAR tindex = 0; tindex <= pcelllength; tindex ++) {<br/> for (VAR tlight = 0; tlight <= plightlength; tlight ++) {<br/> with (pubspanobjects [tindex * 256 + tlight]. style) {<br/> If (pubworkon> pubofflist [tindex] + (plightlength-tlight) {<br/> color = RGB (0, 0, 0 ); <br/>} else {<br/> color = pubcolors [tindex * 256 + 15]; <br/> trndbase = (plightlength-tlight) * pubscale; <br/> Top = puborbits_y [tindex * 256 + tlight] * pubscale + py + math. floor (math. random () * trndbase)-trndbase/2; <br/> trndbase = (plightlength-tlight) * pubscale; <br/> left = puborbits_x [tindex * 256 + tlight] * pubscale + px + math. floor (math. random () * trndbase)-trndbase/2; <br/>}</P> <p> function createobjects (pcelllength, plightlength) {<br/> for (VAR tindex = 0; tindex <= pcelllength; tindex ++) {<br/> for (VAR tlight = 0; tlight <= plightlength; tlight ++) {<br/> pubspanobjects [tindex * 256 + tlight] = document. createelement ("span"); <br/> with (pubspanobjects [tindex * 256 + tlight]) {<br/> innerhtml = ". "; <br/>}< br/> with (pubspanobjects [tindex * 256 + tlight]. style) {<br/> position = "absolute" <br/> color = RGB (0, 0, 0) <br/>}< br/> idinsertobject. appendchild (pubspanobjects [tindex * 256 + tlight]); <br/>}</P> <p> function createcolors () {<br/> var tcolor = new array (3); <br/> tcolor [0] = math. random () * 0.5 + 0.5; <br/> tcolor [1] = math. random () * 0.5 + 0.5; <br/> tcolor [2] = math. random () * 0.5 + 0.5; <br/> tcolor [math. floor (math. random () * 3)] = 1; <br/> for (VAR tcolorindex = 0; tcolorindex <br/> <button onclick = "viewpage (document. getelementbyid ('texteahtml '). value) "> ignition </button> [Ctrl + A select all prompt: you can modify some code and then press run] <br/>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.