当前位置:首页 > 黑客业务 > 正文内容

关于cjs实现黑客帝国的信息

hacker3年前 (2022-07-18)黑客业务96

本文目录一览:

html5黑客帝国下面代码大概什么意思呀。谢啦

HTML:

canvas id="c"/canvas

CSS:

canvas {display: block;}

JS:

var c = document.getElementById("c");

var ctx = c.getContext("2d");

//全屏

c.height = window.innerHeight;

c.width = window.innerWidth;

//文字

var txts = "0123456789";

//转为数组

txts = txts.split("");

var font_size = 16;

var columns = c.width/font_size;

//用于计算输出文字时坐标,所以长度即为列数

var drops = [];

//初始值

for(var x = 0; x columns; x++)

drops[x] = 1;

//输出文字

function draw()

{

//让背景逐渐由透明到不透明

ctx.fillStyle = "rgba(0, 0, 0, 0.05)";

ctx.fillRect(0, 0, c.width, c.height);

ctx.fillStyle = "#0F0"; //文字颜色

ctx.font = font_size + "px arial";

//逐行输出文字

for(var i = 0; i drops.length; i++)

{

//随机取要输出的文字

var text = txts[Math.floor(Math.random()*txts.length)];

//输出文字,注意坐标的计算

ctx.fillText(text, i*font_size, drops[i]*font_size);

//如果绘满一屏或随机数大于0.95(此数可自行调整,效果会不同)

if(drops[i]*font_size c.height || Math.random() 0.95)

drops[i] = 0;

//用于Y轴坐标增加

drops[i]++;

}

}

setInterval(draw, 33);

解释了的很详细了。

求"黑客帝国"里电脑屏幕上的"代码"不间断滚动的代码,

把下面复制到记事本,另存为HTML文件。你可以自己DIY一下。

html

head

title类似黑客帝国的01数字流/title

/head

body bgcolor=#000000

script language="JavaScript"

!--

