Author Topic: 2D SCROLL DEMO  (Read 5183 times)

0 Members and 1 Guest are viewing this topic.

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
2D SCROLL DEMO
« on: July 10, 2012 »
Hi everybody! ;D

I'm  sharing this old ps2 demo  just to learn how to post at DBF forums where this is my first topic, so I hope everything goes right.

If there are still any people interested in YABASIC i would be pleased to continue sharing more code.
Workin' on some things which really looks great in the emu... :stirrer:

This one was writed for the ps2 and I haven't adapted for the emulator; it is the original code
so it's not 100% compatible with the emu but it works.

Sorry for the crappy code! haha... by looking it now i realise its a completelly mess... from
the beginning to the end, no way to understand a word... it is the work of a  noob and
i'm  :-[ to see it, but anyway, sharing cos' I really want to start sharing something.

------------------------------
CONTROLS:

Arrow keys: MOVEMENT. Keep presed on a block to push it (If allowed).
[Supr]: STOP MOVEMENT. Keep pressed to look forward.
[Ins]: MAKE SPRINT


I'ts just a little demo, no enemies, no end of level or deaths, just walk around.
------------------------------


------------------------------
EMULATOR

I'ts obvious, you need the Ps2 emulator to run the code on it

The right configuration of the emulator to run the game is
the emu's default configuration.

------------------------------


Greetings to all yabasic lovers and specially for jimshaw for the great emulator!  :)

Code: [Select]
' ###############################################################
' 2D SCROLL DEMO By SERGIO_ManOwaR_
' ###############################################################

' This was made time ago for the ps2 and haven't been adapted for
' the emulator so it just works as its works...

' It was a project for a pac-man game based on scroll screens
' with diferents cams and zoom.

' I had wrote so many versions including one with some pseudo-3D
' cenital view graphics.

' This is one of the basic versions, just sharing to see how to
' post in DBF forum, so this is my very first shared code.
' Some of the projects i'm working actually which looks
' really good in the emulator will be posted some day. (I HOPE!)

' Greetings to all in yabasic forums and specially to jimshaw.

' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' JUST A FEW DEMO!!
' You can't do anything but move around... anyway..
' have a nice walk!
'                 SERGIO_ManOwaR_    :)
' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<








open window 1,1:poke "textalign","cc"
dim xx(20),yy(20)

rem >>>>pac
dim tp(9)
tp(0)=.35
for z=1 to 9
tp(z)=.5
next
dim vex(9,4)
dim vey(9,4)
dim vexc(9)
dim veyc(9)

dim mov(9)

dim pu(20)
vx1=0:vx2=640:vy1=0:vy2=512:mint=75:maxt=140:cam0t=90


dim k(100000)
l=51
dim pl(10,25)
dim s(l,l),a(l,l),b(l,l),o(l,l),sp(l,l),ap(l,l),bp(l,l),op(l,l)

dim is(l,l),ia(l,l),ib(l,l),io(l,l),isp(l,l),iap(l,l),ibp(l,l),iop(l,l)
dim v(l,l)

dim c1a(l,l),c2a(l,l),c3a(l,l)
dim c1b(l,l),c2b(l,l),c3b(l,l)

dim x(10),y(10),p(10)

dim showpunx(20)
dim showpuny(20)
dim showpunt(20)
dim showpun$(20)


dim a1(20000)
dim a2(20000)
dim a3(20000)
dim a4(20000)


for z=0 to 1:for zz=1 to 25:read pl(z,zz):next:next
data 3,3,8,3,3
data 3,-1,-1,-1,3
data 9,-1,-1,-1,9
data 3,-1,-1,-1,3
data 3,3,8,3,3

data 0,0,0,0,0
data 0,3,3,3,0
data 0,3,-1,3,0
data 0,3,3,3,0
data 0,0,0,0,0

n=1

label gestor
n=n+1
nper=0





 
gosub ldat
clear window

setrgb 1,100-c1,100-c2,100-c3
setrgb 2,c1,c2,c3
setrgb 3,100+c1,100+c2,100+c3
gtriangle 0,0 to 640,0 to 0,512
gtriangle 640,512 to 640,0 to 0,512


setrgb 1,20,70,0
for z=40 to 472 step 2
line 40,z,600,z
next
setrgb 1,102,152,2
rect 40,40,600,472

setrgb 1,222,222,222

text 250,10,"2D SCROLL DEMO","lt"


text 215,250,"Press [SUPR] to START","lt"
text 150,490,"By Sergio ``\« ManOwaR »/´´ soeiro","lt"


t(-16384)
t(16384)

rem >>>>>>>>>>>>>>EXCLUSIVO PACMAN

rem >>>abrir salid
ib(int(l/2),1)=0:ib(int(l/2),l)=0:ib(1,int(l/2))=0:ib(l,int(l/2))=0


npast=0
for y=1 to l:for x=1 to l
rem >>>pos suelo aleat y poner rayos
isp(x,y)=1+int(ran(7))
if ib(x,y)=3 then
if x<l and ib(x+2,y)=3 and io(x+1,y)>-1 io(x+1,y)=101
if y<l and ib(x,y+2)=3 and io(x,y+1)>-1 io(x,y+1)=102
fi


if ib(x,y)>=3 io(x,y)=0:rem borrar objets bajo blok blind

rem >>>poner pastill
if ib(x,y)=0 and io(x,y)=0 then io(x,y)=1:npast=npast+1:fi

rem >>>poner adorn aleat
if ran(15)<1 ia(x,y)=4
if ran(12)<1 ia(x,y)=8
if ran(10)<1 ia(x,y)=16

next:next


v=.18

rem >>>>>>>>>>>excl


reset()
bucle()
goto gestor




rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DISENADOR
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DISENADOR
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>DISENADOR
label ldat

on n gosub n1,n2,n3,n5
read na,n$,l,fc1,fc2,fc3,ala1,ala2,ala3,alb1,alb2,alb3
c1=fc1
c2=fc2
c3=fc3

rem >>>> RESETEAR

for y=0 to 51:for x=0 to 51

ib(x,y)=0
is(x,y)=1
io(x,y)=0
ia(x,y)=0
c1a(x,y)=ran(ala1)
c2a(x,y)=ran(ala2)
c3a(x,y)=ran(ala3)
c1b(x,y)=ran(alb1)
c2b(x,y)=ran(alb2)
c3b(x,y)=ran(alb3)

