<%If Not Request.QueryString("Ven") = "T" then%>
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
<%else%>
|
|
|
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
<%End If%>
[8] [9] [10] [11] [12] [13] [14]