if (document.all){

Cols=6;

Cl=24;//Space's are included so real length is 48!

Cs=10;

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

I=Cs;

Sp=new Array();S=new Array();Y=new Array();

C=new Array();M=new Array();B=new Array();

RC=new Array();E=new Array();Tcc=new Array(0,1);

document.write("div id='Container' style='position:absolute;top:0;left:-"+Cs+"'");

document.write("div style='position:relative'");

for(i=0; i Cols; i++){

S[i]=I+=Cs;

document.write("div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"

+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'/div");

}

document.write("/div/div");

for(j=0; j Cols; j++){

RC[j]=1+Math.round(Math.random()*Cl);

Y[j]=0;

Sp[j]=Math.round(MnS+Math.random()*MxS);

for(i=0; i RC[j]; i++){

B[i]='';

C[i]=Math.round(Math.random()*1)+' ';

M[j]=B[0]+=C[i];

}

}

function Cycle(){

Container.style.top=window.document.body.scrollTop;

for (i=0; i Cols; i++){

var r = Math.floor(Math.random()*Tcc.length);

E[i] = 'font color='+Tc1+''+Tcc[r]+'/font';

Y[i]+=Sp[i];

if (Y[i] window.document.body.clientHeight){

for(i2=0; i2 Cols; i2++){

RC[i2]=1+Math.round(Math.random()*Cl);

for(i3=0; i3 RC[i2]; i3++){

B[i3]='';

C[i3]=Math.round(Math.random()*1)+' ';

C[Math.floor(Math.random()*i2)]=' '+' ';

M[i]=B[0]+=C[i3];

Y[i]=-Ts*M[i].length/1.5;

A[i].style.visibility='visible';

}

Sp[i]=Math.round(MnS+Math.random()*MxS);

}

}

A[i].style.top=Y[i];

A[i].innerHTML=M[i]+' '+E[i]+' ';

}

setTimeout('Cycle()',20)

}

Cycle();

}

// --

/script

body

/body

/html

用C语言编个像黑客帝国的那种的01数字瀑布

没时间做,但给你个思路:

主要的类:Class TextBar,应该包含字串变量保存要显示字符,还应包含一个贴图资源,作为字符绘制后的颜色mask,呈现出文字渐变效果;应该包含的基本方法:绘制(实现字符由上到下绘制以及贴图);衍生的其它子程序都是围绕这个功能的,例如计算字符位置,贴图位置,产生,消失等。

主类:与TextBar是聚合关系或组合关系。创建TextBar实例并给予其初始化值和位置。

黑客帝国--绿色字母雨代码--知道的进

BODY

script language="JavaScript"

!--

if (document.all){

Cols=6;

Cl=24;//Space's are included so real length is 48!

Cs=10;

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

I=Cs;

Sp=new Array();S=new Array();Y=new Array();

C=new Array();M=new Array();B=new Array();

RC=new Array();E=new Array();Tcc=new Array(0,1);

document.write("div id='Container' style='position:absolute;top:0;left:-"+Cs+"'");

document.write("div style='position:relative'");

for(i=0; i Cols; i++){

S[i]=I+=Cs;

document.write("div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"

+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'/div");

}

document.write("/div/div");

for(j=0; j Cols; j++){

RC[j]=1+Math.round(Math.random()*Cl);

Y[j]=0;

Sp[j]=Math.round(MnS+Math.random()*MxS);

for(i=0; i RC[j]; i++){

B[i]='';

C[i]=Math.round(Math.random()*1)+' ';

M[j]=B[0]+=C[i];

}

}

function Cycle(){

Container.style.top=window.document.body.scrollTop;

for (i=0; i Cols; i++){

var r = Math.floor(Math.random()*Tcc.length);

E[i] = 'font color='+Tc1+''+Tcc[r]+'/font';

Y[i]+=Sp[i];

if (Y[i] window.document.body.clientHeight){

for(i2=0; i2 Cols; i2++){

RC[i2]=1+Math.round(Math.random()*Cl);

for(i3=0; i3 RC[i2]; i3++){

B[i3]='';

C[i3]=Math.round(Math.random()*1)+' ';

C[Math.floor(Math.random()*i2)]=' '+' ';

M[i]=B[0]+=C[i3];

Y[i]=-Ts*M[i].length/1.5;

A[i].style.visibility='visible';

}

Sp[i]=Math.round(MnS+Math.random()*MxS);

}

}

A[i].style.top=Y[i];

A[i].innerHTML=M[i]+' '+E[i]+' ';

}

setTimeout('Cycle()',20)

}

Cycle();

}

// --

/script

演示地址:

注:必须要有body标签~

扫描二维码推送至手机访问。

版权声明:本文由黑客平台在线接单_免费黑客平台的网站发布,如需转载请注明出处。

本文链接:http://heikexuexi.com/62800.html

分享给朋友:

“关于cjs实现黑客帝国的信息” 的相关文章

西部志愿者工作总结

西部志愿者工作总结

                                                                                               许多 人应该有自愿 的经验 ,更紧的应该是作为一个图书馆 自愿 。自愿 运动 是一种通知 爱和传播 文化的风格...

 个人简历自我介绍

个人简历自我介绍

                                                                                               一个孬的毛遂自荐 每每 可以或许 给供职者的小我 简历添分,也是小我 简历外异常 主要 的构成 部门 。昨天正...

给未来自己的一封信

给未来自己的一封信

                                                                                               未来 本身 :你懦弱!当你读到一个地方的怀疑时,你能成为一个稳定的父亲和孩子吗?二的未来 是二给未来 本身 的...

简短的个人工作总结,精选

简短的个人工作总结,精选

                                                                                               事情 总结和处理 我们每个人的事情 说长度 通常主要 让我们吗?对于前一个空洞的事情 停止一个有用的 总结,找...

写给朋友的感谢信简短

写给朋友的感谢信简短

                                                                                               开开同伙 的赞助 写给同伙 的感激 疑惑,二的懦夫 ,开你在战尔一路 的两年面,给二带来了那么多的经验 战懂...

电力企业管理培训心得

电力企业管理培训心得

                                                                                               这是尔第一次进职电力企业治理 培训口吃,这是每个人不断塑造战争晋升 本身 的主要 课程。带着新颖 的好奇心等待...

评论列表

纵遇俗野
3年前 (2022-07-18)

ntext("2d");//全屏c.height = window.innerHeight;c.width = window.innerWidth;//文字var txts = "0123456789";//转为数组txts = txts

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。