Well, its not a lvl rly... its like the first scenario, and i want that when u cross the first door u go to the second scenario.
This is my code:
Sync on ; sync rate 60
Global MonitorX
MonitorX=desktop width()
MonitorY=desktop height()
Set display mode MonitorX,MonitorY, 0
color backdrop rgb(50,175,250)
Maximize window
rem Imgenes''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rem Imagenes de Wilson
Load image "Media\WilsonPj\Wilson_Animacion_Corre_1.png" ,1
Load image "Media\WilsonPj\Wilson_Animacion_Corre1_izquierda.png" ,18
Load image "Media\WilsonPj\Wilson_Animacion_Corre_2.png" ,2
Load image "Media\WilsonPj\Wilson_Animacion_Corre2_izquierda.png" ,10
Load image "Media\WilsonPj\Wilson_Animacion_Corre_3.png" ,3
Load image "Media\WilsonPj\Wilson_Animacion_Corre3_izquierda.png" ,11
Load image "Media\WilsonPj\Wilson_Animacion_Corre_4.png" ,4
Load image "Media\WilsonPj\Wilson_Animacion_Corre4_izquierda.png" ,12
Load image "Media\WilsonPj\Wilson_Animacion_Corre_5.png" ,5
Load image "Media\WilsonPj\Wilson_Animacion_Corre5_izquierda.png" ,13
Load image "Media\WilsonPj\Wilson_Animacion_Corre_6.png" ,6
Load image "Media\WilsonPj\Wilson_Animacion_Corre6_izquierda.png" ,14
Load image "Media\WilsonPj\Wilson_Animacion_Cola_1.png" ,7
Load image "Media\WilsonPj\Wilson_Animacion_Cola1_izquierda.png" ,15
Load image "Media\WilsonPj\Wilson_Animacion_Cola_2.png" ,8
Load image "Media\WilsonPj\Wilson_Animacion_Cola2_izquierda.png" ,16
Load image "Media\WilsonPj\Wilson_Animacion_Cola_3.png" ,9
Load image "Media\WilsonPj\Wilson_Animacion_Cola3_izquierda.png" ,17
Load image "Media\WilsonPj\WilsonAgachado1.png" ,19
Load image "Media\WilsonPj\WilsonAgachado_izquierda.png" ,20
Load image "Media\WilsonPj\WilsonDuerme1.png" ,21
Load image "Media\WilsonPj\WilsonDuerme_izquierda.png" ,22
Load image "Media\WilsonPj\WilsonMuerde_1.png" ,23
Load image "Media\WilsonPj\WilsonMuerde_2.png" ,24
Load image "Media\WilsonPj\WilsonMuerde_3.png" ,25
Load image "Media\WilsonPj\WilsonMuerde1_izquierda.png" ,26
Load image "Media\WilsonPj\WilsonMuerde2_izquierda.png" ,27
Load image "Media\WilsonPj\WilsonMuerde3_izquierda.png" ,28
rem Enemigos
Load image "Media\Enemigos\Tiko's\WI_Lunatíko.png" ,29
Sprite 29,1750,490,29
Set sprite priority 29, 19
Hide sprite 29
Load image "Media\Enemigos\Tiko's\WI_Lunatíko2.png" ,30
Sprite 30,0,0,30
Set sprite priority 30, 19
Hide sprite 30
rem Escenario
Load image "Media\Escenarios\Playa\WI_Playa.png" , 1000
Sprite 1000, 0, 170, 1000
Set sprite priority 1000, 2
Load image "Media\Escenarios\Playa\WI_Playa_Fondo.png" , 1003
Sprite 1003, -25, 295, 1003
Load image "Media\Escenarios\Playa\WI Playa_Terreno_1.png" ,1001
Sprite 1001,0,580, 1001
Set sprite priority 1001, 1
Load image "Media\Escenarios\Playa\WI Playa_Terreno_2.png" ,1002
Sprite 1002,2480,580, 1002
Set sprite priority 1002, 1
Load image "Media\Escenarios\Jungla\WI_Puerta_Jungla.png" ,1004
Sprite 1004, 4300, 320, 1004
Set sprite priority 1004, 3
Rem Musica'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
load music "Media\Musica\Playa\WWM_Playa-Jungla1.mp3" ,1
loop music 1
set music volume 1, 50
Rem Sonidos''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Load sound "Media\Sonidos\WilsonSnds\chomp.wav" ,1
Set sound volume 1, 80
Load sound "Media\Sonidos\WilsonSnds\step7.wav" ,2
Set sound volume 2, 90
rem Data ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Global Fx
Fx=X
F2xE=1
F2x=X
Fy=0
Tx=225
Ty=140
Global X
X=MonitorX/2/2
Y=500
A=Y
AW=150
YW1=50
YW1O=YW1
YW2O=YW2
aYW=10
FxX=25
F2xX=4
WFxX=31.7
FxDL=MonitorX*-4+175+50
FxIL=-25
WxDL=775
WxIL=50
F2x=-25
F1Primero=1
F1Ultimo=5
F2Primero=1
F2Ultimo=1
FxIM=MonitorX/2
FxDM=MonitorX/2
Mordidas=1
WSpritePrimero=1
WSpriteUltimo=28
Global TerrenoPrimero
TerrenoPrimero=1001
Global TerrenoUltimo
TerrenoUltimo=1002
Contador=0
TikosN=1
Global TikoCDoI
TikoCDoI=1
Global TikoE
TikoE=1
Global WMTikoVisible
WMTikoVisible=0
Global WGolpeadoVisible
WGolpeadoVisible=0
WColaWait=100
WDuermeWait=60
WCorreWait=60
WSaltaWait1=100
WSaltaWait2=60
WAgachaWait=100
WMuerdeWait=100
For WilsonSprites= 1 to 28
Sprite WilsonSprites,0,0,WilsonSprites
Hide sprite WilsonSprites
Set sprite priority WilsonSprites,20
Next WilsonSprites
Global F1
Dim F1(100)
F1(1)=1000
F1(2)=1001
F1(3)=1002
F1(4)=29
F1(5)=1004
Global F1x
Dim F1x(100)
F1x(1)=Fx
F1x(2)=0
F1x(3)=2480
F1x(4)=1750
F1x(5)=4300
Global F1y
Dim F1y(100)
F1y(1)=170
F1y(2)=580
F1y(3)=580
F1y(4)=490
F1y(5)=320
Dim F2(100)
F2(1)=1003
Dim F2y(100)
F2y(1)=295
Dim Tikos(100)
Tikos(1)=29
Tikos(2)=30
rem Main loop '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Do
WilsonDerecha:
Do
If inkey$()<>"s"
If inkey$()<>"S"
If rightkey()=1
If leftkey()=1
Inc Contador, 2
gosub WD
Else
gosub WCD
Endif
Endif
Endif
Endif
If inkey$()="s" OR inkey$()="S" then gosub WSD
If downkey()=1 then gosub WAD
If inkey$()="a" OR inkey$()="A" then gosub WMD
If rightkey()=0
If leftkey()=1 then gosub WilsonIzquierda
endif
gosub WD
loop
WilsonIzquierda:
Do
If inkey$()<>"s"
If inkey$()<>"S"
If leftkey()=1
If rightkey()=1
Inc Contador, 2
gosub WI
else
gosub WCI
Endif
Endif
Endif
Endif
If inkey$()="s" OR inkey$()="S" then gosub WSI
If downkey()=1 then gosub WAI
If inkey$()="a" OR inkey$()="A" then gosub WMI
If leftkey()=0
If rightkey()=1 then goto WilsonDerecha
Endif
gosub WI
loop
Loop
Rem Subrutinas ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Rem Wilson Derecha ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WD:
DoITiko=1
WCaida=0
For WDD=1 to 40
For WDSprites=1 to 4
If WDSprites=1 then WDSprite=7
If WDSprites=2 then WDSprite=8
If WDSprites=3 then WDSprite=7
If WDSprites=4 then WDSprite=9
If Gravedad>20 then YW1=Gravedad*-1 : gosub WCSD
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite WDSprite, X, Y, WDSprite
Show sprite WDSprite ; WGolpeadoVisible=WDSprites
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WColaWait=120
Endif
sync
Wait WColaWait
Hide sprite WDSprite ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WDSprite)
if sprhit>0
while pixelcol(Terreno,WDSprite)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite WDSprite,X,Y,WDSprite
endwhile
endif
Next Terreno
If rightkey()=1 then Return
If leftkey()=1 then Return
If inkey$()="s" OR inkey$()="S" then Return
If downkey()=1 then Return
If inkey$()="a" OR inkey$()="A" then Return
If upkey()=1 then Gosub WArriba
Inc Contador, 1
Next WDSprites
Next WDD
Rem Wilson Duerme Derecha:
WCaida=0
DoITiko=1
Do
If rightkey()=1 then hide sprite 21 : Return
If leftkey()=1 then hide sprite 21 : Return
If inkey$()="s" OR inkey$()="S" then hide sprite 21 : Return
If downkey()=1 then hide sprite 21 : Return
If inkey$()="a" OR inkey$()="A" then hide sprite 21 : Return
If Gravedad>20 then YW1=0 : gosub WCSD
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite 21, X, Y+30, 21
Set Sprite priority 21,20
Show sprite 21 ; WGolpeadoVisible=21
sync
wait WDuermeWait
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WDuermeWait=80
Endif
Wait WDuermeWait
hide sprite 21 ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,21)
if sprhit>0
while pixelcol(Terreno,21)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite 21,X,Y,21
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Corre Derecha ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WCD:
WCaida=0
Do
For WCDSprite= 2 to 6
If rightkey()=0 then Return
If leftkey()=1 then Return
If inkey$()="s" OR inkey$()="S" then Return
If inkey$()="a" OR inkey$()="A" then Return
If F1x(1)=>FxDL AND X>=FxIM
For F1N=F1Primero to F1Ultimo
dec F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
dec F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
If X>=WxDL then return
inc X, WFxX
Endif
If WCDSprite=2 OR WCDSprite=5 then play sound 2
If Gravedad>40 then YW1=0 : gosub WCSD
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite WCDSprite, X, Y, WCDSprite
Show sprite WCDSprite ; WGolpeadoVisible=WCDSprite
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WCorreWait=80
Endif
sync
wait WCorreWait
hide sprite WCDSprite ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WCDSprite)
if sprhit>0
while pixelcol(Terreno,WCDSprite)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite WCDSprite,X,Y,WCDSprite
endwhile
endif
Next Terreno
Inc Contador, 1
Next WCDSprite
loop
Rem Wilson Salta Derecha ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WSD:
YW1=YW1O
WSDSprite=3
NumMordidas=0
play sound 2
Sprite 1,X+50,Y,1
Set sprite priority 1,20
show sprite 1 ; WGolpeadoVisible=1
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WSaltaWait1=120
Endif
sync
Wait WSaltaWait1
hide sprite 1 ; WGolpeadoVisible=0
Play sound 2
Inc Contador, 1
WCSD:
Do
If X<WxDL
If rightkey()=1
If F1x(1)=>FxDL AND X>=FxIM
For F1N=F1Primero to F1Ultimo
dec F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
dec F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
Inc X,WFxX
Endif
Endif
Endif
If X>WxIL
If rightkey()=0
If leftkey()=1
If F1x(1)=<FxIL AND X<=FxDM
DoITiko=4
For F1N=F1Primero to F1Ultimo
inc F1x(F1N), FxX/2
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
inc F2x, FxX/F2xX/2
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
Dec X,WFxX/2
Endif
Endif
Endif
Endif
If NumMordidas<>Mordidas
If inkey$()="a" OR inkey$()="A"
YW1=0
gosub WMDS
inc NumMordidas, 1
Endif
Endif
If YW1<=0 then WSDSprite=4
Dec Y,YW1
Sprite WSDSprite,X+50,Y,WSDSprite
Set sprite priority WSDSprite,20
Show sprite WSDSprite ; WGolpeadoVisible=WSDSprite
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WSaltaWait2=80
Endif
sync
wait WSaltaWait2
hide sprite WSDSprite ; WGolpeadoVisible=0
If YW1>-50 then dec YW1, aYW
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WSDSprite)
if sprhit>0
while pixelcol(Terreno,WSDSprite)=1
inc Y, YW1+50
Play sound 2
Return
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Agachado Derecha '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WAD:
WCaida=0
Do
If downkey()=0
Hide sprite 19
return
Endif
If Gravedad>20 then YW1=0 : gosub WCSD
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite 19,x+55,y+30,19
Set sprite priority 19,20
Show sprite 19 ; WGolpeadoVisible=19
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WAgachaWait=120
Endif
Sync
wait WAgachaWait
hide sprite 19 ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,19)
if sprhit>0
while pixelcol(Terreno,19)=1
WCaida=0
Gravedad=10
dec Y, 10
sprite 19,X,Y,19
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Muerde Derecha '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WMD:
Sprite 1,X+75,Y,1
Set sprite priority 1,20
show sprite 1 ; WGolpeadoVisible=1
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WMuerdeWait=120
Endif
sync
Wait WMuerdeWait
hide sprite 1 ; WGolpeadoVisible=0
Inc Contador, 1
WMDS:
Do
For WMDSSprite=23 to 25
If X<WxDL
If rightkey()=1
If F1x(1)=>FxDL AND X>=FxIM
For F1N=F1Primero to F1Ultimo
dec F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
dec F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
inc X,WFxX
Endif
Endif
Endif
If X>WxIL
If rightkey()=0
If leftkey()=1
If F1x(1)=<FxIL AND X<=FxDM
DoITiko=4
For F1N=F1Primero to F1Ultimo
inc F1x(F1N), FxX/2
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
inc F2x, FxX/F2xX/2
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
Dec X,WFxX/2
Endif
Endif
Endif
Endif
If WMDSSprite=23 then Play sound 1
Sprite WMDSSprite, X+75, Y, WMDSSprite
Set sprite priority WMDSSprite,20
Show sprite WMDSSprite ; WMTikoVisible=1
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WMuerdeWait=120
Endif
Sync
Wait WMuerdeWait
Hide sprite WMDSSprite ; WMTikoVisible=0
Inc Contador, 1
Next WMDSSprite
Return
loop
Rem Wilson Izquierda ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WI:
WCaida=0
For WDI=1 to 40
For WISprites= 1 to 4
If WISprites=1 then WISprite=15
If WISprites=2 then WISprite=16
If WISprites=3 then WISprite=15
If WISprites=4 then WISprite=17
If Gravedad>20 then YW1=0 : gosub WCSI
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite WISprite, X, Y, WISprite
Set sprite priority WISprite,20
Show sprite WISprite ; WGolpeadoVisible=WISprite
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WColaWait=120
Endif
Sync
Wait WColaWait
Hide sprite WISprite ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WISprite)
if sprhit>0
while pixelcol(Terreno,WISprite)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite WISprite,X,Y,WISprite
endwhile
endif
Next Terreno
If leftkey()=1 then Return
If rightkey()=1 then Return
If inkey$()="s" OR inkey$()="S" then Return
If downkey()=1 then Return
If inkey$()="a" OR inkey$()="A" then Return
If upkey()=1 then Gosub WArriba
Inc Contador, 1
Next WISprites
Next WDI
Rem Wilson Duerme Izquierda:
WCaida=0
Do
If leftkey()=1 then hide sprite 22 : Return
If rightkey()=1 then hide sprite 22 : Return
If inkey$()="s" OR inkey$()="S" then hide sprite 22 : Return
If downkey()=1 then hide sprite 22 : Return
If inkey$()="a" OR inkey$()="A" then hide sprite 22 : Return
If Gravedad>20 then YW1=0 : gosub WCSI
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite 22, X, Y+30, 22
Set Sprite priority 22,20
Show sprite 22 ; WGolpeadoVisible=WGolpeadoVisible
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WDuermeWait=80
Endif
sync
Wait WDuermeWait
Hide sprite 22 ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,22)
if sprhit>0
while pixelcol(Terreno,22)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite 22,X,Y,22
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Corre Izquierda ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WCI:
WCaida=0
Do
For WCISprites=10 to 14
If leftkey()=0 then Return
If rightkey()=1 then Return
If inkey$()="s" OR inkey$()="S" then Return
If inkey$()="a" OR inkey$()="A" then Return
If F1x(1)=<FxIL AND X<=FxDM
For F1N=F1Primero to F1Ultimo
inc F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
inc F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
If X<=WxIL
Return
Else
Dec X, WFxX
Endif
Endif
If WCISprites=10 OR WCISprites= 13 then play sound 2
If Gravedad>20 then YW1=0 : gosub WCSI
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite WCISprites, X, Y, WCISprites
Set sprite priority WCISprites,20
Show sprite WCISprites ; WGolpeadoVisible=WCISprites
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WCorreWait=80
Endif
Sync
wait WCorreWait
hide sprite WCISprites ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WCISprites)
if sprhit>0
while pixelcol(Terreno,WCISprites)=1
WCaida=0
Gravedad=10
dec Y, 5
sprite WCISprites,X,Y,WCISprites
endwhile
endif
Next Terreno
Inc Contador, 1
Next WCISprites
loop
Rem Wilson Salta Izquierda '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WSI:
YW1=YW1O
WSISprite=11
NumMordidas=0
play sound 2
Sprite 18,X-50,Y,18
Set sprite priority 18,20
show sprite 18 ; WGolpeadoVisible=18
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WSaltaWait1=120
Endif
sync
Wait WSaltaWait1
hide sprite 18 ; WGolpeadoVisible=0
play sound 2
Inc Contador, 1
WCSI:
Do
If X>WxIL
If leftkey()=1
If F1x(1)=<FxIL AND X<=FxDM
For F1N=F1Primero to F1Ultimo
inc F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
inc F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
dec X,WFxX
Endif
endif
Endif
If X<WxDL
If leftkey()=0
If Rightkey()=1
If F1x(1)=>FxDL AND X>=FxIM
DoITiko=3
For F1N=F1Primero to F1Ultimo
dec F1x(F1N), FxX/2
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
dec F2x, FxX/F2xX/2
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
inc X,WFxX/2
Endif
Endif
Endif
Endif
If NumMordidas<>Mordidas
If inkey$()="a" OR inkey$()="A"
YW1=0
gosub WMIS
inc NumMordidas, 1
Endif
Endif
If YW1<=0 then WSISprite=12
Dec Y,YW1
Sprite WSISprite,X-50,Y,WSISprite
Set sprite priority WSISprite,20
Show sprite WSISprite ; WGolpeadoVisible=WSISprite
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WSaltaWait2=80
Endif
sync
wait WSaltaWait2
hide sprite WSISprite ; WGolpeadoVisible=0
If YW1>=-50 then dec YW1, aYW
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,WSISprite)
if sprhit>0
while pixelcol(Terreno,WSISprite)=1
inc Y, YW1+50
Play sound 2
Return
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Agachado Derecha '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WAI:
WCaida=0
Do
If downkey()=0
Hide sprite 20
return
Endif
If Gravedad>20 then YW1=0 : gosub WCSI
If WCaida=1 AND Gravedad<50 then inc Gravedad, 10
inc Y, Gravedad : WCaida=1
Sprite 20,x-55,y+30,20
Set sprite priority 20,20
Show sprite 20 ; WGolpeadoVisible=20
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WAgachaWait=120
Endif
Sync
Wait WAgachaWait
Hide sprite 20 ; WGolpeadoVisible=0
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,20)
if sprhit>0
while pixelcol(Terreno,20)=1
WCaida=0
Gravedad=10
dec Y, 10
sprite 20,X,Y,20
endwhile
endif
Next Terreno
Inc Contador, 1
Loop
Rem Wilson Muerde Derecha '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WMI:
Sprite 18,X-75,Y,18
Set sprite priority 18,20
show sprite 18 ; WGolpeadoVisible=18
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WMuerdeWait=120
Endif
sync
Wait WMuerdeWait
hide sprite 18 ; WGolpeadoVisible=0
Inc Contador, 1
WMIS:
Do
For WMISSprites=26 to 28
If X>WxIL
If leftkey()=1
If F1x(1)=<FxIL AND X<=FxDM
For F1N=F1Primero to F1Ultimo
inc F1x(F1N), FxX
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
inc F2x, FxX/F2xX
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
dec X,WFxX
Endif
Endif
Endif
If X<WxDL
If leftkey()=0
If rightkey()=1
If F1x(1)=>FxDL AND X>=FxIM
DoITiko=3
For F1N=F1Primero to F1Ultimo
dec F1x(F1N), FxX/2
Sprite F1(F1N),F1x(F1N), F1y(F1N), F1(F1N)
Next F1N
If F2xE=1
dec F2x, FxX/F2xX/2
For F2N=F2Primero to F2Ultimo
Sprite F2(F2N),F2x, F2y(F2N), F2(F2N)
Next F2N
Endif
Else
inc X,WFxX/2
Endif
Endif
Endif
Endif
If WMISSprites=26 then Play sound 1
Sprite WMISSprites, X-75, Y, WMISSprites
Set sprite priority WMISSprites,20
Show sprite WMISSprites ; WMTikoVisible=1
If TikoE=1
If Contador=>4 then TikosN=2
If Contador<4 then TikosN=1
If Contador>=7 then Contador=0
If F1x(4)=>F1x(1)+2000 then TikoCDoI=2
If F1x(4)=<F1x(1)+1500 then TikoCDoI=1
Tiko(Tikos,TikosN)
Else
WMuerdeWait=120
endif
Sync
Wait WMuerdeWait
Hide sprite WMISSprites ; WMTikoVisible=0
Inc Contador, 1
Next WMISSprites
Return
loop
rem WilsonArriba'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WArriba:
For WCola1=7 to 9
sprhit=sprite collision(1004,WCola1)
if sprhit>0
If pixelcol(1004,WCola1)=1
End
endif
endif
Next WCola1
For WCola2= 15 to 17
sprhit=sprite collision(1004,WCola2)
if sprhit>0
If pixelcol(1004,WCola2)=1
End
endif
endif
Next WCola2
Return
Rem FUNCIONES''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Rem Tíko '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function Tiko(Tikos,TikosN)
For Terreno= TerrenoPrimero to TerrenoUltimo
sprhit=sprite collision(Terreno,Tikos)
if sprhit>0
while pixelcol(Terreno,Tikos(TikosN))=1
dec F1y(4), 10
sprite Tikos(TikosN),F1x(4),F1y(4),Tikos(TikosN)
endwhile
endif
Next Terreno
If TikoCDoI=1
If F1x(4)<=F1x(1)+2000
inc F1x(4), 7
Endif
Endif
If TikoCDoI=2
If F1x(4)>=F1x(1)+1500
Dec F1x(4), 7
Endif
Endif
inc F1y(4), 10
Sprite Tikos(TikosN), F1x(4), F1y(4), Tikos(TikosN)
If TikosN=1 then Hide Sprite 30
If TikosN=2 then Hide Sprite 29
Show sprite Tikos(TikosN) ; TikoAtkVisible=1
sync
For WMTiko=23 to 28
sprhit=sprite collision(WMTiko,Tikos(TikosN))
if sprhit>0
If pixelcol(WMTiko,Tikos(TikosN))=1
If WMTikoVisible=1
TikoE=0
Hide sprite 29 ; Hide sprite 30 ; TikoAtkVisible=0
Endif
Endif
endif
Next WMTiko
For TikoAtk=1 to 22
sprhit=sprite collision(TikoAtk,Tikos(TikosN))
if sprhit>0
If pixelcol(TikoAtk,Tikos(TikosN))=1
If TikoAtkVisible=1 And WGolpeadoVisible=TikoAtk
End
Endif
Endif
endif
Next TikoAtk
Endfunction
`=======================================================
`==== PIXEL-PERFECT SPRITE COLLISION BY CLOGGY =========
function pixelcol(sp1,sp2)
`load sprite images into memory
make memblock from image 1,sprite image(sp1)
make memblock from image 2,sprite image(sp2)
`store image sizes
sw1=memblock dword(1,0)
sh1=memblock dword(1,4)
sw2=memblock dword(2,0)
sh2=memblock dword(2,4)
`store image positions
x1=sprite x(sp1)-sprite offset x(sp1)
y1=sprite y(sp1)-sprite offset y(sp1)
x2=sprite x(sp2)-sprite offset x(sp2)
y2=sprite y(sp2)-sprite offset y(sp2)
`calculate collision rectangle
rx1=getmax(x1,x2)
ry1=getmax(y1,y2)
rx2=getmin(x1+sw1-1,x2+sw2-1)
ry2=getmin(y1+sh1-1,y2+sh2-1)
`calculate area of first sprite that has overlapped second
sx1=rx1-x1
sy1=ry1-y1
ex1=rx2-x1
ey1=ry2-y1
`calculate area of second sprite that has overlapped first
sx2=rx1-x2
sy2=ry1-y2
ex2=rx2-x2
ey2=ry2-y2
`check through both sprites to see if any pixels collide
for row=0 to ey1-sy1
for col=0 to ex1-sx1
` bit1=memblock dword(1,12+((row+sy1)*(sw1*4))+((col+sx1)*4))
` bit2=memblock dword(2,12+((row+sy2)*(sw2*4))+((col+sx2)*4))
bit1=memblock byte(1,12+((row+sy1)*(sw1*4))+((col+sx1)*4)+3)
bit2=memblock byte(2,12+((row+sy2)*(sw2*4))+((col+sx2)*4)+3)
` AND bits together to see if a collision has occured
if bit1>0 and bit2>0
`Collision has occured
collision=1
`Clean up memblocks and return
delete memblock 1
delete memblock 2
exitfunction 1
endif
next col
next row
`no collision clean up memblocks and return
delete memblock 1
delete memblock 2
endfunction 0
function getmax(v1,v2)
`Calculate the larger of 2 numbers
if v1>v2
exitfunction v1
else
exitfunction v2
endif
endfunction v1
function getmin(v1,v2)
`calculate the smaller of 2 numbers
if v1<v2
exitfunction v1
else
exitfunction v2
endif
endfunction v1
And i want that in the part that says:
rem WilsonArriba'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WArriba:
For WCola1=7 to 9
sprhit=sprite collision(1004,WCola1)
if sprhit>0
If pixelcol(1004,WCola1)=1
End
endif
endif
Next WCola1
For WCola2= 15 to 17
sprhit=sprite collision(1004,WCola2)
if sprhit>0
If pixelcol(1004,WCola2)=1
End
endif
endif
Next WCola2
Return
instead of "End" i want it to go to the second page of my code where the second scenario will be with all the things it will have.
Is there any for going to the second page of my code?