' if ran(3)<1 and ib(x,y)=0 ib(x,y)=int(ran(4))
' isp(x,y)=int(ran(8))
' ibp(x,y)=int(ran(8))
next:next

rem >>>>>>>>>>>>>>EXCLUSIVO PACMAN
rem >>>>>>>>recuadrar
for y=0 to l+1:for x=0 to l+1:is(x,y)=1:ib(x,y)=3:v(x,y)=9999:next:next:for y=2 to l-1:for x=2 to l-1:ib(x,y)=0:v(x,y)=0:next:next







c=0:rem cosa que se usa actualmente 0=s 1=a 2=b 3=o

 setrgb 1,222,222,222
rect 59,449,560,500

setrgb 1,85,105,185


vercarga=1
for z=1 to na
 fill rect 60,450,60+(z*500/na),500



pause .1
read a

rem >>>>>>>>>>>>>>>>>0 Zona x1,x2,lx,ly,pasox,pasoy,numero
if a=0 then read x1,y1,lx,ly,pasox,pasoy,nu
for y=y1 to y1+ly step pasoy:for x=x1 to x1+lx step pasox
if c=0 is(int(x),int(y))=nu
if c=1 and and(a(int(x),int(y)),nu)=0 a(int(x),int(y))=a(int(x),int(y))+nu
if c=2 ib(int(x),int(y))=nu
if c=3 io(int(x),int(y))=nu
next:next:fi
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<0

rem >>>>>>>>>>>>>>>>>50-59 poner c cosas na2 veces
if a=50 then read na2
for z2=1 to na2:read x1,y1,cosa
if c=3 io(x1,y1)=cosa
next
fi

rem >>>>>>>>>>>>>>>>>60-69 recuadros
if a=61 then read x1,y1,lx,ly,nub,nus
for y=y1 to y1+ly:for x=x1 to x1+lx
ib(x,y)=nub
is(x,y)=nus
next
next
for y=y1+1 to y1+ly-1:for x=x1+1 to x1+lx-1
ib(x,y)=0
next
next
fi

rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<0


rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>70-89 TRANSORM
if a>69 and a<90 then
if a=70 then read frecuencia,cosa,vieja,nueva:x1=1:x2=l:y1=1:y2=l:fi

dat=0:for y=y1 to y2:for x=x1 to x2
if cosa=0 and is(x,y)=vieja then dat=dat+1:if dat>=frecuencia is(x,y)=nueva:fi

if cosa=1 and and(a(x,y),vieja)>0 then dat=dat+1
if dat>=frecuencia then a(x,y)=a(x,y)-vieja:a(x,y)=a(x,y)+nueva:fi:fi

if cosa=2 and ib(x,y)=vieja then dat=dat+1:if dat>=frecuencia ib(x,y)=nueva:fi
if cosa=3 and io(x,y)=vieja then dat=dat+1:if dat>=frecuencia io(x,y)=nueva:fi
if cosa=10 and is(x,y)=vieja then dat=dat+1:if dat>=frecuencia isp(x,y)=nueva:fi

if dat>=frecuencia dat=0
next:next
fi

rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<90-99

rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>90-99 cambiar cosa a usar
if a>89 and a<100 c=a-90
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<90-99

rem >>>>>>>>>>>>>>>>>>>>>>>>>100,num  poner num plantillas
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ponx,pony,plan
if a=1000  or a=1001 then read tot
for zz=1 to tot
read ponx,pony,plan
if a=1000 read num

rem exc pacm>>>>>>
if plan=0 then casax=ponx+1.5:casay=pony+1.5:fi
if plan=1 then tumbax=ponx+1.5:tumbay=pony+1.5:fi
rem <<<<<<<<<<<<<

zzx=-1:zzy=0
for zx=1 to 25
zzx=zzx+1
if zzx=5 then zzy=zzy+1:zzx=0:fi
pl=pl(plan,zx)


if a=1000 then
if pl>0 then
if c=0 is(ponx-1+zzx,pony-1+zzy)=num
if c=2 ib(ponx-1+zzx,pony-1+zzy)=num
if c=3 io(ponx-1+zzx,pony-1+zzy)=num
fi
fi

if a=1001 then
if pl<8 and pl>0 ib(ponx-1+zzx,pony-1+zzy)=pl
if pl=8 io(ponx-1+zzx,pony-1+zzy)=101
if pl=9 io(ponx-1+zzx,pony-1+zzy)=102
if pl=-1 io(ponx-1+zzx,pony-1+zzy)=-1

fi

next
next zz

fi:rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<100




next:rem acciones
return
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<DISENADOR
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<DISENADOR
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<DISENADOR



label n1:restore 1:return
label n2:restore 2:return
label n3:restore 3:return









rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>BUCLE
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>BUCLE
sub bucle()
1 if pausa=1 goto 4

if presenta=1 then
k=peek("port1")
if k=8 then presenta=0:cam=0:t(-8):goto 2:fi
goto 4:fi

2 fr=fr+1
if replay=0 and fin>0 and fr>finfr return

k=peek("port1")
' dx=0:dy=0
if and(k,8)>0  then pausa=1:t(-8):oppau=1:menup=0:goto 4:fi


if and(k,8192)>0 then romper=1 else romper=0:fi
if and(k,16384)>0 then tipocam=1
if (dx<>0 or dy<>0) then dx=0:dy=0:fi
fi


if and(k,16)>0 then dy=-1:dx=0:fi
if and(k,32)>0 then dx=1:dy=0:fi
if and(k,64)>0 then dy=1:dx=0:fi
if and(k,128)>0 then dx=-1:dy=0:fi

' if and(k,1)>0 then beep:pause .1:tipocam=1-tipocam:fi
if and(k,256)>0 t=t*1.1
if and(k,512)>0 t=t/1.1


if and(k,32768)>0  and (dx<>0 or dy<>0) v=.45-fatiga
if and(k,32768)=0  or (dx=0 and  dy=0) then if fatiga>0 fatiga=fatiga-.01:fi





if dx<>0 then
ultdx=dx
ultdy=0
tipocam=0
x(0)=x(0)+dx*v
mov(0)=mov(0)+int(1.8+v)
fi


if dy<>0 then
ultdy=dy
ultdx=0
tipocam=0
y(0)=y(0)+dy*v
mov(0)=mov(0)+int(1.8+v)
fi


if mov(0)>7 mov(0)=0

if v>.18 then
if dx<>0 or dy<>0 fatiga=fatiga+.02
if fatiga>.25 fatiga=.25
pupa=int((v-.18)*20):if v>.18 v=v-.01:fi

