Hi,
Firstly, many thanks to Freddy 007, FoxBlitzz and Diggsey for thier tips during the WIP stage.
They really helped to make Daft Ski a better game.
Next... this is a downhill ski game...
quick, short, fun and only 3.3megs... (downloads in a snap!)
No more explanation needed.
Here are some screenshots:
And almost last but not least.... the link:
http://www.madglue.com/stock/daft_ski.exe
++++++++++++
I'd be more than chuffed if you tryed it out....
t.v.m.
miki.
` set window layout
set display mode 800,600,16
set window on
set window size 800,600
set window position 100,100
set window title "DAFT SKI"
set window layout 1,1,1
` sub program pre looped
sync on
cls 0
set text size 88
center text 400,200,"LOADING"
GET IMAGE 100,0,0,700,599
CLS 0
start=-1
gosub graphs1
make object plain 1,500,300
position object 1,0,0,200
lock object on 1
texture object 1,sky
set text size 33:ink 0,0
` sub program looped (choose screen size)
do
center text 400,30,"welcome to DAFTSKI... "
center text 400,70,"more questionable software by MIKISTUFF"
center text 400,140,"press " f " to play fullscreen"
center text 400,180,"press " w " to play windowed"
if inkey$()="f" then clear entry buffer :set window off:sync:goto game
if inkey$()="w" then clear entry buffer :sync: goto game
sync
loop
game:
texture backdrop 100
delete object 1:delete image 1:delete image 2
` main program pre looped
sync on:hide mouse
dir$= get dir$()
dim spx#(53) : dim spy#(53) : dim spz#(53)
dim cpx#(152) : dim cpy#(152) : dim cpz#(152)
dim tpx#(105) : dim tpy#(105) : dim tpz#(105)
dim endtime#(1)
dim name$(1)
gosub load_sounds
gosub graphs1
gosub graphs2
gosub matrix
gosub load_objects
gosub position_sticks
gosub position_checks
gosub position_trees
level=1
set camera range 1,33000
set global collision on
set object collision off 6
` restart
restart:
cd "C:\"
if path exist("ski")=1
set dir "ski"
else
endtime#(1)=300
goto home1
endif
if file exist("best_time.dat")=1
load array "best_time.dat",endtime#(0)
else
endtime#(1)=300 : goto home1
endif
if file exist("name.dat")=1
load array "name.dat",name$(0)
else
goto home1
endif
home1:
set dir dir$
start=0
endrun=0
x#=3000
z#=25000
speed#=6.8
click#=0
good=0:pen=0
a#=0
sr#=3:sl#=5
set text size 33:ink 0,0
for t= 11 to 53
set object collision on t
next t
for t= 111 to 152
set object collision on t
next t
set object frame 1,1
` main program looped
do
gosub onscreen_info
gosub entry_text
gosub exit_text
gosub position_start_finish
gosub move_ski
gosub loops
gosub splash_control
gosub col_pen
gosub control_sounds
sync
loop
` +++++++++++++++++++++++++++++++ pre loop subs ++++++++++++++++++++++++++++
` load sounds
load_sounds:
load sound "m1.wav",1
load sound "d1.wav",2
load sound "v1.wav",3
load sound "splash1.wav",4
return
` load graphics1
graphs1:
snow=1
sky=2
load bitmap "snow1.bmp",1
get image snow,0,0,128,128
delete bitmap 1
load bitmap "sky2.jpg",1
get image sky,0,0,750,337
delete bitmap 1
return
` load graphics2
graphs2:
cls 0
get image 4,0,0,10,10:`dummy splash
get image 6,0,0,10,10:`dummy splash
Rsplash=3
Lsplash=5
load bitmap "Rsplash.bmp",1
get image Rsplash,0,0,80,70
delete bitmap 1
load bitmap "Lsplash.bmp",1
get image Lsplash,0,0,80,70
delete bitmap 1
load bitmap "start.bmp",1
get image 7,0,0,100,50
delete bitmap 1
return
` make matrix
matrix:
make matrix 1,6000,26000,20,100
prepare matrix texture 1,snow,1,1
` ski slope
repeat
set matrix height 1,x,z,z1
x=x+1
if x>19
x=1
if z>4 and z<95 then z1=z1+10+rnd(150)
z=z+1
endif
until z=100
update matrix 1
` mountains right
z2=200
repeat
set matrix height 1,xl,zl,z2
xl=xl+1
if xl>6
xl=1
if zl>1 and zl<98 then z2=z2+10+rnd(150)
zl=zl+1
endif
until zl=100
update matrix 1
` mountains left
xr=14
z3=200
repeat
set matrix height 1,xr,zr,z3
xr=xr+1
if xr>19
xr=14
if zr>1 and zr<98 then z3=z3+10+rnd(150)
zr=zr+1
endif
until zr=100
update matrix 1
` front mountains
for xf=6 to 14
for zf = 1 to 5
set matrix height 1,xf,zf,500+rnd(200)
next zf
next xf
update matrix 1
` level off the end
xe=7:ze=5
repeat
set matrix height 1,xe,ze,460
xe=xe+1
if xe>14 then xe=7:ze=ze+1
until ze=9
update matrix 1
return
` load objects
load_objects:
load object "player.x",1
scale object 1,120,120,120
x#=3000
z#=25000
make object box 4,10,10,10
hide object 4
sstart=2
finish=3
make object plain sstart,100,50
sx#=3000:sz#=24950
rotate object sstart,90,0,180
texture object sstart,7
load object "finish.x",5
fx2#=3000:fz2#=2500
for t=11 to 53
load object "stick.x",t
next t
for t=111 to 152
make object box t,495,495,100
rotate object t,0,90,0
hide object t
next t
for t=55 to 105
load object "tree.x",t
scale object t,200+rnd(200),200+rnd(200),200+rnd(200)
next t
` sky box
make object sphere 6,30000
position object 6,3000,0,15000
set object 6,1,0,0
scale object 6,100,80,100
texture object 6,sky
return
` position slalem sticks
position_sticks:
stick=11
repeat
spx#(stick)=2920+rnd(160) : spz#(stick)=24800-stick_dist
spy#(stick)=get ground height(1,spx#(stick),spz#(stick))
position object stick,spx#(stick),spy#(stick),spz#(stick)
stick=stick+1
stick_dist=stick_dist+500
until stick=53
return
` position slalem checks
position_checks:
check=111
repeat
cpx#(check)=3000 : cpz#(check)=24550-check_dist
cpy#(check)=get ground height(1,cpx#(check),cpz#(check))
position object check,cpx#(check),cpy#(check),cpz#(check)
check=check+1
check_dist=check_dist+500
until check=152
return
` position trees
position_trees:
tree=55
repeat
tpx#(tree)=2200 : tpz#(tree)=23550-tree_dist
tpy#(tree)=get ground height(1,tpx#(tree),tpz#(tree))
position object tree,tpx#(tree),tpy#(tree),tpz#(tree)
tree=tree+1
tree_dist=tree_dist+1000
until tree=80
tree=81
tree_dist=0
repeat
tpx#(tree)=3800 : tpz#(tree)=23000-tree_dist
tpy#(tree)=get ground height(1,tpx#(tree),tpz#(tree))
position object tree,tpx#(tree),tpy#(tree),tpz#(tree)
tree=tree+1
tree_dist=tree_dist+1000
until tree=105
return
` +++++++++++++++++++++++++++++ looped subs +++++++++++++++++++++++
` onscreen info
onscreen_info:
ink 0,0
text 10,10,"TIME "+str$(b#)
ink rgb(0,255,0),0
text 10,50,"penelty "+str$(pen)
ink rgb(255,0,0),0
text 10,90,"check "+str$(good)
ink rgb(255,0,255),0
text 10,130,"RUN "+str$(level)
ink 0,0
text 10,170,"player "+line$
ink rgb(0,255,0),0
text 550,530,name$(1)
ink 0,0
text 550,570,"BEST TIME "+str$(endtime#(1))
return
` entry text
entry_text:
if start=0
line$=entry$()
ink 0,0
if level=1 then center text 400,300,"type your name: "+line$
center text 400,340,"press space to start moving..."
center text 400,380,"move mouse to slalem..."
center text 400,420,"if you turn around .. you stop."
center text 400,460,"left-click for extra speed...careful.."
center text 400,500,"right click to break"
if returnkey()=1 or scancode()=14 then clear entry buffer
endif
return
` exit text
exit_text:
if endrun=1
ink rgb(255,0,0),0
if good<36 then center text 400,340,"you can't slalem ... no time recorded .. sorry"
ink 0,0
center text 400,380,"turn around to stop..."
center text 400,420,"then mouseclick to move..."
center text 400,460,"press space to restart..."
center text 400,500,"or escape to quit..."
endif
return
` player move control ... plus a bit more
move_ski:
` start clock
if spacekey()=1 and z#>24900
if start<2 then start=start+1
wait 300
aa#=timer()
endif
if start=1 and endrun=0 then b#=(timer()-aa#)*0.001:position mouse 400,300
` extra mouseclick speed
if endrun=0 and start=1 and mouseclick()=1 then click#=click#+0.5
if endrun=0 and start=1 and mouseclick()=2 then speed#=speed#-0.1
if start=1 and endrun=0
if x#<2200 then x#=2201
if x#>3800 then x#=3799
endif
mmx#=mousemovex()
if a#>130 and a#< 240 then forward=1 else forward=0:`trigger for uphill/downhill
a#=wrapvalue( a#+(mmx#/3) ):` standard mouse angle control
if start=1 and forward=0
speed#=speed#+0.002: ` accellerate
x#=newxvalue(x#,a#,0-speed#+click#):z#=newzvalue(z#,a#,0-speed#+click#):`forward movement
gosub check_slalem:` check missed slalems
else
if forward=1 and speed#>0 then speed#=speed#-0.2:click#=0:` slow and stop if facing uphill
endif
` standard positioning and camera
y#=get ground height(1,x#,z#)
position object 1,x#,y#,z#
yrotate object 1,a#
position object 4,limb position x(1,1),limb position y(1,1),limb position z(1,1)
cx#=newxvalue(x#,wrapvalue(a#+180),-200)
cz#=newzvalue(z#,wrapvalue(a#+180),-200)
cy#=get ground height(1,cx#,cz#)+60.0
position camera cx#,cy#,cz#
point camera x#,y#,z#
` angle ski forward
if start=1 and speed#>7.2
xrotate object 1,330
set object speed 1,33
else
` straighten ski up
xrotate object 1,0
endif
` end of run movement stuff
if z#<2500 then endrun=1
if endrun=1
if z#>2500 then z#=2495
if x#<2600 then x#=2601
if x#>3400 then x#=3399
if mouseclick()=0
if speed#>0 then speed#=speed#-0.02
if click#>0 then click#=click#-0.02
endif
endif
if endrun=1 and mouseclick()=1
speed#=3 : set object speed 1,11:loop object 1,1,10
x#=newxvalue(x#,a#,0-speed#):z#=newzvalue(z#,a#,0-speed#):`forward movement
endif
if z#<2101 then z#=2100
if endrun=1
position mouse 400,300
if bb#=0 then bb#=300
if good<36 then b#=300:`if slalem no good then cancel time
if good>35 then bb#=b#+pen:`if slalem good then register time plus peneltys
` store time and name to file if "best time"
if bb#>0 and bb#< endtime#(1)
if bb#>0 then endtime#(1)=bb#
cd "C:\"
if path exist("ski")=1
set dir "ski"
else
make directory "ski"
set dir "ski"
endif
save array "best_time.dat",endtime#(0)
name$(1)=line$
save array "name.dat",name$(0)
set dir dir$
endif
endif
` send to restart
if spacekey()=1 and z#<2500 and endrun=1
wait 300: b#=0 : level=level+1 : start=-1: goto restart
endif
return
` position start and finish
position_start_finish:
sy#=get ground height(1,sx#,sz#)+1
position object sstart,sx#,sy#,sz#
fy2#=get ground height(1,fx2#,fz2#)+120
position object 5,fx2#,fy2#,fz2#
return
` player loop control
loops:
if start>0
if speed#<7 then l=0
if speed#>7 and speed#<9 then l=1
if speed#>9 and a#=0
l=2
else
if a#>5 and a#<50 then l=3
if a#>320 and a#<355 then l=4
endif
endif
if l=0 then loop object 1,1,1
if l=1 then loop object 1,1,10
if l=2 then set object speed 1,33 : loop object 1,15,15
if l=3 then set object speed 1,33 : loop object 1,20,20
if l=4 then set object speed 1,33 : loop object 1,30,30
if endrun=1 and mouseclick()=0 then loop object 1,40,60
return
` splash control
splash_control:
if start=1
` right splash
if l=3
if image exist(sr#) then paste image sr#,object screen x(1)+10,object screen y(1)-60,transparent
sr#=sr#+0.2
if sr#>4.7 then sr#=3
endif
` left splash
if l=4
if image exist(sl#) then paste image sl#,object screen x(1)-100,object screen y(1)-60,transparent
sl#=sl#+0.2
if sl#>6.7 then sl#=5
endif
if l<3 then sr#=3:sl#=5
endif
return
` stick collision
col_pen:
col1=object collision(1,0)
if col1 >10 and col1 <52
pen=pen+1
set object collision off col1
endif
return
` check slalem
check_slalem:
col2=object collision(4,0)
if col2 >110 and col2 <153
good=good+1
set object collision off col2
endif
return
` control sounds
control_sounds:
if start=0 and level=1 then mc1=mc1+1:me1=0
if mc1=1 then loop sound 1:loop sound 2
if mc1>10 and mc1<15 then play sound 3
if start=1 then mc2=mc2+1:mc1=0
if mc2=1 then stop sound 1
if l=3 then ms3=ms3+1:ms4=0
if ms3=1 then play sound 4
if l=4 then ms4=ms4+1:ms3=0
if ms4=1 then play sound 4
if endrun=1 then me1=me1+1
if me1>1 and me1<5 then set sound volume 1,100 : loop sound 1
if me1>5 then set sound volume 2,d
if me1>600 and d<100 then d=d+1
if d>98
if e<98 then e=e+1
set sound volume 1,100-e
endif
if start=0 and level>1 then set sound volume 2,100: set sound volume 1,100 : stop sound 1:e=0:d=0:me1=0
return
in the end