[Programming Game] presents a gift at the age of a new year. (Ignition of fireworks at langtse on the 2-storey building) (Modified from free_wind22 on the 169 floor)
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]
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" <br/> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br/> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br /> <pead> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <br/> <meta http-equiv =" Description "content =" New Year gala v1.10 "/> <br/> <meta http-equiv = "author" content = "langtse"/> <br/> <title> [New Year's Eve programming game 2009] -- Ignition your wishes and gifts! -V1.10 </title> <br/> <style type = "text/CSS"> <br/> * {overflow: hidden ;}< br/> HTML, body {Background: #000; Height: 100%; margin: 0px; padding: 0px; color: # fff ;}< br/>. ball {color: # ff0000; position: absolute; font-size: 6px ;}< br/>. star {color: # ff0000; position: absolute; font-size: 12px ;} <br/> </style> <br/> <SCRIPT type = "text/JavaScript"> </P> <p> /////////// /// // | | /////////// //////////////////////////////////////// ///// <Br/> /// script code area, do not change it at will! //// </P> <p> function random (Nmin, Nmax) <br/>{< br/> return math. round (math. random () * (Nmax-Nmin) + Nmin); <br/>}< br/> function filler (Nmin, Nmax) <br/>{< br/> This. result = ""; <br/> This. amount = random (10, 20); <br/> for (var abaqus = 0; ABAQUS <this. amount; ABAQUS ++) <br/>{< br/> This. result + = string. fromcharcode (random (Nmin, Nmax); <br/>}< br/> return this. result; <br/>}< br/> function firework (sky, loop, wish ){ <Br/> This. Index = 0; <br/> This. Wish = wish? Wish: "Happy New Year"; <br/> This. sky = sky; <br/> This. skywidth = document. body. clientwidth | document.doc umentelement. clientwidth; <br/> This. skyheight = document. body. clientheight | document.doc umentelement. clientheight; <br/> This. X = 0; <br/> This. y = 0; <br/> This. step = 20; <br/> This. delay = 30; <br/> This. stars = []; <br/> This. R = 10; <br/> This. step 2 = 7; <br/> This. radius = random (60,180); <br/> This. angle = 45; <br/> This. num = This. wish. length; <br/> This. loop = loop; <br/>}< br/> firework. prototype = {<br/> init: function () {<br/> This. X = parseint (this. skywidth/2 * Math. random () + this. skywidth/4); <br/> This. y = This. skyheight; <br/> This. _ y = parseint (this. skyheight/4) * Math. random () + this. skyheight/5); <br/>}, <br/> show: function () {<br/> var B = document. createelemen T ("Div"); <br/> B. innerhtml = "●"; <br/> B. classname = "ball"; <br/> B. style. left = This. X + "PX"; <br/> B. style. top = This. Y + "PX"; <br/> This. ball = B; <br/> This. sky. appendchild (this. ball); <br/>}, <br/> hide: function () {<br/> This. sky. removechild (this. ball); <br/> This. ball = NULL; <br/>}, <br/> hidestars: function () {<br/> for (VAR I = 0; I <this. num; I ++) {<br/> This. sky. removechild (this. s Tars [I]); <br/> This. stars [I] = NULL; <br/>}< br/> If (this. loop) {<br/> This. play (); <br/>}< br/> This. index ++; <br/>}, <br/> setstarpos: function () {<br/> for (VAR I = 0; I <this. num; I ++) {<br/> var P = parseint (this. r/This. radius * 10); <br/> This. stars [I]. style. left = This. x-parseint (this. R * Math. sin (I * This. angle) + "PX"; <br/> This. stars [I]. style. top = This. y-parseint (this. R * Math. Cos (I * This. angle) + "PX"; <br/> This. stars [I]. style. fontsize = 6 + P + "PX"; <br/>}< br/>}, <br/> showstars: function () {<br/> If (this. index> This. wish. length-1) {This. index = 0 ;}< br/> var angles = [15, 30, 45, 60]; <br/> var Maxs = [20, 12, 6, 10]; <br/> var colors = ['# ff0000', '# 00ff00',' # 0000ff ',' # ffff00', '# 00ffff']; <br/> var Rand = random (0, Maxs. length-1); <br/> This. R = 10; <br/> This. num = Random (6, 20); <br/> This. angle = angles [Rand]; <br/> for (VAR I = 0; I <this. num; I ++) {<br/> This. stars [I] = document. createelement ("Div"); <br/> If (! This. stars [I]) {break;} <br/> This. stars [I]. innerhtml = This. wish. charat (this. index); <br/> This. stars [I]. classname = "star"; <br/> This. stars [I]. style. color = colors [random (0, colors. length-1)]; <br/> This. sky. appendchild (this. stars [I]); <br/>}< br/>}, <br/> movestars: function () {<br/> var self = this; <br/> If (this. r <this. radius) {<br/> var P = This. step 2-parseint (this. r/This. radius * 5 ); <Br/> P = P <1? 1: P; <br/> This. R + = P; <br/> This. setstarpos (); <br/> setTimeout (function () {self. movestars () ;}, this. delay); <br/>}else {<br/> setTimeout (function () {self. hidestars ();}, 300 x math. random (); <br/>}< br/>}, <br/> fire: function () {<br/> This. hide (); <br/> This. showstars (); <br/> This. movestars (); <br/>}, <br/> move: function () {<br/> var self = This; <br/> If (this. y> This. _ y) {<br/> var P = Parseint (this. skyheight-this. y)/(this. skyheight-this. _ y) * 10); <br/> This. y-= (this. step-p * 1.6); <br/> This. ball. style. fontsize = 12-P + "PX"; <br/> This. ball. style. top = This. Y + "PX"; <br/> setTimeout (function () {self. move () ;}, this. delay); <br/>}else {<br/> This. fire (); <br/>}< br/>}, <br/> play: function () {<br/> This. init (); <br/> This. show (); <br/> This. move (); <br/>}< br />}; </P> <p> window. onload = function () <br/>{< br/> var mywish; <br/> //////////////////////////////////// //// // | //////////////////////// /// // <br/> //// new Year's wishing area, please make your wish! //// <Br/> mywish = ["★☆◎ ◇ ※ ※○ @ ■ △ ", <Br/>" please vote for me "," Congratulations to Spring Festival ", <br/>" Happy New Year ", <br/> filler (19968,40869)]; </P> <p> ///////////////////////////////// /// // | ///////////////////// /// // <br/>/ /// fireworks display area, please pay attention to security! //// <Br/> for (VAR iwish = 0; iwish <random (1, mywish. length + 1); iwish ++) <br/>{< br/> New firework (document. body, true, mywish [iwish]). play (); <br/>}< br/> }; </P> <p> </SCRIPT> <br/> </pead> </P> <p> <body> <br/> </body> <br/> </ptml> <br/>
Ignition[Ctrl + A select all tips: you can modify some code and then press run]
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.