if v<.18 v=.18


rem >>>>>>PASAR DE LADO PACO
 if x(0)<1 x(0)=l+1:if y(0)<1 y(0)=l+1:if x(0)>l+1 x(0)=1:if y(0)>l+1 y(0)=1


3 rem >>>>>>chek

for z=0 to nper
vexc(z)=int(x(z))
veyc(z)=int(y(z))
vex(z,1)=int(x(0)-tp(z))
 vex(z,2)=int(x(0)+tp(z))
 vex(z,3)=vex(z,1)
 vex(z,4)=vex(z,2)
 
vey(z,1)=int(y(0)-tp(z))
 vey(z,2)=vey(z,1)
 vey(z,3)=int(y(0)+tp(z))
 vey(z,4)=vey(z,3)

next



rem >>>chek mur pac
pegado=0
cx=vexc(0)
cy=veyc(0)

if dy=-1 then

bl=b(vex(0,1),vey(0,1))
if bl>0 then
y(0)=vey(0,1)+1+tp(0)+.01
if b(vex(0,2),vey(0,2))>0 then dy=1
' if and(k,16)>0 pegado=1
 else x(0)=x(0)+.2:fi
fi

bl=b(vex(0,2),vey(0,1))
if bl>0 then
y(0)=vey(0,1)+1+tp(0)+.01
if b(vex(0,1),vey(0,1))>0 then dy=1
if and(k,16)>0 pegado=1

else x(0)=x(0)-.2:fi
fi

fi:rem dy=-1


if dy=1 then

bl=b(vex(0,1),vey(0,3))
if bl>0 then
y(0)=vey(0,3)-tp(0)-.01
if b(vex(0,2),vey(0,3))>0 then dy=-1
else x(0)=x(0)+.2:fi
fi

bl=b(vex(0,2),vey(0,4))
if bl>0 then
y(0)=vey(0,4)-tp(0)-.01
if b(vex(0,1),vey(0,4))>0 then dy=-1
if and(k,64)>0 pegado=1

 else x(0)=x(0)-.2:fi
fi

fi:rem dy=1



if dx=-1 then

bl=b(vex(0,1),vey(0,1))
if bl>0 then
x(0)=vex(0,1)+1+tp(0)+.01
if b(vex(0,1),vey(0,3))>0 then dx=1
else y(0)=y(0)+.2:fi
fi
 bl=b(vex(0,3),vey(0,3))
 if bl>0 then
 x(0)=vex(0,1)+1+tp(0)+.01
 if b(vex(0,1),vey(0,1))>0 then dx=1
if and(k,128)>0 pegado=1

else y(0)=y(0)-.2:fi
 fi


fi:rem dx=-1


if dx=1 then

bl=b(vex(0,2),vey(0,2))
if bl>0 then
x(0)=vex(0,2)-tp(0)-.01
if b(vex(0,2),vey(0,4))>0 then dx=-1
else y(0)=y(0)+.2:fi

fi
 bl=b(vex(0,4),vey(0,4))
 if bl>0 then
 x(0)=vex(0,4)+-tp(0)-.01
 if b(vex(0,2),vey(0,2))>0 then dx=-1
if and(k,32)>0 pegado=1
else y(0)=y(0)-.2:fi
 fi


fi:rem dx=-1



if pegado=1 then

mov(0)=10
 t=t*1.015:if v<.48 v=v+.02
if v>.48 then
b=b(cx,cy)
if b>0 and b<3 then
if b(cx-dx,cy-dy)=0 and o(cx-dx,cy-dy)<1 then
b(cx-dx,cy-dy)=b(cx,cy)
v(cx-dx,cy-dy)=v(cx,cy)
b(cx,cy)=0
pupa=-10
pu(3)=pu(3)-10
x(0)=x(0)-dx*.4
y(0)=y(0)-dy*.4


if dy<>0  and and(a(cx,cy),2)=0 a(cx,cy)=a(cx,cy)+2
if dx<>0 and and(a(cx,cy),1)=0 a(cx,cy)=a(cx,cy)+1
' if and(a(cx-dx,cy-dy),3)=0 a(cx-dx,cy-dy)=a(cx-dx,cy-dy)+3
dx=0:dy=0:mov(0)=0:v=.18


fi


' v(cx,cy) =v(cx,cy)/1.2
' if v(cx,cy)<1 b(cx,cy)=0
fi

fi:rem v>.48
dx=-dx:dy=-dy
fi:rem peg

if cam=0 then
if pegado=0 and t>cam0t t=t/1.02
fi


rem >>>>>>>>chek ob

o=o(cx,cy)
if o=1 then
com=1:comx=cx+.5:comy=cy+.5
npast=npast-1
if npast=0 then fin=1:finfr=fr+50:fi
fi


if o>100 then elec=elec+1
if elec>20 then
elec=20
beep
fi
 else if elec>0 elec=elec-1:fi















4 if t<mint t=mint:if t>maxt t=maxt

' t=20.7

if cam=0 then
porx=x(0)
pory=y(0)

if fr=0 then
obx=tumbax
oby=tumbay
cam=10
fi

fi

if cam=10 then
if porx<obx then porx=porx+.25:fi
if pory<oby pory=pory+.25
if porx>obx porx=porx-.25
if pory>oby pory=pory-.25


if pory=oby and porx=obx then if ticam=0 ticam=25
ticam=ticam-1

if obx=x(0) then cam=0:ticam=50+ran(200):presenta=0:fi

if ticam=1 then
if obx=tumbax then obx=x(0):oby=y(0):ticam=0:fi
fi


fi

fi:rem cam 10

reM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>SX,SY
obdx=(ultdx*-288)
obdy=(ultdy*-231)
if tipocam=0 then obdx=0
obdy=0
fi

 if camdx<obdx camdx=camdx+(obdx-camdx)/10
 if camdx>obdx camdx=camdx-(camdx-obdx)/10
 if camdy<obdy camdy=camdy+(obdy-camdy)/10
 if camdy>obdy camdy=camdy-(camdy-obdy)/10

sx=-int(porx*t-t):sy=-int(pory*t-t):sx=320+sx+camdx:sy=256+sy+camdy

rem >>>>>>>>LIMITES SX SY
 if sx>vx1 sx=vx1:if sx+t*l<vx2 sx=vx2-t*l:if sy>vy1 sy=vy1 :if sy+t*l<vy2 sy=vy2-t*l

