set display mode 800,600,32 : sync on : sync rate 0 : sync : randomize timer() : autocam off : backdrop on : color backdrop rgb(47,47,47) : HIDE MOUSE : set text font "arial" : set text to bold : set text size 16 : dim mz(27,27) as word : dim dx(2000) : dim dy(2000) : dim atk(2000) : dim lif(2000) : dim spd(2000) : e as word : for t=0 to 16 : read a,b,c : atk(t)=a : lif(t)=b
spd(t)=c : next t : for t=1 to 34 : a$="RPGmed/"+str$(t)+".bmp" : load image a$,t : next t : for t=1000 to 1099 : make object plain t,9,9 : position object t,999,999,999 : hide object t : set object transparency t,1 : make object sphere t+100,1 : position object t+100,-999,-999,-999 : ghost object on t+100 : next t : for t=1 to 729 : make object plain t,15,15 : next t : make object plain 999,8,8 : TEXTURE OBJECT 999,34 : SET OBJECT TRANSPARENCY 999,1 : make object sphere 888,2.5 : texture object 888,33
position object 888,-999,-999,-999 : ghost object on 888 : set object light 888,0 : make object sphere 998,4 : hide object 998 : do : center text 400,200,"Press [L] to LOAD GAME" : center text 400,220,"or [N] for NEW GAME" : IF KEYSTATE(49) : level=0 : Keys=0 : Gold=0 : Life=50 : XP=0 : UPG=1000 : ATK=4 : BOW=2 : DEF=1 : SPD=12 : EXIT : ENDIF : IF KEYSTATE(38)
if file exist("Charac.txt")=0 : end : else : open to read 2,"charac.txt" : read word 2,LEVEL : read word 2,KEYS : read word 2,GOLD : read word 2,LIFE : read word 2,XP : read word 2,UPG : read word 2,ATK : read word 2,BOW : read word 2,DEF : read word 2,SPD : close file 2 : endif : EXIT : ENDIF : sync : loop
StartLevelHere: : IF LEVEL>20 : cls : center text 400,200,"YOU BEAT THE WHOLE GAME!" : sync : wait 3500 : end : ENDIF : if file exist("Charac.txt") : delete file "Charac.txt" : endif : open to write 2,"Charac.txt" : write word 2,LEVEL : write word 2,KEYS : write word 2,GOLD : write word 2,LIFE : write word 2,XP : write word 2,UPG : write word 2,ATK : write word 2,BOW : write word 2,DEF : write word 2,SPD : close file 2
L$="RPGmed/Maze"+str$(Level)+".lvl" : open to read 1,L$ : for y=1 to 27 : for x=1 to 27 : read word 1,e : mz(x,y)=e : next x : next y : close file 1 : z=0 : for x=1 to 27 : for y=1 to 27 : t=mz(x,y) : inc z : if t<34 : TEXTURE OBJECT Z,T : else : TEXTURE OBJECT Z,1 : position object 999,x*15,y*15,0 : endif : position object z,x*15,y*15,0 : next y : next x :
for q=1 to 1000 : Gosub SPAWNMONSTER : next q : if Gold>UPG : show mouse : do : center text 400,100,"Click on a stat to upgrade:" : center text 400,200,"Sword" : center text 400,220,"Bow" : center text 400,240,"Armor" : center text 400,260,"Speed" : if mouseclick() : my=(mousey()-180)/20 : if my : if my=1 : inc atk : endif : if my=2 : inc bow : endif : if my=3 : inc def : endif
if my=4 : inc spd,2 : endif : dec gold,UPG : hide mouse : inc UPG,1000 : wait 150 : exit : endif : endif : sync : loop : endif : life=life+(xp/100) : t1#=timer() : DO : gs#=(timer()-t1#)*0.002123456 : t1#=timer() : inc Shot#,gs#*spd : dx=keystate(30)-keystate(32) : dy=keystate(17)-keystate(31) : DontMove=0 : position object 998,object position x(999)+dx*5,object position y(999)+dy*5,0
a=object collision(998,0) : t=limb texture(a,0) : explode=1 : select t : case 2 : DontMove=1 : Explode=0 : endcase : case 3 : if Keys>0 : dec keys : Else : DontMove=1 : Explode=0 : endif : endcase : case 4 : for t=1000 to 1099 : hide object t : position object t,999,999,999 : next t : inc level : goto StartLevelHere
endcase : case 5 : inc XP,10 : endcase : case 6 : inc keys : endcase : case 7 : inc gold,100 : endcase : case 8 : inc gold,250 : endcase : case 9 : inc gold,10 : endcase : case 10 : inc life,50 : endcase : case 11 : inc life,150 : endcase : case 12
inc atk : endcase : case 13 : inc bow : endcase : case 14 : inc def : endcase : case 15 : inc spd,2 : endcase : endselect : if t=1 or t>32 : Explode=0 : endif : If explode : for b=1 to 5 : position object b+1099+(NewEx*20),object position x(a),object position y(a),3 : rotate object b+1099+(NewEx*20),0,90,rnd(359) : color object b+1099+(NewEx*20),rgb(255,255,0)
next b : texture object a,1 : Inc NewEx : if NewEx>4 : NewEx=0 : endif : Endif : if DontMove=0 : position object 999,object position x(999)+dx*gs#*spd,object position y(999)+dy*gs#*spd,2 : endif : position camera object position x(999),object position y(999),125 : point camera object position x(999),object position y(999),0 : if life>( 100+ (xp/10) ) : life = ( 100+ (xp/10) ) : endif : text 620,0,"Level: "+str$(Level) : text 620,20,"Life: "+str$(life) : text 620,40,"Gold: "+str$(gold) : text 620,60,"Keys: "+str$(Keys) : text 620,80," XP : "+str$(XP) : text 620,120,"ATK: "+str$(ATK) : text 620,140,"BOW: "+str$(BOW) : text 620,160,"DEF: "+str$(DEF)
text 620,180,"SPD: "+str$((SPD/2)) : Gosub SPAWNMONSTER : FOR T=1000 TO 1099 : if object visible(t) : position object 998,object position x(t)+dx(t)*6,object position y(t)+dy(t)*6,0 : a=object collision(998,0) : IF A>0 : b=limb texture(a,0) : if (b<2 or b>3) and ( abs(dx(t)) + abs(dy(t)) )>0 : position object t,object position x(t)+dx(t)*gs#*spd(t),object position y(t)+dy(t)*gs#*spd(t),2 : else : dx(t)=rnd(2)-1 : dy(t)=rnd(2)-1 : endif : ENDIF : d#=sqrt( (object position x(t)-object position x(999))*(object position x(t)-object position x(999)) + (object position y(t)-object position y(999))*(object position y(t)-object position y(999)) ) : if d#<9.25 : dmg=atk(t)-def : if dmg<1 : dmg=1 : endif
dec life,dmg : dec lif(t),atk : endif : RNG=1 : b=object collision(888,t) : if b : dec lif(t),Bow : position object 888,-888,-888,-888 : RNG=2 : dx(t)=-dx(1) : dy(t)=-dy(1) : endif : if lif(t)<1 : p=limb texture(t,0)-15 : p=1+(p*p)/RNG : XP=XP+P : for b=1 to 20 : position object b+1099+(NewEx*20),object position x(t),object position y(t),3 : rotate object b+1099+(NewEx*20),0,90,rnd(359) : color object b+1099+(NewEx*20),rgb(255,0,0) : next b : Inc NewEx : if NewEx>4
NewEx=0 : endif : hide object t : position object t,999,999,999 : endif : endif : move object t+100,gs#*41.33 : NEXT T : if object in screen(888)=0 and Shot#>22.2 : bx=leftkey()-rightkey() : by=upkey()-downkey() : if abs(bx)+abs(by)>0 : position object 888,object position x(999),object position y(999),0.25 : dx(1)=bx : dy(1)=by : Shot#=0.0 : endif : endif : position object 998,object position x(888)+dx(1)*6,object position y(888)+dy(1)*6,0 : a=object collision(998,0) : if a>0 : t=limb texture(a,0) : if t<2 or t>3
position object 888,object position x(888)+dx(1)*gs#*spd*2.25,object position y(888)+dy(1)*gs#*spd*2.25,2 : else : position object 888,-888,-888,-888 : endif : endif : rotate object 888,rnd(359),rnd(359),rnd(359) : sync : if life<1 : cls : center text 400,200,"You Died!" : sync : wait 3500 : end : endif : loop
SPAWNMONSTER: : f=rnd(z-1)+1 : t=limb texture(f,0) : if t=5 : m=rnd(99)+1000 : if object visible(m)=0 : a=rnd(Level) : if a>16 : a=16 : endif : atk(m)=atk(a) : lif(m)=lif(a) : spd(m)=spd(a) : dx(m)=rnd(2)-1 : dy(m)=rnd(2)-1 : texture object m,16+a : show object m : position object m,object position x(f),object position y(f),2 : endif : endif : RETURN
data 1,1,4,3,2,12,5,5,6,7,5,5,9,8,8,11,12,10,13,14,3,15,21,7,17,30,9,19,40,4,20,8,21,23,50,6,12,150,3,24,65,16,18,35,19,30,60,10,40,75,5
Remstart
Dungeon Ordeal - DBP u6 - 21 Level RPG - 18 Lines - Requires Media - Legal for 20LC
Full old-"Gauntlet"-style mini-RPG, with monsters, mazes,
saving and loading (so you can come back to it later),
treasures, keys and doors, upgrades you can find or purchase,
all sqeezes into 18 lines.
this follows the rules for the 20 Line Challenge, as no line
has more than 23 commands on it, and there's just 18 lines.
it also requires a media folder download, which is 190kb UNcompressed,
which is legal for the 20LC.
(it's only 54k as a zip)
The vast majority of images for this game were taken from a tileset
made available by David Gervais, known here for The Artist's Challenge thread,
and to the "real" game industry for many years.
The rest of the images are from other public-domain sources.
Play it up, tell me what you think, and how far you get!
_____Instructions_____
MOVE using WASD keys
SHOOT using ARROW keys
(yes, you can move in one direction, while shooting in another)
Find the EXIT to move on to the next level
Pick up KEYS to unlock DOORS
Pick up SWORD, ARMOR, BOW, BOOTS to upgrade your character
Pick up GOLD, GEMS, MUSHROOMS to purchase UPGRADES
SHOOT monsters from a distance to kill them without getting hurt
shooting them only gets you 1/2 XP
TOUCH monsters to fight them with your sword. you WILL get hurt
Pick up BREAD and MEAT to gain HEALTH.
Get bonus HEALTH at start of new level based on EXPERIENCE (XP)
Maximum HEALTH is also related to XP
MONSTERS come from GENERATORS
Touch GENERATORS to destroy them
Remend