Hello everybody! There's some really good entries for this challenge.
That1Smart Guy: Great physics and a good idea having trampolines and difficulty level.
Irojo: The game looks very neat and when you put in enemies it'll be a really good game.
BN2: You seem to have gone all out on the maths! I like the accurate physics, although sometimes it is a bit glitchy.
razerx: This is quite fun and would an awesome game. I love how simple and smooth the physics is, but I think that ball slows down too fast in the x dimension.
Here's my entry:
cls 0
sync on
randomize timer()
autocam off
create bitmap 1,4100,800
gosub gethedgetex
gosub GetBackgroundTex
gosub GetFractals
gosub GetOtherTexs
set current bitmap 0
delete bitmap 1
make object box 1,15,5,4
make mesh from object 1,1
add limb 1,1,1
hide limb 1,1
offset limb 1,1,5,0,0
make object box 4,9,8,7
texture object 4,106
glue object to limb 4,1,1
make object plain 2,640,480
texture object 2,102
scale object texture 2,0.5,1
position object 2,320,240,10
make object plain 3,256,192
texture object 3,105
set object 3,1,0,1
position object 3,-200,146,-10
make matrix 1,800,20,8,2
position matrix 1,0,0,-15
prepare matrix texture 1,101,2,1
fill matrix 1,0,1
for x=0 to 8
set matrix height 1,x,1,50
next x
set matrix tile 1,7,0,2
set matrix tile 1,7,1,2
update matrix 1
position camera 320,240,-380
rotate camera 0,0,0
bgscroll#=0
do
stickx#=30
sticky#=53
stickxvel#=0
stickyvel#=0
stickang#=0
stickangvel#=10
matmoved#=0
mode=1
endround=0
tree=0
position object 1,stickx#,sticky#,0
zrotate object 1,stickang#
position matrix 1,0,0,-15
position object 2,320,240,10
scroll object texture 2,0-bgscroll#,0
bgscroll#=0
position object 2,320,240,10
position camera 320,240,-380
hide mouse
while endround=0
if mode=1 then gosub Shooting
if mode=2 then gosub Movement
if mode=3 then gosub Finished
sync
endwhile
sync
loop
gethedgetex:
texturexsize=64
textureysize=64
ink rgb(0,128,0),0
box 1,1,texturexsize,textureysize
ink rgb(0,100,25),0
for i=1 to 500
dot rnd(texturexsize),rnd(textureysize)
next i
for i=1 to 1000
x1=rnd(texturexsize)
y1=rnd(textureysize)
x2=(rnd(10)-5)+x1
y2=y1-rnd(5)+5
ink rgb(0,rnd(150)+100,0),0
line x1,y1,x2,y2
next i
ink rgb(0,255,0),0
box 64,1,128,64
get image 101,1,1,texturexsize+10,textureysize
return
GetBackgroundTex:
persistance#=0.6
iterations=10
totalfreq=2^iterations
iterations#=5
smoothed=0
dim noise#(iterations,totalfreq)
dim perlinnoise#(totalfreq)
for i=0 to iterations
i#=i
amplitude#=persistance#^i#
frequency=2^i
gapbetween=totalfreq/frequency
gapbetween#=gapbetween
for j=0 to frequency-1
noise#=(rnd(amplitude#*1000)-(amplitude#*1000)/2)/1000.0
noise#(i,j*gapbetween)=noise#
next i
noise#(i,frequency*gapbetween)=noise#(i,0)
if smoothed=1
for j=1 to frequency-1
noise#(i,j*gapbetween)=noise#(i,j*gapbetween)/2+noise#(i,(j-1)*gapbetween)/4+noise#(i,(j+1)*gapbetween)/4
next j
endif
for j=0 to frequency-1
if j=0 then y0#=noise#(i,j*gapbetween) else y0#=noise#(i,(j-1)*gapbetween)
y1#=noise#(i,j*gapbetween)
if j=frequency then y2#=y1# else y2#=noise#(i,(j+1)*gapbetween)
if j>=frequency-1 then y3#=y2# else y3#=noise#(i,(j+2)*gapbetween)
for k=1 to gapbetween
x#=k/gapbetween#
noise#(i,j*gapbetween+k)=cubicinterpolate#(y0#,y1#,y2#,y3#,x#)
next k
next j
next i
lowestpoint#=1
highestpoint#=-1
for i=0 to totalfreq
for j=0 to iterations
perlinnoise#(i)=perlinnoise#(i)+noise#(j,i)
next j
if perlinnoise#(i)>highestpoint# then highestpoint#=perlinnoise#(i)
if perlinnoise#(i)<lowestpoint# then lowestpoint#=perlinnoise#(i)
next i
rem Display
cls
range#=(highestpoint#+0.2)-(lowestpoint#-0.1)
gridwidth=totalfreq
gridheight=range#*200
dim grid(gridwidth,gridheight)
startvalue=100
maxvalue=200
minvalue=100
variation=70
if variation>abs(maxvalue-minvalue) then variation=abs(maxvalue-minvalue)
for x=1 to gridwidth
for y=1 to gridheight
grid(x,y)=startvalue
next y
next x
for i=1 to gridwidth*gridheight/10
feild=abs(maxvalue-minvalue)
x=rnd(gridwidth)
y=rnd(gridheight)
value=rnd(feild)
grid(x,y)=value
next i
for x=1 to gridwidth-1
for y=1 to gridheight-1
otherpoints=0
totalofothers=0
if x>0
value=grid(x-1,y)
if value<>startvalue then otherpoints=otherpoints+1 : totalofothers=totalofothers+value
endif
if y>0
value=grid(x,y-1)
if value<>startvalue then otherpoints=otherpoints+1 : totalofothers=totalofothers+value
endif
if x<gridwidth
value=grid(x+1,y)
if value<>startvalue then otherpoints=otherpoints+1 : totalofothers=totalofothers+value
endif
if y<gridheight
value=grid(x,y+1)
if value<>startvalue then otherpoints=otherpoints+1 : totalofothers=totalofothers+value
endif
if otherpoints>0
o#=otherpoints
t#=totalofothers
average#=t#/o#
else
average#=startvalue
endif
gridvalue=average#+(rnd(variation)-(variation/2))
if gridvalue<minvalue then gridvalue=minvalue
if gridvalue>maxvalue then gridvalue=maxvalue
ink rgb(255,255,255),0
grid(x,y)=gridvalue
gv#=gridvalue
rg#=gv#/100*90
ink rgb(rg#,rg#,gridvalue),0
dot x,y+(lowestpoint#-0.1)*200+400
next y
next x
scale=1
ink rgb(50,50,255),0
for i=1 to totalfreq
line i*scale,perlinnoise#(i)*200+400,i*scale,(lowestpoint#-0.1)*200+400
next i
get image 102,1,(lowestpoint#-0.1)*200+400,totalfreq,(highestpoint#+0.2)*200+400
return
GetFractals:
arraynums=65536
cls
dim set(arraynums)
rules=1
dim rule$(rules,1)
rule$(1,0)="8" : rule$(1,1)="1638761487"
setsize=GenerateSet(10,"8",rules,arraynums)
DrawFractal(320.0,470.0,270.0,15.0,20.0,setsize,rgb(255,220,0))
undim set(arraynums)
undim rule$(rules,1)
get image 103,1,1,640,480
cls
dim set(arraynums)
rules=1
dim rule$(rules,1)
rule$(1,0)="1" : rule$(1,1)="11464131317363141417"
setsize=GenerateSet(4,"333331",rules,arraynums)
DrawFractal(320.0,470.0,0.0,16.0,8.0,setsize,rgb(110,220,130))
undim set(arraynums)
undim rule$(rules,1)
get image 104,1,1,640,480
cls
dim set(arraynums)
rules=2
dim rule$(rules,1)
rule$(1,0)="8" : rule$(1,1)="146687387316318741"
rule$(2,0)="1" : rule$(2,1)="11"
setsize=GenerateSet(6,"8",rules,arraynums)
DrawFractal(320.0,470.0,270.0,25.0,3.0,setsize,rgb(220,180,150))
undim set(arraynums)
undim rule$(rules,1)
get image 105,1,1,640,480
return
GetOtherTexs:
cls
ink 255,0
box 1,1,10,10
get image 106,1,1,10,10
get image 107,11,1,20,10
return
Shooting:
mx=mousex()
my=mousey()
angle#=atanfull(my-438,mx-15)
angle$=str$(0-angle#)
dpoint=0
for i=1 to len(angle$)
if mid$(angle$,i)="." then dpoint=i
next i
if dpoint>0
angle$=left$(angle$,dpoint+2)
endif
distance#=(mx-15)^2+(my-438)^2
ink rgb(255,190,125),0
circle 15,438,200
ink rgb(220,128,0),0
circle 15,438,5
if angle#>-90 and angle#<0
if distance#>40000
newx=15+cos(angle#)*200
newy=438+sin(angle#)*200
line 15,438,newx,newy
line newx,newy,newx+cos(angle#+135)*10,newy+sin(angle#+135)*10
line newx,newy,newx+cos(angle#-135)*10,newy+sin(angle#-135)*10
else
line 15,438,mx,my
line mx,my,mx+cos(angle#+135)*10,my+sin(angle#+135)*10
line mx,my,mx+cos(angle#-135)*10,my+sin(angle#-135)*10
endif
if mouseclick()=1
mode=2
distance#=sqrt(distance#)
if distance#>200 then distance#=200
stickxvel#=cos(0-angle#)*distance#/4
stickyvel#=sin(0-angle#)*distance#/4
strckangvel#=0-distance#/15
endif
endif
set text size 30
text mx+cos(angle#)*5,my+sin(angle#)*5-10,angle$+chr$(176)
return
Movement:
stickx#=stickx#+stickxvel#
stickxvel#=stickxvel#*0.999
sticky#=sticky#+stickyvel#
stickyvel#=stickyvel#*0.99
if (sticky#+(stickyvel#-0.2))>53 then stickyvel#=stickyvel#-0.2
stickang#=wrapvalue(stickang#+stickangvel#)
stickangvel#=curvevalue(stickang#-curveangle(90,stickang#,10),stickangvel#,100)
if sticky#<53 and stickyvel#<1 and stickyvel#>-1
stickxvel#=stickxvel#*0.8
stickyvel#=stickyvel#*0.8
endif
if sticky#<50
geometricmean#=sqrt(stickxvel#^2+stickyvel#^2)
arithmeticmean#=(abs(stickxvel#)+abs(stickyvel#))/2
bounce#=abs(180-wrapvalue(stickang#+90))/250+0.5
stickyvel#=stickyvel#*(0-bounce#)
sticky#=50
if stickang#<=90 then stickangvel#=(0-stickang#/90)*arithmeticmean#
if stickang#>90 and stickang#<=270 then stickangvel#=(180-stickang#)/90*arithmeticmean#
if stickang#>270 and stickang#<=360 then stickangvel#=(360-stickang#)/90*arithmeticmean#
endif
if stickxvel#>-0.2 and stickxvel#<0.2 and stickyvel#>-0.2 and stickyvel#<0.2 and sticky#<53
if wrapvalue(stickang#-90)>180 then stickang#=0 else stickang#=180
stickangvel#=0
mode=3
endif
position object 1,stickx#,sticky#,0
zrotate object 1,stickang#
if sticky#>500
ink rgb(220,128,0),0
screenx=(stickx#-camera position x())+320
line screenx,10,screenx,30
line screenx,10,screenx+5,15
line screenx,10,screenx-5,15
text screenx+5,10,str$(int(sticky#)/10.0)+"m"
endif
ink rgb(220,128,0),0
set text size 20
text 520,100,"Distance: "+str$(int(stickx#)/10.0)+"m"
if stickx#>camera position x()
oldcx#=camera position x()
position camera oldcx#+(stickx#-oldcx#)*0.2,240,-380
moved#=camera position x()-oldcx#
scroll object texture 2,moved#/50000.0,0
bgscroll#=bgscroll#+moved#/50000.0
position object 2,camera position x(),240,10
matmoved#=matmoved#+moved#
if matmoved#>100 then matmoved#=matmoved#-100 : shift matrix left 1
position matrix 1,camera position x()-matmoved#-320,0,-15
if moved#>0
if rnd(500/moved#)=0 and tree=0
texture object 3,103+rnd(2)
position object 3,camera position x()+400,146,-10
tree=1
endif
endif
if camera position x()-400>object position x(3) then tree=0
endif
return
Finished:
set text size 70
ink rgb(220,128,0),0
center text 320,50,"You Flung "+str$(int(stickx#)/10.0)+"m!"
sync
set text size 50
if presskeyflash>10 then center text 320,150,"Press space to fling again"
presskeyflash=presskeyflash-1
if presskeyflash<0 then presskeyflash=50
if spacekey()=1 then endround=1
return
end
function cubicinterpolate#(y0#,y1#,y2#,y3#,x#)
P#=(y3#-y2#)-(y0#-y1#)
Q#=(y0#-y1#)-P#
R#=y2#-y0#
S#=y1#
Px3#=P#*x#*x#*x#
Qx2#=Q#*x#*x#
Rx#=R#*x#
return#=Px3#+Qx2#+Rx#+S#
endfunction return#
function GenerateSet(iterations,axiom$,rules,arraynums)
dim set1(arraynums)
dim set2(arraynums)
for i=1 to len(axiom$)
set1(i)=val(mid$(axiom$,i))
next i
set1size=len(axiom$)
set2size=0
setno=1
for i=1 to iterations
setno=1-setno
if setno=0
set2size=0
for j=1 to set1size
rulefound=0
for k=1 to rules
if rule$(k,0)=str$(set1(j))
for l=1 to len(rule$(k,1))
set2size=set2size+1
set2(set2size)=val(mid$(rule$(k,1),l))
next l
rulefound=1
endif
next k
if rulefound=0
set2size=set2size+1
set2(set2size)=set1(j)
endif
next j
else
set1size=0
for j=1 to set2size
rulefound=0
for k=1 to rules
if rule$(k,0)=str$(set2(j))
for l=1 to len(rule$(k,1))
set1size=set1size+1
set1(set1size)=val(mid$(rule$(k,1),l))
next l
rulefound=1
endif
next k
if rulefound=0
set1size=set1size+1
set1(set1size)=set2(j)
endif
next j
endif
next i
if setno=0
for i=1 to set2size
set(i)=set2(i)
next i
setsize=set2size
else
for i=1 to set1size
set(i)=set1(i)
next i
setsize=set1size
endif
undim set1(arraynums)
undim set2(arraynums)
endfunction setsize
function DrawFractal(x#,y#,angle#,angchange#,movelen#,setsize,colour)
dim stackx#(1000)
dim stacky#(1000)
dim stackang#(1000)
stackon=0
ink colour,0
for i=1 to setsize
if set(i)=1 or set(i)=8 or set(i)=9
line x#,y#,x#+cos(angle#)*movelen#,y#+sin(angle#)*movelen#
line x#+1,y#+1,x#+cos(angle#)*movelen#+1,y#+sin(angle#)*movelen#+1
line x#-1,y#-1,x#+cos(angle#)*movelen#-1,y#+sin(angle#)*movelen#-1
x#=x#+cos(angle#)*movelen#
y#=y#+sin(angle#)*movelen#
endif
if set(i)=3
angle#=angle#-angchange#
endif
if set(i)=4
angle#=angle#+angchange#
endif
if set(i)=6
stackon=stackon+1
stackx#(stackon)=x#
stacky#(stackon)=y#
stackang#(stackon)=angle#
endif
if set(i)=7
x#=stackx#(stackon)
y#=stacky#(stackon)
angle#=stackang#(stackon)
stackon=stackon-1
endif
next i
undim stackx#(1000)
undim stacky#(1000)
undim stackang#(1000)
endfunction
I went along the same lines as That1Smart Guy and BN2. You've got the fling the stick (by clicking) and try to get it as far as possible. The stick has got some blue rubber (or other bouncy material) which causes it to bounce higher when it lands on that side and also weighs it down.
The background mountains are generated with some perlin noise with my own texture generator for the rocks, and the trees are generated using L-system Fractals.
I have got a theory of why this challenge thread dwindled, it may be psychological. If not many people comment and praise when someone posts and entry, and the judge doesn't go through each entry in turn commenting on good and bad points, people might begin to feel demotivated and less likely to post entries.
Just a thought.

"There is no charge for awesomeness" - The Kung Fu Panda