rem >>>>ACTUALIZAR BRILLO
if bri<=0 dbri=30:if bri>200 dbri=-50 :bri=bri+dbri
rem >>>>>>>>>>>>>>EFECTO RETUMBE
if retumbe>0 then retumbe=retumbe-2:sx=sx-ran(retumbe*(t/60))+ran(retumbe*(t/60)):sy=sy-ran(retumbe*(t/60))+ran(retumbe*(t/60)):fi


rem >>>>>DEFINIR CASILLAS QUE SERAN DIBUJADAS
blx1=int((-sx)/t):bly1=int((-sy)/t):blx2=blx1+2+int(vx2/t):bly2=bly1+2+int(vy2/t)




5


if nuevc1>0  then
oc1=c1
c1=c1+nuevc1
fi

pause .04
 setdrawbuf buf:setdispbuf 1-buf:clear window

for y=bly1 to bly2:for x=blx1 to blx2

c1a=c1a(x,y)+c1
c2a=c2a(x,y)+c2
c3a=c3a(x,y)+c3
c1b=c1b(x,y)+c1
c2b=c2b(x,y)+c2
c3b=c3b(x,y)+c3
su=s(x,y):bl=b(x,y):ob=o(x,y)


rem >>>>>>DEFINIR PUNTOS DE DIBUJO
j=sx+x*t:h=sy+y*t
x0=j-t:x1=j-t/1.05:x2=j-t/1.11:x3=j-t/1.18:x4=j-t/1.25:x5=j-t/1.35:x6=j-t/1.43:x7=j-t/1.54:x8=j-t/1.67:x9=j-t/1.82:x10=j-t/2:x11=j-t/2.22:x12=j-t/2.5:x13=j-t/2.88:x14=j-t/3.35:x15=j-t/4:x16=j-t/5:x17=j-t/6.7:x18=j-t/10:x19=j-t/20:x20=j:y0=h-t:y1=h-t/1.05:y2=h-t/1.11:y3=h-t/1.18:y4=h-t/1.25:y5=h-t/1.35:y6=h-t/1.43:y7=h-t/1.54:y8=h-t/1.67:y9=h-t/1.82:y10=h-t/2:y11=h-t/2.22:y12=h-t/2.5:y13=h-t/2.85:y14=h-t/3.35:y15=h-t/4:y16=h-t/5:y17=h-t/6.7:y18=h-t/10:y19=h-t/20:y20=h

s=s(x,y):b=b(x,y):o=o(x,y)

if b=0 or b>100 then

' if s=1 then
' setrgb 1,50+c1,0+c2,c3
' fill rect x0,y0,x19,y9
' fill rect x0,y10,x9,y19
' fill rect x10,y10,x20,y19
' fi

if s=0 then
setrgb 1,100,155+bri,100
rect x0,y0,x20,y20
fi

if s=1 then
if sp(x,y)<>3 then
setrgb 1,20+c1a,25+c2a,30+c3a:fill rect x0,y0,x19,y9:setrgb 1,20+c1b(x-1,y)+c1+b,25+c2b(x-1,y)+c2+b,30+c3b(x-1,y)+c3+b:fill rect x0,y10,x9,y19:setrgb 1,20+c1b,25+c2b,30+c3b:fill rect x10,y10,x20,y19:fi
if sp(x,y)=3 then
setrgb 1,20+c1b,25+c2b,30+c3b
if sp(x-1,y)<>3 fill rect x1,y10,x19,y19
if sp(x-1,y)=3 fill rect x0,y10,x19,y19
fill rect x0,y0,x9,y9
setrgb 1,20+c1a,25+c2a,30+c3a:fill rect x10,y0,x19,y9:fi
fi


if s=2 then setrgb 1,80+c1a/3,80+c2a/3,80+c3a/3:fill rect x0,y0,x20-t/60,y20-t/60:setrgb 1,b,b,b:fill triangle x0,y0 to x3,y0 to x0,y3: fill triangle x0,y20 to x3,y20 to x0,y17: fill triangle x20,y0 to x17,y0 to x20,y3: fill triangle x20,y20 to x17,y20 to x20,y17:fi
if s=3 then setrgb 1,c1/3,c2/3,c3/3:fill rect x0,y0,x20,y20:setrgb 1,80+c1a/3,80+c2a/3,80+c3a/3:fill rect x0,y0,x10,y10::setrgb 1,60+c1b/4,60+c2b/4,60+c3b/4:fill rect x10,y10,x20,y20:fi

rem >>>>>>DIBUJAR adornos
ad=a(x,y)

if and(ad,4)=4 then
setrgb 1,20+c1a,50+c1a,0:fill triangle x5,y0 to x6,y7 to x8,y0:fi
if and(ad,8)=8 then
setrgb 1,c1,c2,c3:fill rect x13,y0,x15,y10:fi
if and(ad,16)=16 then
setrgb 1,c1,c2,c3
fill triangle x5,y20 to x14,y11 to x7,y20:fi

if and(ad,1)=1 then
setrgb 1,2,2,2:fill rect x0,y3,x20,y7:fill rect x0,y13,x20,y17:fi
if and(ad,2)=2 then
setrgb 1,2,2,2:fill rect x3,y0,x7,y20:fill rect x13,y0,x17,y20:fi



if b<100 and x>0 and y>0 then
rem >>>>>>DIBUJAR SOMBRAS

 setrgb 1,b,b,b
if b(x,y-1)>0 then if b(x-1,y-1)>0 or b(x-1,y)>0  then fill rect x0,y0,x20,y5 else  fill triangle  x0,y0 to x10,y5 to x10,y0 :fill rect x10,y0,x20,y5:fi:fi
if b(x-1,y)>0 then if b(x-1,y-1)>0 or b(x,y-1)>0 then fill rect x0,y0,x5,y20 else  fill triangle  x0,y0 to x5,y10 to x0,y10:fill rect x0,y10,x5,y20:fi:fi
if b(x-1,y-1)>0 then fill rect x0,y0,x5,y5:fi


fi

rem >>>>>>>DIBUJAR OBJETOS
if ob =1 then setrgb 1,222+b,222+b,222+b:if t>90 fill circle x10,y10,t/14:if t<91 fill rect x9,y9,x11,y11:fi
if ob=2 then setrgb 1,30+b,40+b,60+b
fill circle x10,y11,t/4
fill rect x8,y8,x12,y12
setrgb 1,40+b+bri/5,50+b+bri/25,70+b+bri/25
fill circle x10,y9,t/4
setrgb 1,180+bri+b,bri+b,bri+b:fill circle x10,y9,t/9:fi

