dino chase

new topic     » topic index » view thread      » older message » newer message

Formal Announcementdino chase by int, 150K, Feb 24/04
A very simple, funny demo of a boy being chased by a t-rex. It uses
liquid-nitrogen's mode 19 library (included).

Correction, That lib was originally by Liquid Nitrogen and completely
rewritten
  For Liquid Nitrogen
  By Hollow Horse Software: Lucius Hilley & Greg Harris
  - None of the original L:iquid Nitrogen code remain.
  - Only the routine names remained the same.
  - And several routines were added.

Lucius L. Hilley III - unkmar

I took the time to correct the errors in the program and add some minor
enhancements.
-- Modified by Lucius L. Hilley III of Hollow Horse Software
--  * matchhands folder must be renamed to mhands (DOS 8.3 - rules)
--  * Added set_screens() calls to remove flickering.
--  * Commented out clear_screen() calls
--    * now clearing screen with a screen_copy() call of a blank screen
--  * Replaced draw_line() calls with vline() calls
--  * Replaced the pixel() calls with vpixel() calls
--  * Added timing support


include graphics.e
include image.e
include mode19a.e

object void

void = set_screens(2)

global object gm,gk,mh1,mh2,tr1,tr2,tr3,tr4,tr5,tr6,mhx,mhy,
mhf,trx,try,trf,p,count,count2,linesx,linesy,rr,rg,rb,cr,cg,cb,
misc,mh1h,mh2h,tr1h,tr2h,tr3h,tr4h,tr5h,tr6h,bg,bgh,bgy,misc2
misc2=0
bgy=20

cr=0
cb=0
cg=0
rr=0
rb=0
rg=0
procedure calccolor()
rr=rand(10)
rg=rand(10)
rb=rand(10)
if rr<5 then
cr+=rr
elsif rr>5 then
cr-=rr
end if
if rg<5 then
cg+=rg
elsif rg>5 then
cg-=rg
end if
if rb<5 then
cb+=rb
elsif rb>5 then
cb-=rb
end if
misc=palette(1,{cr,cg,cb})
end procedure


linesx={0,320,0,320,0,320,0,320,0,320,0,320,0,320,0,320,0,320,0,320,0}
linesy={110,120,130,140,150,160,170,180,190,200,0}
count=1
count2=1
procedure movlines()
count=1
count2=1
while count!=length(linesy) do
if linesy[count]>=110 then
linesy-=1
else linesy[count]=200
end if
count+=1
end while
end procedure

procedure dlines()
count=1
count2=1
screen_copy(1, 2)--clear_screen()
while count!=length(linesx) do

--draw_line(1,{{linesx[count],linesy[count2]},{linesx[count+1],linesy[count2
]}})
vline({linesx[count],linesy[count2]},{linesx[count+1],linesy[count2]},1,1)

count+=2
count2+=1
end while
count=0
count2=0
end procedure

count=0
count2=0
procedure cls()
while count2!=200 do
while count!=320 do

--pixel(0,{count,count2})
vpixel({count,count2}, 0, 1)

count+=1
end while
count2+=1
count=0
end while
end procedure

p=1

trx={0}
try={0}
trf=1

mhx={50}
mhy={0}
mhf=1

mh1=read_bitmap("mhands\\mh1.bmp")
mh2=read_bitmap("mhands\\mh2.bmp")
tr1=read_bitmap("mhands\\tr1.bmp")
tr2=read_bitmap("mhands\\tr2.bmp")
tr3=read_bitmap("mhands\\tr3.bmp")
tr4=read_bitmap("mhands\\tr4.bmp")
tr5=read_bitmap("mhands\\tr5.bmp")
tr6=read_bitmap("mhands\\tr6.bmp")
bg=read_bitmap("mhands\\bg1.bmp")
mh1h=Bmp2Mem(mh1[2])
mh2h=Bmp2Mem(mh2[2])
tr1h=Bmp2Mem(tr1[2])
tr2h=Bmp2Mem(tr2[2])
tr3h=Bmp2Mem(tr3[2])
tr4h=Bmp2Mem(tr4[2])
tr5h=Bmp2Mem(tr5[2])
tr6h=Bmp2Mem(tr6[2])
bgh=Bmp2Mem(bg[2])

gm=graphics_mode(19)
screen_copy(2, 0)

all_palette(mh1[1]/4)

procedure dbg()
screen_copy(1, 2)--clear_screen()
display_clip({0,bgy},bgh,0)
end procedure

gk=get_key()

procedure calckey()
if gk=333 then
mhx+=10
elsif gk=331 then
mhx-=10
end if
end procedure

procedure dmh()
if mhf=1 then
display_clip({mhx[1],mhy[1]},mh1h,1)
mhf=2
elsif mhf=2 then
display_clip({mhx[1],mhy[1]},mh2h,1)
mhf=1
end if
end procedure

procedure movtr()
if p=1 then
if trx[1]<280 then
trx+=1
elsif trx[1]>=280 then
p=2
end if
elsif p=2 then
if trx[1]>0 then
trx-=1
elsif trx[1]<=0 then
p=1
end if
end if
end procedure

procedure dtr()
if trx[1]=0 then
display_clip({trx[1],try[1]},tr4h,1)
elsif trx[1]=145 then
display_clip({trx[1],try[1]},tr5h,1)
elsif trx[1]=200 then
display_clip({trx[1],try[1]},tr6h,1)
end if
if trf=1 then
display_clip({trx[1],try[1]},tr1h,1)
trf=2
elsif trf=2 then
display_clip({trx[1],try[1]},tr2h,1)
trf=3
elsif trf=3 then
display_clip({trx[1],try[1]},tr3h,1)
trf=1
end if
end procedure

procedure calcbgmov()
if misc2=0 then
if bgy>=-20 then
bgy-=1
else misc2=1
end if
elsif misc2=1 then
if bgy<=20 then
bgy+=1
else misc2=0
end if
end if
end procedure

while gk!=27 do
--screen_copy(1, 2)
gk=get_key()
calccolor()
calckey()
movlines()
--calcbgmov()
--dbg()
dlines()
movtr()
dtr()
dmh()
screen_copy(0, 1)
void = time()+.15
while (void > time()) do
end while
end while

gm=-1
gm=graphics_mode(-1)

free(mh1h[1])
free(mh2h[1])
free(tr1h[1])
free(tr2h[1])
free(tr3h[1])
free(tr4h[1])
free(tr5h[1])
free(tr6h[1])

void = set_screens(0)


new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu