欢迎光临
我们一直在努力

用ASP编写的俄罗斯方块游戏-ASP教程,ASP技巧

建站超值云服务器,限时71元/月

<%if not request.querystring(“ven”) = “t” then%>
<html>
<head>
<meta name=”generator” content=”microsoft visual studio 6.0″>
<title></title>
</head>
<script language=vbscript>
function redir()
window.open “<%= right(request.servervariables(“script_name”),len(request.servervariables(“script_name”))-instrrev(request.servervariables(“script_name”),”/”,len(request.servervariables(“script_name”))))%>?ven=t”,”user”,”status=no,toolbar=no,menubar=no,height=456,width=304,top=100,left=100,scrollbars=no”
window.history.back(-1)
end function
</script>
<body onload=redir()>
</body>
</html>
<%else%>
<html>
<head>
<meta name=”generator” content=”microsoft visual studio 6.0″>
<title>**vbscript俄罗斯方块游戏**</title>
<style type=”text/css”>
<!–
.normalhi{font-family:verdana,helvetica,arial,sans serif;color:#ffcc00;font-size:10pt;font-weight:bold;cursor:hand;}
.normalh{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;cursor:hand;}
.normalg{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:13pt;font-weight:bold;}
.normal{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;}
.normald{font-family:verdana,helvetica,arial,sans serif;color:#000000;font-size:10pt;font-weight:bold;}
.normali{font-family:verdana,helvetica,arial,sans serif;color:#00ff00;font-size:10pt;font-weight:bold;}
.normalo{font-family:verdana,helvetica,arial,sans serif;color:#ffff00;font-size:10pt;font-weight:bold;}
–>
</style>
</head>
<body topmargin=2 leftmargin=2>
<div align=”center”>
<center>
<table border=”0″ width=”300″ cellspacing=”0″ cellpadding=”0″><tr><td width=”200″>
<center>
<table border=”1″ bordercolor=”#000000″ cellspacing=”0″ cellpadding=”0″ bgcolor=”#000000″>
<tr height=”18″>
<td id=”240″ width=”18″></td><td id=”241″ width=”18″></td><td id=”242″ width=”18″></td><td id=”243″ width=”18″></td><td id=”244″ width=”18″></td>
<td id=”245″ width=”18″></td><td id=”246″ width=”18″></td><td id=”247″ width=”18″></td><td id=”248″ width=”18″></td><td id=”249″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”230″ width=”18″></td><td id=”231″ width=”18″></td><td id=”232″ width=”18″></td><td id=”233″ width=”18″></td><td id=”234″ width=”18″></td>
<td id=”235″ width=”18″></td><td id=”236″ width=”18″></td><td id=”237″ width=”18″></td><td id=”238″ width=”18″></td><td id=”239″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”220″ width=”18″></td><td id=”221″ width=”18″></td><td id=”222″ width=”18″></td><td id=”223″ width=”18″></td><td id=”224″ width=”18″></td>
<td id=”225″ width=”18″></td><td id=”226″ width=”18″></td><td id=”227″ width=”18″></td><td id=”228″ width=”18″></td><td id=”229″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”210″ width=”18″></td><td id=”211″ width=”18″></td><td id=”212″ width=”18″></td><td id=”213″ width=”18″></td><td id=”214″ width=”18″></td>
<td id=”215″ width=”18″></td><td id=”216″ width=”18″></td><td id=”217″ width=”18″></td><td id=”218″ width=”18″></td><td id=”219″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”200″ width=”18″></td><td id=”201″ width=”18″></td><td id=”202″ width=”18″></td><td id=”203″ width=”18″></td><td id=”204″ width=”18″></td>
<td id=”205″ width=”18″></td><td id=”206″ width=”18″></td><td id=”207″ width=”18″></td><td id=”208″ width=”18″></td><td id=”209″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”190″ width=”18″></td><td id=”191″ width=”18″></td><td id=”192″ width=”18″></td><td id=”193″ width=”18″></td><td id=”194″ width=”18″></td>
<td id=”195″ width=”18″></td><td id=”196″ width=”18″></td><td id=”197″ width=”18″></td><td id=”198″ width=”18″></td><td id=”199″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”180″ width=”18″></td><td id=”181″ width=”18″></td><td id=”182″ width=”18″></td><td id=”183″ width=”18″></td><td id=”184″ width=”18″></td>
<td id=”185″ width=”18″></td><td id=”186″ width=”18″></td><td id=”187″ width=”18″></td><td id=”188″ width=”18″></td><td id=”189″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”170″ width=”18″></td><td id=”171″ width=”18″></td><td id=”172″ width=”18″></td><td id=”173″ width=”18″></td><td id=”174″ width=”18″></td>
<td id=”175″ width=”18″></td><td id=”176″ width=”18″></td><td id=”177″ width=”18″></td><td id=”178″ width=”18″></td><td id=”179″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”160″ width=”18″></td><td id=”161″ width=”18″></td><td id=”162″ width=”18″></td><td id=”163″ width=”18″></td><td id=”164″ width=”18″></td>
<td id=”165″ width=”18″></td><td id=”166″ width=”18″></td><td id=”167″ width=”18″></td><td id=”168″ width=”18″></td><td id=”169″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”150″ width=”18″></td><td id=”151″ width=”18″></td><td id=”152″ width=”18″></td><td id=”153″ width=”18″></td><td id=”154″ width=”18″></td>
<td id=”155″ width=”18″></td><td id=”156″ width=”18″></td><td id=”157″ width=”18″></td><td id=”158″ width=”18″></td><td id=”159″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”140″ width=”18″></td><td id=”141″ width=”18″></td><td id=”142″ width=”18″></td><td id=”143″ width=”18″></td><td id=”144″ width=”18″></td>
<td id=”145″ width=”18″></td><td id=”146″ width=”18″></td><td id=”147″ width=”18″></td><td id=”148″ width=”18″></td><td id=”149″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”130″ width=”18″></td><td id=”131″ width=”18″></td><td id=”132″ width=”18″></td><td id=”133″ width=”18″></td><td id=”134″ width=”18″></td>
<td id=”135″ width=”18″></td><td id=”136″ width=”18″></td><td id=”137″ width=”18″></td><td id=”138″ width=”18″></td><td id=”139″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”120″ width=”18″></td><td id=”121″ width=”18″></td><td id=”122″ width=”18″></td><td id=”123″ width=”18″></td><td id=”124″ width=”18″></td>
<td id=”125″ width=”18″></td><td id=”126″ width=”18″></td><td id=”127″ width=”18″></td><td id=”128″ width=”18″></td><td id=”129″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”110″ width=”18″></td><td id=”111″ width=”18″></td><td id=”112″ width=”18″></td><td id=”113″ width=”18″></td><td id=”114″ width=”18″></td>
<td id=”115″ width=”18″></td><td id=”116″ width=”18″></td><td id=”117″ width=”18″></td><td id=”118″ width=”18″></td><td id=”119″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”100″ width=”18″></td><td id=”101″ width=”18″></td><td id=”102″ width=”18″></td><td id=”103″ width=”18″></td><td id=”104″ width=”18″></td>
<td id=”105″ width=”18″></td><td id=”106″ width=”18″></td><td id=”107″ width=”18″></td><td id=”108″ width=”18″></td><td id=”109″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”90″ width=”18″></td><td id=”91″ width=”18″></td><td id=”92″ width=”18″></td><td id=”93″ width=”18″></td><td id=”94″ width=”18″></td>
<td id=”95″ width=”18″></td><td id=”96″ width=”18″></td><td id=”97″ width=”18″></td><td id=”98″ width=”18″></td><td id=”99″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”80″ width=”18″></td><td id=”81″ width=”18″></td><td id=”82″ width=”18″></td><td id=”83″ width=”18″></td><td id=”84″ width=”18″></td>
<td id=”85″ width=”18″></td><td id=”86″ width=”18″></td><td id=”87″ width=”18″></td><td id=”88″ width=”18″></td><td id=”89″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”70″ width=”18″></td><td id=”71″ width=”18″></td><td id=”72″ width=”18″></td><td id=”73″ width=”18″></td><td id=”74″ width=”18″></td>
<td id=”75″ width=”18″></td><td id=”76″ width=”18″></td><td id=”77″ width=”18″></td><td id=”78″ width=”18″></td><td id=”79″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”60″ width=”18″></td><td id=”61″ width=”18″></td><td id=”62″ width=”18″></td><td id=”63″ width=”18″></td><td id=”64″ width=”18″></td>
<td id=”65″ width=”18″></td><td id=”66″ width=”18″></td><td id=”67″ width=”18″></td><td id=”68″ width=”18″></td><td id=”69″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”50″ width=”18″></td><td id=”51″ width=”18″></td><td id=”52″ width=”18″></td><td id=”53″ width=”18″></td><td id=”54″ width=”18″></td>
<td id=”55″ width=”18″></td><td id=”56″ width=”18″></td><td id=”57″ width=”18″></td><td id=”58″ width=”18″></td><td id=”59″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”40″ width=”18″></td><td id=”41″ width=”18″></td><td id=”42″ width=”18″></td><td id=”43″ width=”18″></td><td id=”44″ width=”18″></td>
<td id=”45″ width=”18″></td><td id=”46″ width=”18″></td><td id=”47″ width=”18″></td><td id=”48″ width=”18″></td><td id=”49″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”30″ width=”18″></td><td id=”31″ width=”18″></td><td id=”32″ width=”18″></td><td id=”33″ width=”18″></td><td id=”34″ width=”18″></td>
<td id=”35″ width=”18″></td><td id=”36″ width=”18″></td><td id=”37″ width=”18″></td><td id=”38″ width=”18″></td><td id=”39″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”20″ width=”18″></td><td id=”21″ width=”18″></td><td id=”22″ width=”18″></td><td id=”23″ width=”18″></td><td id=”24″ width=”18″></td>
<td id=”25″ width=”18″></td><td id=”26″ width=”18″></td><td id=”27″ width=”18″></td><td id=”28″ width=”18″></td><td id=”29″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”10″ width=”18″></td><td id=”11″ width=”18″></td><td id=”12″ width=”18″></td><td id=”13″ width=”18″></td><td id=”14″ width=”18″></td>
<td id=”15″ width=”18″></td><td id=”16″ width=”18″></td><td id=”17″ width=”18″></td><td id=”18″ width=”18″></td><td id=”19″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”0″ width=”18″></td><td id=”1″ width=”18″></td><td id=”2″ width=”18″></td><td id=”3″ width=”18″></td><td id=”4″ width=”18″></td>
<td id=”5″ width=”18″></td><td id=”6″ width=”18″></td><td id=”7″ width=”18″></td><td id=”8″ width=”18″></td><td id=”9″ width=”18″></td>
</tr>
</table>
</center>
</td>
<td width=”100″>
<table border=”1″ bordercolor=”#000000″ height=”452″ width=”100″ cellspacing=”0″ cellpadding=”0″>
<tr height=”30″>
<td class=normalg align=center bgcolor=”#ffff00″>俄罗斯方块</td>
</tr>
<tr height=”20″>
<td class=normald align=center bgcolor=”#ffcc00″>提示区</td>
</tr>
<tr height=”100″>
<td bgcolor=”#ffcc00″>
<!– inicio preview –>
<div align=”center”><center><table border=”1″ cellspacing=”0″ cellpadding=”0″ bgcolor=”#000000″>
<tr height=”18″>
<td id=”p0″ width=”18″></td><td id=”p1″ width=”18″></td><td id=”p2″ width=”18″></td><td id=”p3″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”p4″ width=”18″></td><td id=”p5″ width=”18″></td><td id=”p6″ width=”18″></td><td id=”p7″ width=”18″></td>
</tr>
<tr height=”18″>
<td id=”p8″ width=”18″></td><td id=”p9″ width=”18″></td><td id=”p10″ width=”18″></td><td id=”p11″ width=”18″></td>
</tr>
</table></center></div>
<!– fin preview –>
</td>
</tr>
<tr height=”32″>
<td id=”sco01″ align=center bgcolor=”#009900″ class=normalh onmouseover=mmove(“i“) onmouseout=mmove(“o“)>得分</td>
</tr>
<tr height=”32″>
<td id=”sco02″ align=center bgcolor=”#ffff00″ class=normalh>0</td>
</tr>
<tr height=”32″>
<td id=”in01″ align=center bgcolor=”#009900″ class=normal onmouseover=mmove(“i“) onmouseout=mmove(“o“)>水平</td>
</tr>
<tr height=”32″>
<td id=”in02″ align=center bgcolor=”#ffff00″ class=normal>1</td>
</tr>
<tr height=”32″>
<td id=”in05″ align=center bgcolor=”#009900″ class=normalh onmouseover=mmove(“i“) onmouseout=mmove(“o“)>块</td>
</tr>
<tr height=”32″>
<td id=”in06″ align=center bgcolor=”#ffff00″ class=normalh>1</td>
</tr>
<tr height=”32″>
<td id=”in03″ align=center bgcolor=”#009900″ class=normalh onclick=iniciar(“i“) onmouseover=mmove(“i“) onmouseout=mmove(“o“)>开始</td>
</tr>
<tr height=”32″>
<td id=”in04″ align=center bgcolor=”#009900″ class=normalh onclick=iniciar(“d“) onmouseover=mmove(“i“) onmouseout=mmove(“o“)>结束</td>
</tr>
<tr height=”38″>
<td id=”in09″ align=center bgcolor=”#009900″ class=normalh onclick=self.close() onmouseover=mmove(“i“) onmouseout=mmove(“o“)>关闭窗口</td>
</tr>
</table>
</td></tr></table></center></div>
</body>
<script language=vbscript>
dim timer1,hastini,levlini,namn,score,levl,hast,fig,fig2,farg,farg2,x,y,rot,rot2,tratt,pausa,scrpau,pos,gover
dim hs(),sor(),hsant(),n(),s(),s2(),s3()
redim hs(3, 15, 2):redim sor(3, 15):redim hsant(3):redim n(10, 25):redim s(5, 4):redim s2(4, 4):redim s3(4, 4)
levlini = 1
pausa = false
hastini = vellevel(levlini)
hast = hastini
levl = levlini
pos = levl – 1
colorform
gover = false
function iniciar(ind)
if ind = “i” then
score = 0
gover = false
hast = hastini
levl = levlini
pos = poslevel(levl)
for i = 1 to 4:for i2 = 1 to 4:s2(i, i2) = false:next:next
for i = 1 to 10:for i2 = 1 to 25:n(i, i2) = false:next:next
timer1 = window.setinterval(“andar()”,hast)
colorform
fig2 = 0
nyfig
else
window.clearinterval timer1
end if
end function
sub nyfig()
pos = pos + 1
document.all(“in06”).innertext = pos
select case pos
case 30: levl = 2: hast = vellevel(levl): window.in02.innertext = levl
case 60: levl = 3: hast = vellevel(levl): window.in02.innertext = levl
case 90: levl = 4: hast = vellevel(levl): window.in02.innertext = levl
case 120: levl = 5: hast = vellevel(levl): window.in02.innertext = levl
case 150: levl = 6: hast = vellevel(levl): window.in02.innertext = levl
case 180: levl = 7: hast = vellevel(levl): window.in02.innertext = levl
case 210: levl = 8: hast = vellevel(levl): window.in02.innertext = levl
case 240: levl = 9: hast = vellevel(levl): window.in02.innertext = levl
case 270: levl = 10: hast = vellevel(levl): window.in02.innertext = levl
case 300: levl = 11: hast = vellevel(levl): window.in02.innertext = levl
end select
window.clearinterval timer1
timer1 = window.setinterval(“andar()”,hast)
fig = fig2
farg = farg2
fig2 = int(rnd * 7) + 1
x = 4
y = 26
rot = 1
for i = 1 to 4:for i2 = 1 to 4:s(i, i2) = s2(i, i2):s2(i, i2) = 0:next:next
select case fig2
case 1:s2(2, 2) = true:s2(3, 2) = true:s2(2, 3) = true:s2(3, 3) = true:farg2 = “#ff0000”
case 2:s2(1, 2) = true:s2(2, 2) = true:s2(3, 2) = true:s2(4, 2) = true:farg2 = “#33cc33”
case 3:s2(2, 1) = true:s2(3, 1) = true:s2(3, 2) = true:s2(3, 3) = true:farg2 = “#ff9900”
case 4:s2(3, 1) = true:s2(2, 1) = true:s2(2, 2) = true:s2(2, 3) = true:farg2 = “#666666”
case 5:s2(3, 1) = true:s2(3, 2) = true:s2(3, 3) = true:s2(2, 2) = true:farg2 = “#cc00cc”
case 6:s2(2, 1) = true:s2(2, 2) = true:s2(3, 2) = true:s2(3, 3) = true:farg2 = “#6666ff”
case 7:s2(3, 1) = true:s2(3, 2) = true:s2(2, 2) = true:s2(2, 3) = true:farg2 = “#33cccc”
end select
for i = 1 to 4
for i2 = 1 to 3
document.all(“p” & cstr(((i2 – 1) * 4 + i – 1))).bgcolor = “#000000”
if s2(i, i2) = true then
document.all(“p” & cstr((i2 – 1) * 4 + i – 1)).bgcolor = farg2
end if
next
next
end sub
function poslevel(lev)
select case lev
case 1: poslevel = 1
case 2: poslevel = 51
case 3: poslevel = 81
case 4: poslevel = 111
case 5: poslevel = 141
case 6: poslevel = 181
case 7: poslevel = 221
case 8: poslevel = 261
case 9: poslevel = 301
case 10: poslevel = 341
end select
end function
“いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい
function vellevel(velo)
select case velo
case 1: vellevel = 500
case 2: vellevel = 450
case 3: vellevel = 400
case 4: vellevel = 350
case 5: vellevel = 300
case 6: vellevel = 250
case 7: vellevel = 200
case 8: vellevel = 150
case 9: vellevel = 100
case 10: vellevel = 50
case 11: vellevel = 10
end select
end function
sub colorform()
for i = 0 to 11:document.all(“p” & cstr(i)).bgcolor = “#000000”:next
for i = 0 to 249:document.all(cstr(i)).bgcolor = “#000000”:next
end sub
function andar()
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true and y – i2 + 1 = 1 then fig = 0
if y – i2 > 0 and x + i – 1 > 0 and x + i – 1 < 11 then
if s(i, i2) = true and n(x + i – 1, y – i2) = true then fig = 0
end if
next
next
if fig = 0 then
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then n(x + i – 1, y – i2 + 1) = true
next
next
ner
nyfig
else
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true and s(i, i2 – 1) = false then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = “#000000”
end if
next
next
end if
y = y – 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then
if not gover = true then
if ucase(document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor) <> “#000000” and ucase(document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor) <> farg then
gameover
end if
end if
end if
if s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = farg
end if
next
next
end function
sub gameover()
msgbox “游戏结束!”, , “俄罗斯方块”
window.clearinterval timer1
gover = true
end sub
sub ner()
score = score + 10
document.all(“sco02”).innertext = score
for i2 = 25 to 1 step -1
ok = 1
for i = 1 to 10
if n(i, i2) = false then ok = 0
next
if ok = 1 then
score = score + 150
document.all(“sco02”).innertext = score
for i = 1 to 10
for i3 = i2 to 24
n(i, i3) = n(i, i3 + 1)
document.all(cstr(coor(i, i3))).bgcolor = document.all(cstr(coor(i, i3 + 1))).bgcolor
next
next
end if
next
end sub
function coor(xx, yy)
coor = (yy – 1) * 10 + xx – 1
end function
sub rota()
rot2 = rot + 1
if rot2 = 5 then rot2 = 1
if (fig = 2 or fig > 5) and rot2 = 3 then rot2 = 1
for i = 1 to 4
for i2 = 1 to 4
s3(i, i2) = 0
next
next
select case fig
case 2
select case rot2
case 1:s3(1, 2) = true:s3(2, 2) = true:s3(3, 2) = true:s3(4, 2) = true
case 2:s3(2, 1) = true:s3(2, 2) = true:s3(2, 3) = true:s3(2, 4) = true
end select
case 3
select case rot2
case 1:s3(2, 1) = true:s3(3, 1) = true:s3(3, 2) = true:s3(3, 3) = true
case 2:s3(4, 1) = true:s3(4, 2) = true:s3(3, 2) = true:s3(2, 2) = true
case 3:s3(3, 3) = true:s3(2, 3) = true:s3(2, 2) = true:s3(2, 1) = true
case 4:s3(2, 2) = true:s3(2, 1) = true:s3(3, 1) = true:s3(4, 1) = true
end select
case 4
select case rot2
case 1:s3(3, 1) = true:s3(2, 1) = true:s3(2, 2) = true:s3(2, 3) = true
case 2:s3(2, 1) = true:s3(3, 1) = true:s3(4, 1) = true:s3(4, 2) = true
case 3:s3(3, 1) = true:s3(3, 2) = true:s3(3, 3) = true:s3(2, 3) = true
case 4:s3(2, 1) = true:s3(2, 2) = true:s3(3, 2) = true:s3(4, 2) = true
end select
case 5
select case rot2
case 1:s3(3, 1) = true:s3(3, 2) = true:s3(3, 3) = true:s3(2, 2) = true
case 2:s3(3, 1) = true:s3(2, 2) = true:s3(3, 2) = true:s3(4, 2) = true
case 3:s3(2, 1) = true:s3(2, 2) = true:s3(2, 3) = true:s3(3, 2) = true
case 4:s3(2, 1) = true:s3(3, 1) = true:s3(4, 1) = true:s3(3, 2) = true
end select
case 6
select case rot2
case 1:s3(2, 1) = true:s3(2, 2) = true:s3(3, 2) = true:s3(3, 3) = true
case 2:s3(2, 2) = true:s3(3, 2) = true:s3(3, 1) = true:s3(4, 1) = true
end select
case 7
select case rot2
case 1:s3(3, 1) = true:s3(3, 2) = true:s3(2, 2) = true:s3(2, 3) = true
case 2:s3(2, 1) = true:s3(3, 1) = true:s3(3, 2) = true:s3(4, 2) = true
end select
end select
ok = 1
for i = 1 to 4
for i2 = 1 to 4
if s3(i, i2) = true then
if x + i – 1 < 1 or x + i – 1 > 10 or y – i2 + 1 < 1 then ok = 0
if ok = 1 then
if n(x + i – 1, y – i2 + 1) = true then ok = 0
end if
end if
next
next
if ok = 0 then exit sub
rot = rot2
for i = 1 to 4
for i2 = 1 to 4
if s3(i, i2) = true and s(i, i2) = false then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = farg
end if
if s3(i, i2) = false and s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = “#000000”
end if
s(i, i2) = s3(i, i2)
next
next
end sub
sub document_onkeydown
if window.event.keycode = 27 then msgbox “pause”,,”tet”
if window.event.keycode = 80 or window.event.keycode = 114 then iniciar(“d”)
if window.event.keycode = 113 then iniciar(“i”)
if not pausa = true then
if window.event.keycode = 38 and fig > 1 then rota
if window.event.keycode = 37 then
ok = 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true and x + i – 1 – 1 > 0 then
if n(x + i – 1 – 1, y – i2 + 1) = true then ok = 0
end if
if s(i, i2) = true and x + i – 1 – 1 < 1 then ok = 0
next
next
if ok = 1 then
x = x – 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then
if s(i + 1, i2) = false then
document.all(cstr(coor(x + i, y – i2 + 1))).bgcolor = “#000000”
end if
end if
if s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = farg
end if
next
next
end if
end if
if window.event.keycode = 39 then
ok = 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true and x + i – 1 + 1 < 11 then
if n(x + i – 1 + 1, y – i2 + 1) = true then ok = 0
end if
if s(i, i2) = true and x + i – 1 + 1 > 10 then ok = 0
next
next
if ok = 1 then
x = x + 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then
if s(i – 1, i2) = false then
document.all(cstr(coor(x + i – 2, y – i2 + 1))).bgcolor = “#000000”
end if
end if
if s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = farg
end if
next
next
end if
end if
“aqui
if window.event.keycode = 32 or window.event.keycode = 40 then
if fig > 0 then
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = “#000000”
end if
next
next
do
y = y – 1
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true and y – i2 + 1 = 1 then fig = 0
if y – i2 > 0 and x + i – 1 > 0 and x + i – 1 < 11 then
if s(i, i2) = true and n(x + i – 1, y – i2) = true then fig = 0
end if
next
next
loop until fig = 0
for i = 1 to 4
for i2 = 1 to 4
if s(i, i2) = true then
document.all(cstr(coor(x + i – 1, y – i2 + 1))).bgcolor = farg
end if
if s(i, i2) = true then n(x + i – 1, y – i2 + 1) = true
next
next
end if
end if
end if
end sub
function mmove(index)
if index = “i” then
document.all(window.event.srcelement.sourceindex).classname = “normalhi”
document.all(window.event.srcelement.sourceindex).bgcolor = “#0099cc”
else
document.all(window.event.srcelement.sourceindex).classname = “normalh”
document.all(window.event.srcelement.sourceindex).bgcolor = “#009900”
end if
end function
</script>
</html>
<%end if%> 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用ASP编写的俄罗斯方块游戏-ASP教程,ASP技巧
分享到: 更多 (0)