if ob>2 and ob<20 then
if ob=3 setrgb 1,30+b,90+b,40+b
if ob>3 setrgb 1,80+b,120+b,150+b

fill circle x10,y9,t/4
fill circle x10,y15,t/4
fill rect x5,y8,x15,y15
fill rect x9,y2,x11,y5
fill rect x7,y0,x13,y2

if ob=3 then setrgb 1,90+b+bri/25,90+b+bri/8,90+b+bri/20
fill circle x10,y10,t/6:fill rect x8,y13,x12,y14:setrgb 1,b,b,b:fill rect x8,y10,x9,y11:fill rect x11,y10,x12,y11:fi
if ob>3 then

if ob=4 setrgb 1,150+b,b,10+b
if ob=5 setrgb 1,b,b,b+ran(20)

fill circle x10,y9,t/6.1
fill circle x10,y15,t/6.1
fill rect x7,y9,x13,y15
fi

fi



if o(x,y)=101 then
for z=1 to 3 setrgb 1,50+ran(205)+b,100+ran(155)+b,255+b
ry=y10-ran(t/5)+.1+ran(t/5)
ry2=y10-ran(t/5)+.1+ran(t/5)
ry3=y10-ran(t/5)+.1+ran(t/5)
cerx=(sx+x*t-t)+ran(t)
line x0,ry,cerx,ry2
line cerx,ry2,x20,ry3:next
fi

if o(x,y)=102 then
for z=1 to 3 setrgb 1,50+ran(205)+b,100+ran(155)+b,255+b
rx=x10-ran(t/5)+.1+ran(t/5)
rx2=x10-ran(t/5)+.1+ran(t/5)
rx3=x10-ran(t/5)+.1+ran(t/5)
cery=(sy+y*t-t)+ran(t)
line rx,y0,rx2,cery
line rx2,cery,rx3,y20:next:
fi




fi:rem dib suelos y obj



if b>0 then

if b<100 then
 setrgb 1,80+c1+b,80+c2+b,80+c3+b
fill rect x0,y0,x20,y20
fi
if b=1 then
setrgb 1,145+c1,90+c2,20+c3
 fill rect x0,y0,x19,y9
if b(x+1,y)=1 fill rect x10,y10,x20,y19
if b(x+1,y)<>1 fill rect x10,y10,x19,y19

' if b(x-1,y)=1  setrgb 1,145+b+c1a(x-1,y)+c1,90+b+c2a(x-1,y)+c2,20+b+c3a(x-1,y)+c3
 fill rect x0,y10,x9,y19
fi

if b=2 then
setrgb 1,155+c1,30+c2,c3
fill rect x0,y0,x9,y4
fill rect x0,y10,x9,y14
fill rect x0,y15,x4,y19
fill rect x15,y5,x20,y9
fill rect x0,y5,x4,y9
fill rect x15,y15,x20,y19



setrgb 1,155+c1b,30+c2b,c3b
fill rect x5,y5,x14,y9
fill rect x10,y0,x19,y4

setrgb 1,155+c1a,30+c2a,c3a
fill rect x10,y10,x19,y14
fill rect x5,y15,x14,y19


 if b(x+1,y)<>2 then setrgb 1,100+c1,100+c2,100+c3: fill rect x19,y0,x20,y20:fi
 fi


if b=3 then
setrgb 1,105+c1a,155+c2a,175+c3b

fill rect x0,y0,x20,y20
setrgb 1,45,55,75

fill rect x2,y2,x3,y3
fill rect x18,y2,x17,y3
fill rect x2,y18,x3,y17
fill rect x18,y18,x17,y17
fi





if v(x,y)<10 and v(x,y)>-1  then  setrgb 1,52+b,22+b,0
if v(x,y)<10  fill rect x17,y10,x16,y8
if v(x,y)<9  fill rect x3,y0,x4,y3
if v(x,y)<8  fill rect x9,y10,x8,y12
if v(x,y)<7  fill rect x10,y11,x13,y12
if v(x,y)<6  fill rect x16,y17,x14,y19
if v(x,y)<5  fill rect x3,y3,x7,y6
if v(x,y)<4  fill rect x8,y8,x11,y15
if v(x,y)<3  fill rect x19,y8,x16,y7
if v(x,y)<2  fill rect x2,y19,x5,y13
fi
fi:rem b>0



' setrgb 1,222,222,222
' if x=vexc(0) and y=veyc(0) rect x2,y2,x18,y18
' setrgb 1,222,2,2

' for z=1 to 4
' if x=vex(0,z) and y=vey(0,z) rect x1,y1,x19,y19
' next

next:next




j=sx+x(0)*t-t
h=sy+y(0)*t-t

ot=t
tx=-t
ty=t

if dx=0 and dy=0 then
odx=-1
dx=ultdx:dy=ultdy
fi

if dx=-1 tx=t
if dy=1 ty=-t
crec=.3
for z=1 to 9
crec=crec*1.5
xx(z)=j-tx/(1.6+crec)
xx(20-z)=j+tx/(1.6+crec)

yy(z)=h-ty/(1.6+crec)
yy(20-z)=h+ty/(1.6+crec)
next

t=ot

rem >>>>>>dib pac


if elec>0 parp=1
if ran(20)<1 parp=1

m= mov(0)


setrgb 1,122,92,2

if dy<>0 then
if m=1 or m=3 fill circle xx(7),yy(6),t/9
if m=2 then
fill circle xx(7),yy(4),t/8
fill circle xx(13),yy(14),t/7
fill rect xx(5),yy(3),xx(9),h
fi
if m=5 or m=7 fill circle xx(13),yy(6),t/9
if m=6 then
fill circle xx(13),yy(4),t/8
fill circle xx(7),yy(14),t/7
fill rect xx(15),yy(3),xx(11),h
fi
if m=10 then
fill circle xx(13),yy(15),t/8
fill circle xx(7),yy(15),t/8
fi
fi:rem dy<>0

if dx<>0 then
if m=1 or m=3 fill circle xx(6),yy(7),t/9
if m=2 then
fill circle xx(4),yy(7),t/8
fill circle xx(14),yy(13),t/7
fill rect xx(3),yy(5),j,yy(9)
fi
if m=5 or m=7 fill circle xx(6),yy(13),t/9
if m=6 then
fill circle xx(4),yy(13),t/8
fill circle xx(14),yy(7),t/7
fill rect xx(3),yy(15),j,yy(11)
fi
if m=10 then
fill circle xx(15),yy(13),t/8
fill circle xx(15),yy(7),t/8
fi
fi:rem dx<>0



