せっかくなので、勢いで作った物を晒します。
でたらめな構成なので参考にはなりませんが(苦笑)
【操作】
カーソルの左右で移動、上でルー○。
戦闘中は右で攻撃、左で退却。
buffer 1,800,16,0 :hsvcolor ,,169 :boxf :color 0 :boxf 162,0,608,16
color 255,255 :pos 162,0 :mes "王" :color 255 :pos 592,0 :mes "魔"
hm=50 :hp=hm :at=5 :x=42 :xo=x :y=0 :mov=2 :r=160 :g=180.0 :b=255.0 :lb=0
screen 0,320,16,0 :cls 4 :randomize
*main
gosub *hyouji :rx=x-42
if rx=0 :hp=hm :if lb=2 :goto *owari
if lb=0 {if rx=398 :lb=1 :gosub *battle
if (x>48)&(x<435) :if (x!xo)&(rnd(100)>97) :xo=x :gosub *battle
} :title "体力="+hp+" 強さ="+at
stick key,5
if key&1 :xo=x :x-mov
if key&4 :xo=x :x+mov
if key&2 :repeat 24 :y- :gosub *hyouji :await 20:loop :x=42 :y=0 :at=limit(at-5,5,200)
x=limit(x,42,440) :await 33 :goto *main
*hyouji
redraw 0
if lb=2 :color 160,180,255 :else :color r-(r/540*x),g-(g/540*x),b-(b/540*x)
boxf :gmode 2,320,16 :pos 0,0 :gcopy 1,x-16,0
color ,255 :pos 152,y :mes "勇" :redraw 1 :return
*battle
repeat 81 :color 0 :boxf 160-cnt*2,0,160,16
boxf 160,0,160+cnt*2,16 :await 10 :loop
rx=x-42
if lb=1 :e=2000 :er=255 :eg=0 :eb=0 :cm="魔 ":else {
e=limit(rnd(rx/2)+(rx/2),1,5000)
er=rnd(200)+55 :eg=rnd(200)+55 :eb=rnd(200)+55 :cm="敵 "
} :ehp=e :exp=0
*bloop
cls 4 :color er,eg,eb :pos 128,0 :mes cm+ehp
if d=1 :goto *bout
if w=1 :w=0 :goto *bout
*keyin
stick key
if key&1 :if (rnd(10)<3)|(lb=1) {
cls 4:color 255 :pos 120,0 :mes "MISS!!" :wait 10:goto *atack
}else :goto *bend
if Key&4 :ehp=limit(ehp-(rnd(at)/2+at),0,5000) :goto *atack
await 33 :goto *keyin
*atack
hp=limit(hp-((rnd(e)/at)+(e/at)),0,3000)
repeat 30 :color 0 :boxf :color er,eg,eb :pos 128+(rnd(10)-5),0 :mes cm+ehp :await 10 :loop
if hp<=0 :d=1
if ehp<=0 :w=1
title "体力="+hp+" 強さ="+at :exp+1 :wait 10 :goto *bloop
*bout
if d=1 :color 255 :boxf :hsvcolor ,,255 :pos 128,0 :mes "GAMEOVER" :wait 200 :end
at=limit(at+exp,5,120) :hm=limit(hm+5*exp,50,500)
if lb=1 :lb=2 :gsel 1 :color 0 :pos 592,0 :mes "魔" :gsel 0
*bend
wait 50 :return
*owari
cls 2 :cm="CLEAR !!"
repeat 100 :color rnd(100)+155,rnd(100)+155,rnd(100)+155
pos 128,0 :mes cm :await 33 :loop
color 255,255 :pos 128,0 :mes cm
お世辞にも良い出来とはいえませんが、RPGを作る上で
バランス調整でいかに時間と労力を必要とするのかは
多少なりとも体験できました・・・バランスが取れた訳ではないですが(汗)