setrgb 1,222,222,elec*12
fill circle j,h,t*.3

if dy<>0 then
if com=0 then
setrgb 1,222,222,222
if parp=1 setrgb 1,182,182,elec*12

fill circle xx(8),yy(7),t/8
fill circle xx(12),yy(7),t/8

if parp=0 then setrgb 1,2,2,2
fill circle xx(8),yy(6),t/16
fill circle xx(12),yy(6),t/16:fi

fi:rem com=0

if com=1 then
setrgb 1,2,2,2
fill circle j,yy(9),t/4.6

setrgb 1,255,88,88
fill triangle j-t/10,h to j+t/10,h to sx+comx*t-t,sy+comy*t-t

setrgb 1,222,222,elec*12
fill circle j,yy(11),t/4.5

setrgb 1,222,222,222
fill circle xx(8),h,t/8
fill circle xx(12),h,t/8
setrgb 1,2,2,2
fill circle xx(8),yy(9),t/16
fill circle xx(12),yy(9),t/16
fi:rem com=1


if m=0 or m=4 then
setrgb 1,192,52,2
fill circle xx(3),yy(11),t/11
fill circle xx(17),yy(11),t/11
 setrgb 1,182,182,elec*12
fill triangle xx(6),yy(12) to xx(6),h to xx(3),yy(11) 
fill triangle xx(14),yy(12) to xx(14),h to xx(17),yy(11)
fi
if m=1 or m=3 then
setrgb 1,192,52,2
fill circle xx(16),yy(9),t/10
fill circle xx(3),yy(11),t/12
 setrgb 1,182,182,elec*12
fill triangle xx(6),h to xx(7),yy(12) to xx(3),yy(12)
fill triangle xx(3),yy(12) to xx(3),yy(11) to xx(4),yy(12)


fill triangle xx(13),h to xx(14),yy(12) to xx(17),h 
 fill triangle xx(16),yy(9) to xx(15),h to xx(17),h 
fi

if m=2  then
setrgb 1,192,52,2
fill circle xx(16),yy(8),t/9
fill circle xx(3),yy(13),t/13
 setrgb 1,182,182,elec*12
fill triangle xx(6),h to xx(3),yy(13) to xx(7),yy(12)


fill triangle xx(13),h to xx(14),yy(12) to xx(17),h
 fill triangle xx(16),yy(8) to xx(15),h to xx(17),h
fi



if m=5 or m=7 then
setrgb 1,192,52,2
fill circle xx(4),yy(9),t/10
fill circle xx(17),yy(11),t/12
 setrgb 1,182,182,elec*12
fill triangle xx(3),h to xx(7),h to xx(6),yy(12)
fill triangle xx(4),yy(9) to xx(3),h to xx(5),h

fill triangle xx(14),h to xx(13),yy(12) to xx(17),yy(12) 
 fill triangle xx(17),yy(11) to xx(16),yy(12) to xx(17),yy(12)
fi

if m=6  then
setrgb 1,192,52,2
fill circle xx(4),yy(8),t/9
fill circle xx(17),yy(13),t/13
 setrgb 1,182,182,elec*12
fill triangle xx(4),yy(8) to xx(3),h to xx(4),h


fill triangle xx(3),h to xx(7),h to xx(6),yy(12) 
 fill triangle xx(17),yy(13) to xx(14),h to xx(13),yy(12) 
fi

if m=10  then
setrgb 1,192,52,2
fill circle xx(3),yy(4),t/12
fill circle xx(17),yy(4),t/12
 setrgb 1,182,182,elec*12
fill triangle xx(3),yy(4) to xx(5),h to xx(7),yy(9)
fill triangle xx(17),yy(4) to xx(15),h to xx(13),yy(9)
fi



fi:rem dy<>0




if dx<>0 then
if com=0 then
setrgb 1,222,222,222
if parp=1 setrgb 1,182,182,elec*12

fill circle xx(7),yy(8),t/8
fill circle xx(7),yy(12),t/8

if parp=0 then setrgb 1,2,2,2
fill circle xx(6),yy(8),t/16
fill circle xx(6),yy(12),t/16:fi

fi:rem com=0

if com=1 then
setrgb 1,2,2,2
fill circle xx(9),h,t/4.6

setrgb 1,255,88,88
 fill triangle j,h-t/10 to j,h+t/10 to sx+comx*t-t,sy+comy*t-t

setrgb 1,222,222,elec*12
fill circle xx(11),h,t/4.5

setrgb 1,222,222,222
fill circle j,yy(8),t/8
fill circle j,yy(12),t/8
setrgb 1,2,2,2
fill circle xx(9),yy(8),t/16
fill circle xx(9),yy(12),t/16
fi:rem com=1


if m=0 or m=4 then
setrgb 1,192,52,2
fill circle xx(11),yy(3),t/11
fill circle xx(11),yy(17),t/11
 setrgb 1,182,182,elec*12
fill triangle xx(12),yy(6) to j,yy(6) to xx(11),yy(3) 
fill triangle xx(12),yy(14) to j,yy(14) to xx(11),yy(17)
fi
if m=1 or m=3 then
setrgb 1,192,52,2
fill circle xx(9),yy(16),t/10
fill circle xx(11),yy(3),t/12
 setrgb 1,182,182,elec*12
fill triangle j,yy(6) to xx(12),yy(7) to xx(12),yy(3)
fill triangle xx(12),yy(3) to xx(11),yy(3) to xx(12),yy(4) 


fill triangle j,yy(13) to xx(12),yy(14) to j,yy(17) 
 fill triangle xx(9),yy(16) to j,yy(15) to j,yy(17) 
fi

if m=2  then
setrgb 1,192,52,2
fill circle xx(8),yy(16),t/9
fill circle xx(13),yy(3),t/13
 setrgb 1,182,182,elec*12
fill triangle j,yy(6) to xx(13),yy(3) to xx(12),yy(7)


fill triangle j,yy(13) to xx(12),yy(14) to j,yy(17)
 fill triangle xx(8),yy(16) to j,yy(15) to j,yy(17)
fi



if m=5 or m=7 then
setrgb 1,192,52,2
fill circle xx(9),yy(4),t/10
fill circle xx(11),yy(17),t/12
 setrgb 1,182,182,elec*12
fill triangle j,yy(3) to j,yy(7) to xx(12),yy(6)
fill triangle xx(9),yy(4) to j,yy(3) to j,yy(5)

fill triangle j,yy(14) to xx(12),yy(13) to xx(12),yy(17) 
 fill triangle xx(11),yy(17) to xx(12),yy(16) to xx(12),yy(17)
fi

if m=6  then
setrgb 1,192,52,2
fill circle xx(8),yy(4),t/9
fill circle xx(13),yy(17),t/13
 setrgb 1,182,182,elec*12
fill triangle xx(8),yy(4) to j,yy(3) to j,yy(4)


fill triangle j,yy(3) to j,yy(7) to xx(12),yy(6) 
 fill triangle xx(13),yy(17) to j,yy(14) to xx(12),yy(13) 
fi

if m=10  then
setrgb 1,192,52,2
fill circle xx(4),yy(3),t/12
fill circle xx(4),yy(17),t/12
 setrgb 1,182,182,elec*12
fill triangle xx(4),yy(3) to j,yy(5) to xx(9),yy(7)
fill triangle xx(4),yy(17) to j,yy(15) to xx(9),yy(13)
fi








fi:rem dx<>0







if elec>0 then
pupa=elec
pu(2)=pu(2)+pupa

retumbe=elec
for z=1 to 2+int(elec/8) setrgb 1,50+ran(205)+b,100+ran(155)+b,255+b
rayx1=j-ran(t/2)+ran(t/2)
rayy1=h-ran(t/2)+ran(t/2)
rayx2=rayx1-ran(t/2)+ran(t/2)
rayy2=rayy1-ran(t/2)+ran(t/2)
line j,h,rayx1,rayy1
line rayx1,rayy1,rayx2,rayy2
next:fi

if com=1 then com=0:o(vexc(0),veyc(0))=0
npun=npun+5
pu(1)=pu(1)+5
totpast=totpast-1
fi

parp=0






' if tipocam=0 then
' for z=0 to 20
' line xx(z),yy(1),xx(z),yy(19)
' line xx(1),yy(z),xx(19),yy(z)
' next
' line j,yy(1),j,yy(19)
' line xx(1),h,xx(19),h
' fi



rem >>>>DIB SUDOR
if fatiga>0 then
setrgb 1,100,100,255

for z=1 to int(fatiga*10)
fill circle sx+x(0)*t-t-ran(t/2)+ran(t/2), sy+y(0)*t-t-ran(t/2)+ran(t/2),t/(15+ran(15))
next
fi

fill circle sx+(x(0)-tp(0))*t-t,sy+(y(0)-tp(0))*t-t,t/40
fill circle sx+(x(0)+tp(0))*t-t,sy+(y(0)-tp(0))*t-t,t/40
fill circle sx+(x(0)-tp(0))*t-t,sy+(y(0)+tp(0))*t-t,t/40
fill circle sx+(x(0)+tp(0))*t-t,sy+(y(0)+tp(0))*t-t,t/40

if nuevc1>0 then
nuevc1=0
c1=oc1
fi

if pupa>0 npun=npun-pupa
if npun<>0 then
pun=pun+npun:if pun<0 pun=0
if npun<0 then colpun=-1 else colpun=1:fi

z=abs(npun)
if pupa>0 nuevc1=(pupa*10)

setrgb 1,125,125,125
if colpun<0 setrgb 1,255,55,55
' fill rect 10,5,10+z,506
' fill rect 629,5,629-z,506
' fill rect 10,5,629,5+z
' fill rect 10,506,629,506-z
npun=0
pupa=0
fi

setrgb 1,255,255,255
' text 75,450,"PUNTOS:"
if colpun<0 setrgb 1,255,55,55

' text 130,450,str$(pun),"lc"

' text 320,65,str$(npun)

' text 320,50,str$(odx)
' text 300,65,str$(dx)
' text 340,65,str$(dy)
' text 300,85,str$(ultdx)
' text 340,85,str$(ultdy)






if odx=-1  then dx=0:dy=0:if and(k,16384)=0 odx=0:fi


if pausa=0 then
buf=1-buf
' inkey$
goto 1:fi

rem >>>>pausa
setrgb 1,20,70,0
fill rect 100,100,540,412

' for z=100 to 412 step 2
' line 100,z,540,z
' next

' setrgb 1,2,2,2
' text 318,142,"J U E G O   P A U S A D O."
' text 318,394,"PosT_YouR_LetteR_SoftwarE (R) 2005"

setrgb 1,222,255,255
if menup=1 text 320,140,"O P C I O N E S."
if menup=2 text 320,140,"E S T A D Í S T I C A S."
if menup=0 text 320,140,"J U E G O   P A U S A D O."

'  text 320,400,"Pulsa START para continuar."
setrgb 1,255,255,2
text 320,392,"PosT_YouR_LetteR_SoftwarE (R) 2005"


setrgb 1,102,152,2:rect 100,100,540,412

fill rect 140,200+oppau*50-50,500,200+oppau*50-20
setdispbuf buf:buf=1-buf


setrgb 1,222,255,255
if menup=0 then
text 320,220,"O P C I O N E S."
text 320,270,"E S T A D Í S T I C A S."
text 320,320,"J U G A R."
fi


k=peek("port1")
if k=8 then t(-8):pausa=0:fi
if k=16 then beep:pause .1:oppau=oppau-1:if oppau<1 oppau=3:fi
if k=64 then beep:pause .1:oppau=oppau+1:if oppau>3 oppau=1:fi
if k=16384 then t(-16384)
if menup=0 then
if oppau=3 pausa=0
if oppau=1 menup=1
if oppau=2 menup=2
fi

fi



goto 1

end sub
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>RESET
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>RESET
sub reset()

setrgb 0,20-c1,70-c2,-c3
' clear window

if vercarga=111111111111111 then
xx=-20
for zz=520 to 420 step-2
for z=1 to l-1
setrgb 1,20-c1,70-c2,-c3
fill circle 10+z*600/l,zz+2,3
setrgb 1,222,222,222
fill circle 10+z*600/l,zz,3
next
pause .03
next
fi

for y=1 to l
if vercarga=111111 then
obx=10+y*600/l
repeat
xx=xx+3
setrgb 1,20-c1,70-c2,-c3
fill circle xx-3,420,10
setrgb 1,222,222,2
fill circle xx,420,10
if xx>obx-7 and y<l then
setrgb 1,20-c1,70-c2,-c3
fill triangle xx,420 to xx+9,414 to xx+9,426
fi
pause .04
until((xx>=obx and y<l) or xx>640)
fi
setrgb 0,c1,c2,-c3


for x=1 to l:s(x,y)=is(x,y):a(x,y)=ia(x,y):b(x,y)=ib(x,y):o(x,y)=io(x,y):sp(x,y)=isp(x,y):ap(x,y)=iap(x,y):bp(x,y)=ibp(x,y):op(x,y)=iop(x,y)
v(x,y)=0
if b(x,y)>0 then o(x,y)=0:v(x,y)=100:fi
if b(x,y)=3 v(x,y)=9999

next:next

vercarga=0
cam=0
t=cam0t
fr=0
for z=0 to 9:mov(z)=0:next
for z=0 to 20:pu(z)=0:next
presenta=1

showpunn=0

rem exc pacm>>>>>>
x(0)=casax:y(0)=casay
ultdx=0:ultdy=-1
dx=0:dy=0:odx=0
tipocam=0
fatiga=0:romper=0

finfr=0
if replay=0 fin=0
rem >>>>opcion de eliminar
retumbe=0
end sub
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




3 data 8,"",30, 0,0,0,30,20,10 ,5,10,20

data 61,1,1,29,29,3,1
data 0,1,1,50,50,1,1,2

data 92


data 0,1,1,30,30,2,2,3

 data 70,9.8,2,3,2
 data 70,12.8,2,3,1
 data 70,4.8,2,3,0

data 1001,2, 16,23,0, 17,15,1




1
data 7
data"B I E N V E N I D O  A L  C O M I E N Z O.",15,-20,0,0, 20,0,20 ,20,0,20

' data 61,1,1,14,14,3,1

data 92
data 0,5,4,10,8,1.9,2.7,1

data 1001,2, 13,13,0, 1,1,1
data 61,5,3,4,8,1,2

data 70,10,2,1,0
data 70,10,2,1,3
data 70,8,2,1,2







2 data 15,"A G O B I O",30, 0,5,20, 30,20,10 ,5,10,20

' data 61,1,1,29,29,3,1
data 0,1,1,50,50,1,1,2

data 92


 data 0,1,1,29,29,3.9,2.9,3
 data 0,2,2,27,27,3.9,4.2,2
 data 0,2,2,27,27,1.4,3.8,1

 data 0,5,12,22,8,1.2,2.9,2

 data 70,10,2,1,0

 data 61,8,5,10,5,2,3
 data 61,15,9,6,15,1,3
 data 61,6,21,19,7,2,1
 data 0,8,23,7,5,1.4,2.8,3

 data 70,9.8,2,2,0
 data 70,6,2,1,0
 data 70,15,2,1,3

data 1001,2, 16,23,0, 17,15,1









sub t(d)
if d<0 repeat k=peek("port1"):until(and(k,d)=0)
if d>0 repeat k=peek("port1"):until(and(k,d)>0)

end sub

















' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'
'                   ######################
'                   #   2D SCROLL DEMO   #
'                   ######################
'
'            --------------------------------------
'            PRESS <START> In the emulator to BEGIN
'            --------------------------------------
'
'          EMULATOR'S CONFIGURATION TO RUN THIS CODE:
'                 Emu's default configuration.
'                 ------------------------------
'                           CONTROLS:
'      Arrow keys: MOVEMENT. Keep presed to push (If allowed).
'       [Supr]: STOP MOVEMENT. Keep pressed to look forward.
'                      [Ins]: MAKE SPRINT
'     I'ts just a little demo, no enemies, no end of level or
'                    deaths, just walk around.
'                  ------------------------------
'
'                       Sergio Baño soeiro
'
' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: 2D SCROLL DEMO
« Reply #1 on: July 10, 2012 »
That looks absolutely fantastic!   Years ago there was a project to make a top down RPG in Yabasic which I ended up writing the engine for.. I could only dream of making something as cool as this.. The tiles & animations are really wonderful thanks for posting it!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
Re: 2D SCROLL DEMO
« Reply #2 on: July 10, 2012 »
Thanks so much Shockwave for the enthusiastic feedback. I've read about the RPG project and it would be great if were possible to finish that big project in a poor languaje such as Yabasic. Is it abandoned project? Like to see it!

I was working myself too much in engine for tyles that drives me to get something nice, like this litte demo. It was made for the Ps2 but now in the emulator could be possible to get much better performance. Anyway at the moment it is abandoned and need to be reviewed (or even better rewrited) for the emulator.

Actually workin in a minigolf game and a point and clik adventure, have no much time to old codes that has the paticularity of ruin my mind cos' so many time i haven't cheked them  that i can hardly understand a single word of my ow old, crappy, messy and totally disordered code.. aham.

Anyway will post more code of this engine in better versions (and the 3D view) just when it works ok in the emu.

Really thank you  for apreciate it :)

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: 2D SCROLL DEMO
« Reply #3 on: July 11, 2012 »
Thanks so much Shockwave for the enthusiastic feedback. I've read about the RPG project and it would be great if were possible to finish that big project in a poor languaje such as Yabasic. Is it abandoned project? Like to see it!

My engine is here;

http://members.iinet.net.au/~jimshaw/Yabasic/yabres/games/shockwave/rpg.txt

But it's in a very raw state and it's just flip screen.  It doesn't scroll nively like yours :)
The RPG project was indeed abandoned - I think that somebody did something with the engine but I forget who it was and what they did unfortunately.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
Re: 2D SCROLL DEMO
« Reply #4 on: July 12, 2012 »
Quote
My engine is here;

http://members.iinet.net.au/~jimshaw/Yabasic/yabres/games/shockwave/rpg.txt

But it's in a very raw state and it's just flip screen.  It doesn't scroll nively like yours
The RPG project was indeed abandoned - I think that somebody did something with the engine but I forget who it was and what they did unfortunately.

Oh, yes! I remember this from the yabasic resource files!
It was indeed a really good looking project for yabasic!
Sad to be early abandoned.

Today it would be possible to make a really good tyle engine but i guess that means so much work that no ones wants to do it.

I have tyles engines abandoned myself and always looking for new ideas... programming as a hobbie means that you can't spend your life in a project and needs to get fun from new projects.. thats why I suppose most of us like to coding short demos and starting more and more little programms instead of beeing 100% working on a project.

Thanks to share! See you around :)

Offline Galileo

  • ZX 81
  • *
  • Posts: 22
  • Karma: 0
    • View Profile
Re: 2D SCROLL DEMO
« Reply #5 on: September 04, 2014 »
Wow! Wonderful! Is a very good job.

Congratulations!