Here is my entry at the moment
Santas Snake, Version 0.1
Things i would like to know are any Bugs?, What FPS you get?, How many gifts you can collect? and any improvements you can suggest.
Things i hope to change before the final version is a game mode which gives you levels - which get harder, Smoke for the hut, Tilting santa, High Score system and fix any bugs you find.
Time and the 'Mrs patience' are running out, so will see how much more i can do.
`Jammy-Soft presents
`Santas Snake
`
set display mode 1024,768,32
set window off
`land = matrix 1
`sky = object 3
`barrier= objects 7-23
`prezzie=object 25
`snow = objects 150-299
`cabin= objects 300-308
`santa - object 500
`gift finder object 550
`snowman - object 400 ->>>>
load object "gift01.x",25
gosub initialize
gosub setvariables
Gosub MakeWaves
gosub createsnow
gosub makeimages
gosub makeland
gosub skyshere
gosub barrier
gosub cabin
gosub gifts
gosub snowman
gosub santa
gosub giftfinder
gosub setcollision
gosub make3dtrees
sync on
sync rate 60
gosub starter
gosub sprites
main:
ink rgb(0,0,0),rgb(200,200,200)
do
if musicon=1 then gosub playjingle
if snowon=1 then gosub movesnow
gosub movesnowman
gosub movecam
gosub animate
gosub collision
gosub dropgifts
gosub movegiftfinder
gosub updatehud:
if snowmanhit=1
gosub endscein
gosub starter
gosub sprites
snowmanhit=0
snowmen=0
points=1000
score=0
endif
text 10,60,"fps ="
text 70,60,str$(screen fps())
`text 20,40,str$(smz#)
sync
`cls
loop
playjingle:
playing=0
If Notelength<timer() and pause=0
read notelength
notelength=notelength+timer()
for temp= 10 to 22
if sound playing(temp)=1 then stop sound temp
next temp
pause=1
pausetimer=Timer()+5
endif
if timer()>pausetimer and pause=1
read note$
if note$="end" then restore
if note$="c0" then loop sound 10
if note$="d0" then loop sound 11
if note$="e0" then loop sound 12
if note$="f0" then loop sound 13
if note$="g0" then loop sound 14
if note$="a0" then loop sound 15
if note$="b0" then loop sound 16
if note$="c1" then loop sound 17
if note$="d1" then loop sound 18
if note$="e1" then loop sound 19
if note$="f1" then loop sound 20
if note$="g1" then loop sound 21
if note$="a1" then loop sound 22
pause=0
endif
`loop
`junglebells:
`verse:
data 250,"d0",250,"b0",250,"a0",250,"g0",750,"d0",125,"d0",125,"d0",250,"d0",250,"b0",250,"a0",250,"g0",1000,"e0",250,"e0",250,"c1",250,"b0",250,"a0",500,"f0",250,"d1",250,"d1",250,"c1",250,"a0",1000,"b0"
data 250,"d0",250,"b0",250,"a0",250,"g0",1000,"d0",250,"d0",250,"b0",250,"a0",250,"g0",750,"e0",250,"e0",250,"e0",250,"c1",250,"b0",250,"a0",250,"d1",250,"d1",250,"d1",250,"d1",250,"e1",250,"d1",250,"c1",250,"a0",1000,"g0"
`chorus:
data 250,"e0",250,"e0",500,"e0",250,"e0",250,"e0",500,"e0",250,"e0",250,"g0",250,"c0",250,"d0",1000,"e0"
data 250,"f0",250,"f0",500,"f0",250,"f0",250,"e0",500,"e0",250,"e0",250,"d0",250,"d0",250,"e0",500,"d0",500,"g0"
data 250,"e0",250,"e0",500,"e0",250,"e0",250,"e0",500,"e0",250,"e0",250,"g0",250,"c0",250,"d0",1000,"e0"
data 250,"f0",250,"f0",500,"f0",250,"f0",250,"e0",500,"e0",250,"g0",250,"g0",250,"f0",250,"d0",1000,"c0"
`verse
data 250,"d0",250,"b0",250,"a0",250,"g0",750,"d0",125,"d0",125,"d0",250,"d0",250,"b0",250,"a0",250,"g0",1000,"e0",250,"e0",250,"c1",250,"b0",250,"a0",500,"f0",250,"d1",250,"d1",250,"c1",250,"a0",1000,"b0"
data 250,"d0",250,"b0",250,"a0",250,"g0",1000,"d0",250,"d0",250,"b0",250,"a0",250,"g0",750,"e0",250,"e0",250,"e0",250,"c1",250,"b0",250,"a0",250,"d1",250,"d1",250,"d1",250,"d1",250,"e1",250,"d1",250,"c1",250,"a0",1000,"g0"
`chorus
data 250,"b0",250,"b0",500,"b0",250,"b0",250,"b0",500,"b0",250,"b0",250,"d1",375,"g0",125,"a0",500,"b0",250,"c1",250,"c1",375,"c1",125,"c1",250,"c1",250,"b0",250,"b0",125,"b0",125,"b0",250,"b0",250,"a0",250,"a0",250,"b0",500,"a0",500,"d0"
data 250,"b0",250,"b0",500,"b0",250,"b0",250,"b0",500,"b0",250,"b0",250,"d1",375,"g0",125,"a0",500,"b0",250,"c1",250,"c1",375,"c1",125,"c1",250,"c1",250,"b0",250,"b0",125,"b0",125,"b0",250,"d1",250,"d1",250,"c1",250,"a0",1000,"g0",1000," "
`return
`We Wish you a merry christmas
data 500,"a0",500,"d1",250,"d1",250,"e1",250,"d1",250,"c1",500,"b0",500,"b0",500,"b0",500,"e1",250,"e1",250,"f1",250,"e1",250,"d1",500,"c1",500,"a0",500,"a0"
data 500,"f1",250,"f1",250,"g1",250,"f1",250,"e1",500,"d1",500,"b0",250,"a0",250,"a0",500,"b0",500,"e1",500,"c1",1000,"d1",500,"a0"
data 500,"d1",500,"d1",500,"d1",1000,"c1",500,"c1",500,"d1",500,"c1",500,"b0",1000,"a0",500,"e1"
data 500,"f1",500,"e1",500,"d1",500,"a1",500,"a0",250,"a0",250,"a0",500,"b0",500,"e1",500,"c1",1000,"d1",1000,"end"
return
Makewaves:
createsound("note2",0,1,5000,500,100,0,0,10,10,10,10,10) `nice zhooooo noise
createsound("note3",0,2,3000,200,1000,3,5,10,10,10,10,10) `nice click sound 3
createsound("note4",0,3,5000,500,100,0,0,1,10,10,10,10) `nice zhoooww noise
createsound("note5",0,4,1000,500,100,0,0,0,0,0,0,100) `nice pure tone
createsound("c0",0,10,268,5000,1000,0,0,0,0,0,0,1000) `note c etc Pure
createsound("d0",0,11,301,5000,1000,0,0,0,0,0,0,1000)
createsound("e0",0,12,337,5000,1000,0,0,0,0,0,0,1000)
createsound("f0",0,13,358,5000,1000,0,0,0,0,0,0,1000)
createsound("g0",0,14,401,5000,1000,0,0,0,0,0,0,1000)
createsound("a0",0,15,451,5000,1000,0,0,0,0,0,0,1000)
createsound("b0",0,16,506,5000,1000,0,0,0,0,0,0,1000)
createsound("c1",0,17,536,5000,1000,0,0,0,0,0,0,1000)
createsound("d1",0,18,602,5000,1000,0,0,0,0,0,0,1000)
createsound("e1",0,19,675,5000,1000,0,0,0,0,0,0,1000)
createsound("f1",0,20,716,5000,1000,0,0,0,0,0,0,1000)
createsound("g1",0,21,803,5000,1000,0,0,0,0,0,0,1000)
createsound("a1",0,22,902,5000,1000,0,0,0,0,0,0,1000)
return
updatehud:
`points
if points>10 then points=points-1
points$=str$(points)
lenpoin=len(points$)
for temp=1 to 5
if temp<=lenpoin
sprite 54+temp,((scrw/2)+(15*temp))-40,scrh/100,40+val(MID$(points$,temp))
endif
if temp>lenpoin
if sprite exist (temp+54)=1 then delete sprite temp+54
endif
next temp
`score
score$=str$(score)
lenscore=len(score$)
for temp=1 to 9
if temp<=lenscore
sprite 60+temp,((scrw/100)+(15*temp))+70,scrh/100,40+val(MID$(score$,temp))
endif
if temp>lenscore
if sprite exist (temp+60)=1 then delete sprite temp+60
endif
next temp
` gifts
snowmen$=str$(snowmen)
lenssnm=len(snowmen$)
for temp=1 to 9
if temp<= lenssnm
if lenssnm=1 then sprite 70+temp,((scrw-180)+(15*temp)),scrh/100,40+val(MID$(snowmen$,temp))
if lenssnm=2 then sprite 70+temp,((scrw-195)+(15*temp)),scrh/100,40+val(MID$(snowmen$,temp))
if lenssnm=3 then sprite 70+temp,((scrw-210)+(15*temp)),scrh/100,40+val(MID$(snowmen$,temp))
endif
if temp>lenssnm
if sprite exist (temp+70)=1 then delete sprite temp+70
endif
next temp
return
sprites:
sprite 50,scrw/100,scrh/100,50
sprite 51,(scrw/2)-120,scrh/100,51
if mode=1 then sprite 52,scrw-140,scrh/100,52
if mode=1 then targifts$=str$(targifts)
lentarg=len(targifts$)
if mode=2 then sprite 52,scrw-140,scrh/100,129
for temp=1 to 2
if temp<= lentarg
if mode=1 then sprite 80+temp,((scrw-70)+(15*temp)),scrh/100,40+val(MID$(targifts$,temp))
endif
if temp>lentarg
if sprite exist (temp+80)=1 then delete sprite temp+80
endif
next temp
return
endscein:
for temp= 10 to 22
if sound playing(temp)=1 then stop sound temp
next temp
if soundon=1 then play sound 3
ang#=ang
dist=200
direct=1
sprite 128,(scrw/2)-(100),scrh-50,128
repeat
ang#=ang#+1
if ang=360 then ang=0
dist=dist+direct
if dist<30 then direct=1
if dist>400 then direct=-1
SET CAMERA TO FOLLOW smx#,smy#,smz#,ang#,dist,150,10,1
cx#=camera position x()
cz#=camera position z()
if cx#<-50 then cx#=-50
if cx#>1350 then cx#=1350
if cz#<-50 then cz#=-50
if cz#>1350 then cz#=1350
position camera cx#,camera position y(),cz#
sync
until spacekey()=1
if sprite exist(128) then delete sprite 128
for temp = 401 to 499 `delete snowmen
if object exist(temp)=1 then delete object temp
next temp
move=1
return
starter:
`initialise sprites
for temp =100 to 126
sprite temp,-500,-500,temp
next temp
sprite 200,-500,-500,200
scale sprite 200,25
set sprite priority 200,1
position camera 500,200,850
position object 3,600,200,850
sprite 117,(scrw/2)-(sprite width(117)/3),scrh/10,117
`sprite 100,(scrw/2)-(sprite width(100)/2),scrh/10,100 ` santas Snake
for temp= 1 to 100
yrotate object 301,360-(temp)
point camera 900,200,700
sync
next temp
santax#=900
santaz#=700
ang=270
yrotate object 500,ang
for temp=1 to 265
santay#=get ground height(1,santax#+100,santaz#+100)
position object 500,santax#,santay#+160,santaz#
santax#=santax#-1
point camera santax#,200,santaz#
sync
next temp
for temp= 1 to 100
yrotate object 301,260+(temp)
sync
next temp
`` Options
delete sprite 117
soundon=1
musicon=1
snowon=1
res=1
mode=2
Notelength=timer()
repeat
if snowon=1 then gosub movesnow
sprite 100,(scrw/2)-(sprite width(100)/2),scrh/15,100 ` santas Snake
sprite 101,(scrw/2)-(sprite width(100)/2),scrh/20,101 `jammysoft
sprite 102,(scrw/2)-(sprite width(102)/2),scrh-50,102 `space to start
sprite 103,(scrw/5)-(sprite width(103)/2),scrh/3,103 `options
sprite 104,(scrw/5)-(sprite width(103)/2),(scrh/3)+60,104
sprite 105,(scrw/5)-(sprite width(103)/2),(scrh/3)+100,105
sprite 106,(scrw/5)-(sprite width(103)/2),(scrh/3)+140,106
`sprite 107,(scrw/5)-(sprite width(103)/2),(scrh/3)+180,107
sprite 108,(scrw/5)-(sprite width(103)/2),(scrh/3)+260,108
if soundon=1 then sprite 154,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+60,109 else sprite 154,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+60,110
if musicon=1 then sprite 155,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+100,109 else sprite 155,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+100,110
if snowon=1 then sprite 156,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+140,109 else sprite 156,(scrw/5)-(sprite width(103)/2)+100,(scrh/3)+140,110
`sprite 157,(scrw/5)-(sprite width(103)/2),(scrh/3)+220,res+110
if mode=1 then sprite 158,(scrw/5)-(sprite width(103)/2),(scrh/3)+300,115 else sprite 158,(scrw/5)-(sprite width(103)/2),(scrh/3)+300,116
`dredit
sprite 118,((scrw/5)*4)-(sprite width(118)/2),(scrh/5),118
sprite 119,((scrw/5)*4)-(sprite width(118)/2),(scrh/5)+40,119
sprite 120,((scrw/5)*4)-(sprite width(118)/2),(scrh/5)+80,120
`instructions
sprite 121,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+80,121
sprite 122,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+140,123
sprite 126,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+180,126
if mode =2 then sprite 123,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+220,122 :if sprite exist(124) then delete sprite 124
if mode =1
sprite 123,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+220,124
sprite 124,((scrw/5)*3.7)-(sprite width(121)/2),(scrh/2)+260,125
endif
sprite 200,mousex(),mousey(),200
pressed=0
if mouseclick()=1 then click=1
if click=1 and mouseclick()=0 then pressed=1 : click=0
if pressed=1
if soundon=1 then play sound 2
if sprite collision(200,104)=1 or sprite collision(200,154)=1
if soundon=1 then soundon=0 else soundon=1
endif
if sprite collision(200,105)=1 or sprite collision(200,155)=1
if musicon=1 then musicon=0 else musicon=1
if musicon=0
for temp= 10 to 22
if sound playing(temp)=1 then stop sound temp
next temp
endif
endif
if sprite collision(200,106)=1 or sprite collision(200,156)=1
if snowon=1 then snowon=0 else snowon=1
for temp = 150 to 299
if snowon=0 then hide object temp
if snowon=1 then show object temp
next temp
endif
`if sprite collision(200,107)=1 or sprite collision(200,157)=1
`res=res+1
`if res=5 then res =1
`endif
`if sprite collision(200,108)=1 or sprite collision(200,158)=1
`if mode=1 then mode=2 else mode=1
`endif
endif
if musicon=1 then gosub playjingle
sync
until spacekey()=1
`delete sprites
for temp =100 to 227
if sprite exist(temp) =1 then delete sprite temp
next temp
`set display mode - Just found out i would have to reload everything to use this - not worth it
`if res=1 then set display mode 1024,768,32
`if res=2 then set display mode 800,600,32
`if res=3 then set display mode 640,480,32
`if res=4 then set display mode 1680,1050,32
remstart
colourtext("SANTAS SNAKE",100,100)
colourtext("Jammy-soft Presents",30,101)
Colourtext("PRESS SPACE TO START",50,102)
Colourtext("Options",50,103)
colourtext("sound",30,104)
colourtext("music",30,105)
Colourtext("snow",30,106)
colourtext("screen Resolution",30,107)
colourtext("game mode",30,108)
colourtext("on",30,109)
colourtext("off",30,110)
Colourtext("1024x768",30,111)
colourtext("800x600",30,112)
colourtext("640x480",30,113)
colourtext("1680x1050",30,114)
colourtext("Go through the levels.",30,115)
colourtext("How Long Can snake get",30,116)
colourtext("Jammy-soft Presents",100,117)
colourtext("For great ideas credit go`s to",30,118)
colourtext("Snow effect - Icy_Blue [Thailand]",30,119)
colourtext("Sound system - Ric + Diggsey ",30,120)
colourtext("Instructions",50,121)
colourtext("Collect as many gifts as you can",30,122)
colourtext("Avoid hitting hut,trees and snowmen.",30,123)
colourtext("Collect the set number of gifts and",30,124)
colourtext("Return to hut. Levels will get harder.",30,125)
remend
for temp= 10 to 22
if sound playing(temp)=1 then stop sound temp
next temp
cz=850
cx=500
repeat
if cz>santaz# then dec cz
if cx<santax#+140 then inc cx
cy=200
if cz<santaz#+1 and cx>santax#+139 then camposition =1
position camera cx,cy,cz
position object 3,cx,cy,cz
point camera santax#,200,santaz#
sync
until camposition=1
`repeat
`xc#=camera angle x()
`if xc#<14 then inc xc#
`if xc#>16 then dec xc#
`if xc#>14 and xc#<16 then xc#=15.0
xrotate camera 15
`until xc#=15.0
return
make3dtrees:
`3d trees
make object box 600,5,100,5
make object cone 601,50
make object cone 602,40
make object cone 603,30
make object cone 604,20
for temp= 601 to 604
make mesh from object temp,temp
add limb 600,temp-600,temp
delete object temp
delete mesh temp
color limb 600,temp-600,rgb(0,255,0)
offset limb 600,temp-600,0,(temp-600)*15,0
next temp
texture object 600,10
texture limb 600,0,12
set object 600,1,0,1,0,0,0,0
SET OBJECT SMOOTHING 600,100
for temp= 1 to trees-1
instance object temp+600,600
next temp
for temp= 1 to trees
repeat
freespace=1
treedata(temp,1)=rnd(1200)+50 :treedata(temp,2)=rnd(1200)+50
if treedata(temp,1)>300 and treedata(temp,1)<1050 and treedata(temp,2)>600 and treedata(temp,2)<820 then freespace=0
if temp<>1
for checktree= 1 to temp-1
if treedata(temp,1)>treedata(checktree,1)-50 and treedata(temp,1)<treedata(checktree,1)+50 and treedata(temp,2)>treedata(checktree,2)-50 and treedata(temp,2)<treedata(checktree,2)+50 then freespace=0
next checktree
endif
until freespace=1
position object 599+temp,treedata(temp,1),GET GROUND HEIGHT(1, treedata(temp,1)+100,treedata(temp,2)+100)+165,treedata(temp,2)
yrotate object 599+temp,rnd(359)
next temp
return
movegiftfinder:
position object 550,smx#,smy#+65,smz#
point object 550,px#,object position y(550),pz#
return
giftfinder:
make object box 550,10,0.5,0.5
make object cone 551,10
scale object 551,5,100,50
zrotate object 551,270
make mesh from object 551,551
add limb 550,1,551
offset limb 550,0,5,0,0
offset limb 550,1,15,0,0
delete object 551
delete mesh 551
yrotate object 550,270
fix object pivot 550
`SET OBJECT Object Number, Wire, Transparent, Cull, Filter, Light, Fog, Ambient
set object 550,1,1,0,1,1,0,1
color object 550,rgb(0,0,255)
`glue object to limb 550,500,7
return
setcollision:
set object collision off 3 `sky
for temp=7 to 23
set object collision off temp `barrier
next temp
for temp= 150 to max_snow
set object collision off temp `snow
next temp
`for temp= 300 to 308
set object collision off 300 `cabin
`next temp
set object collision off 400 `snowman
`MAKE OBJECT COLLISION BOX 25, -5,-5,-5,5,5,5,1
`MAKE OBJECT COLLISION BOX 500,-5,-20,-5,5,20,5,1
set object collision off 500
set object collision off 25
`SHOW OBJECT BOUNDS 400
`SHOW OBJECT BOUNDS 25
collision:
`barrier
if smx# <-10 then snowmanhit=1
if smx# >1310 then snowmanhit=1
if smz# <-10 then snowmanhit=1
if smz# >1310 then snowmanhit=1
`
`trees
for temp=1 to trees
xdist#=treedata(temp,1)-smx# : zdist#=treedata(temp,2)-smz#
dist#=sqrt((xdist#^2)+(zdist#^2))
if dist#<20 then snowmanhit=1
next temp
`hut
if smx#>800.0 and smx#<1000.0 and smz#>630.0 and smz#<785.0 then snowmanhit=1
`Snowman collision handled in movement
`gift
if gift=2 `landed
`px#,pz#
xdist#=px#-smx# : zdist#=pz#-smz#
dist#=sqrt((xdist#^2)+(zdist#^2))
if dist#<20
gift=0
snowmen=snowmen+1
score=score+points
if soundon=1 then play sound 1
instance object 400+snowmen,400
scale object snowmen+400,200,200,200
endif
endif
return
animate:
`santa
rotate limb 500,20,0,0,armove
`rotate limb 500,21,0,0,armove
`offset limb 500,15,armove,0,0
if dirarm=0 then armove=armove+1
if dirarm=1 then armove=armove-1
if armove=55 then dirarm=1
if armove=-25 then dirarm=0
`snowman
rotate limb 400,1,0,armove-15,0
return
initialize:
autocam off
xrotate camera 15
fog off
hide mouse
set ambient light 50
backdrop off
set normalization on
hide light 0
make light 1
SET POINT LIGHT 1, 600,1000,-300
color light 1,rgb(230,230,255)
POINT LIGHT 1,600,0,1300
SET LIGHT RANGE 1,5000
return
setvariables:
scrw=screen width()
scrh=screen height()
camspeed=2
move=0
snowmen=0
snowmanspeed#=3
snowmandistance=70
dirarm=0
dim movedata#(200000,4)
trees=10
dim treedata(50,2)
gift=0
points=0
startpoints=1000
level=1
score=0
targifts=level*10
return
createsnow:
`create snow type
type TSnow
g as float `Speed
x as float `x position
y as float `y position
z as float `z position
endtype
#constant max_snow = 299
dim snow(max_snow) as TSnow
`create snow
make object sphere 150, 5
color object 150, rgb(255, 255, 255)
set object light 150, 0
snow(150).y=0
set object collision off 150
for i = 151 to max_snow
instance object i,150
snow(i).y = 0
set object collision off i
next i
return
makeimages:
`image 2 snow
`image 3 skyshere
`image 4 santa face
`image 5 santa skin
`image 10 green square
`image 11 tree
`image 12 log
`image 13 bricks
`image 25 gift `red
`image 26 gift green
`image 27 gift blue
`image 28 gift yellow
`image 29 gift pink
`image 30 gift aqua
`image 31 ->> Numbers
load image "gift01.jpg",25,1
`remstart
rem Create a memblock from it
make memblock from image 1,25
make memblock from image 2,25
make memblock from image 3,25
make memblock from image 4,25
make memblock from image 5,25
rem Loop through all image co-ordinates
for x=0 to 256
for y=0 to 192
rem Find the color at this point
c=ReadFromImageMemblock(1,256,192,x,y)
rem Check that it is red
if rgbg(c)<72
if rgbb(c)<64
rem Avoid holly berries
if x>79
if x<90
if y>101
if y<115
DONTDOIT=1
endif
endif
endif
endif
rem Make it green
if DONTDOIT=0
r=0
g=rgbr(c)
b=0
WriteToImageMemblock(1,256,192,x,y,r,g,b)
`blue
r=0
g=0
b=rgbr(c)
WriteToImageMemblock(2,256,192,x,y,r,g,b)
`yellow
r=rgbr(c)
g=rgbr(c)
b=0
WriteToImageMemblock(3,256,192,x,y,r,g,b)
`pink
r=rgbr(c)
g=0
b=rgbr(c)
WriteToImageMemblock(4,256,192,x,y,r,g,b)
`aqua
r=0
g=rgbr(c)
b=rgbr(c)
WriteToImageMemblock(5,256,192,x,y,r,g,b)
else
DONTDOIT=0
endif
endif
endif
next y
next x
rem Convert back to an image
make image from memblock 26,1
make image from memblock 27,2
make image from memblock 28,3
make image from memblock 29,4
make image from memblock 30,5
rem Delete the memblock
delete memblock 1
delete memblock 2
delete memblock 3
delete memblock 4
delete memblock 5
`remend
create bitmap 1,1500,1000
set current bitmap 1
`snow
BOX 0,0,255,255,rgb(255,255,255), rgb(255,255,255),rgb( 255,255,255),rgb(255,255,255)
`get image 1,0,0,255,255,1
for x=0 to 255
for y=0 to 255
if rnd(20)=1
dotcol=rnd(55)+200
dot x,y,rgb(dotcol,dotcol,dotcol)
endif
next y
next x
get image 2,0,0,255,255,2
`trees
`Set current bitmap 1
cls
get image 1,0,0,2,2,1
BOX 0,0,100,100,rgb(0,255,0), rgb(255,255,255),rgb(0,127,0),rgb(0,127,0)
get image 10,1,1,126,126,1
cls
sprite 10,-100,-100,10
rotate sprite 10,45
paste sprite 10,60,60
delete image 10
delete sprite 10
get image 10,1,1,121,148,1
cls
sprite 10,-200,-200,10
scale sprite 10, 100
paste sprite 10,40,100
scale sprite 10,80
paste sprite 10,50,75
scale sprite 10,60
paste sprite 10,60,60
scale sprite 10,40
paste sprite 10,70,50
box 90,245,110,289, rgb(128, 64, 64), rgb(128, 64, 64),rgb(128, 0, 0),rgb(128,0,0)
get image 12,90,245,110,289,1`log
get image 11,35,70,165,290,1`tree
delete sprite 10
cls
BOX 0,0,100,100,rgb(0,255,0), rgb(255,255,255),rgb(0,127,0),rgb(0,127,0)
get image 10,1,1,126,126,1
`3d trees
cls
BOX 0,0,200,200,rgb(157,157,157), rgb(255,255,255),rgb(157,157,157),rgb(255,255,255)
for x=0 to 200
for y=0 to 200
if rnd(10)=1
dotcol=rnd(55)+200
dot x,y,rgb(dotcol,dotcol,dotcol)
endif
next y
next x
sprite 10,-100,-100,10
rotate sprite 10,45
paste sprite 10,60,100
delete image 10
delete sprite 10
for x=0 to 120
for y=60 to 150
if rnd(30)=1
dotcol=rnd(55)
dot x,y,rgb(dotcol,dotcol+200,dotcol)
endif
next y
next x
get image 10,1,1,121,148,1
`make skyshere
cls
box 0,0,511,255,rgb(125, 125, 255),rgb(200,200,200),rgb(125,125,255),rgb(200,200,200)
`box 0,0,511,140,rgb(122,122,122),rgb(200,200,200),rgb(255,255,255),rgb(200,200,200)
for tempx=20 to 490 step 30
ink rgb(200,200,200),rgb(0,0,0)
for rad=rnd(20)+20 to 1 step -1
circle tempx+1,100,rad
circle tempx,100,rad
next rad
next tempx
ink rgb(0,255,0),rgb(0,0,0)
for t=1 to 512
tempy=rnd(50)+128
if point(t,tempy)=rgb(200,200,200) then dot t,tempy
next t
get image 3,0,0,511,255,2 `skyshere
`MAke santa textures
`face
ink rgb(0,0,0),rgb(0,0,0)
box 0,0,128,128,rgb(211, 136, 33),rgb(211, 136, 33),rgb(211, 136, 33),rgb(211, 136, 33)
get image 5,0,0,32,32,1
box 0,0,24,128,rgb(255,255,255),rgb(255,255,255),rgb(255,255,255),rgb(255,255,255)
box 103,0,127,127,rgb(255,255,255),rgb(255,255,255),rgb(255,255,255),rgb(255,255,255)
for temp=1 to 9
if temp=4 then ink rgb(0,255,255),rgb(0,0,0)
if temp=7 then ink rgb(255,225,255),rgb(0,0,0)
circle 44,58,temp
circle 44,61,temp
circle 74,58,temp
circle 74,61,temp
next temp
get image 4,0,0,127,127,1
`bricks
box 0,0,130,130,rgb(155,155,155),rgb(155,155,155),rgb(155,155,155),rgb(155,155,155)
box 4,4,64,31,rgb(155,15,15),rgb(155,15,15),rgb(155,15,15),rgb(155,15,15)
box 66,4,128,31,rgb(155,15,15),rgb(155,15,15),rgb(155,15,15),rgb(155,15,15)
box 1,33,30,64,rgb(155,15,15),rgb(155,15,15),rgb(155,15,15),rgb(155,15,15)
box 32,33,96,64,rgb(155,15,15),rgb(155,15,15),rgb(155,15,15),rgb(155,15,15)
box 98,33,128,64,rgb(155,15,15),rgb(155,15,15),rgb(155,15,15),rgb(155,15,15)
get image 13,1,1,128,64,1
sprite 13,-64,-64,13
rotate sprite 13,35
box 0,0,130,130,rgb(155,155,155),rgb(155,155,155),rgb(155,155,155),rgb(155,155,155)
paste sprite 13,32,-30
paste sprite 13,96,-30
paste sprite 13,4,28
`paste sprite 13,96,32
get image 14,1,1,129,64,1
delete sprite 13
texts:
`Numbers
for temp=40 to 49
colourtext(str$(temp-40),30,temp)
next temp
colourtext("Score :",30,50)
colourtext("Points :",30,51)
colourtext("gifts of ",30,52)
colourtext("SANTAS SNAKE",100,100)
colourtext("Jammy-soft Presents",30,101)
Colourtext("PRESS SPACE TO START",50,102)
Colourtext("Options",50,103)
colourtext("sound",30,104)
colourtext("music",30,105)
Colourtext("snow",30,106)
colourtext("screen resolution",30,107)
colourtext("game mode",30,108)
colourtext("on",30,109)
colourtext("off",30,110)
Colourtext("1024x768",30,111)
colourtext("800x600",30,112)
colourtext("640x480",30,113)
colourtext("1680x1050",30,114)
colourtext("Go through the levels.",30,115)
colourtext("How Long Can snake get",30,116)
colourtext("Jammy-soft Presents",100,117)
colourtext("For great ideas credit go`s to",30,118)
colourtext("Snow effect - Icy_Blue [Thailand]",30,119)
colourtext("Sound system - Ric + Diggsey ",30,120)
colourtext("Instructions",50,121)
colourtext("Collect as many gifts as you can",30,122)
colourtext("Avoid hitting hut,trees and snowmen.",30,123)
colourtext("Collect the set number of gifts and",30,124)
colourtext("Return to hut. Levels will get harder.",30,125)
colourtext("Use Left and Right arrow keys to stear",30,126)
paste image 25,0,0
get image 200,63,63,127,127,1 `curser
colourtext("Press Space",30,128)
colourtext("Gifts",30,129)
set current bitmap 0
return
makeland:
MAKE MATRIX 1, 1500,1500,15,15
position matrix 1,-100,110,-100
PREPARE MATRIX TEXTURE 1,2,1,1
randomize matrix 1,40
for tempx= 0 to 15
for tempz= 0 to 15
if tempx=0 or tempz=0 or tempx=15 or tempz=15
SET MATRIX HEIGHT 1, tempx, tempz,50
endif
SET MATRIX NORMAL 1, tempx,tempz,600,rnd(1000),-300
next tempz
next tempx
SET MATRIX 1,0,0,1,1,1,1,1
`SET MATRIX Matrix Number, Wire, Transparency, Cull, Filter, Light, Fog, Ambient
update matrix 1
return
skyshere:
`make skyshere
make object sphere 3,-4000
texture object 3,3
set object 3,1,1,0,1,0,1,1
set object collision off 3
return
barrier:
`make tree
make object plain 11,40,150
texture object 11,11
set object 11,1,1,0,1,1,1,1
position object 11,-10,190,-10
yrotate object 11,45
`barrier
make object plain 7,1480,150
position object 7,750,190,-10
texture object 7,11
scale object texture 7,30,1
set object 7,1,1,0,1,1,1,1
instance object 12,7
position object 12,730,200,-40
instance object 16,7
position object 16,740,210,-70
instance object 20,7
position object 20,760,220,-100
instance object 8,7
position object 8,-10,190,750
yrotate object 8,90
instance object 13,7
position object 13,-40,200,730
yrotate object 13,90
instance object 17,7
position object 17,-70,210,740
yrotate object 17,90
instance object 21,7
position object 21,-100,220,760
yrotate object 21,90
instance object 9,7
position object 9,750,190,1310
instance object 14,7
position object 14,730,200,1340
instance object 18,7
position object 18,740,210,1370
instance object 22,7
position object 22,760,220,1400
instance object 10,7
position object 10,1310,190,750
yrotate object 10,90
instance object 15,7
position object 15,1340,200,730
yrotate object 15,90
instance object 19,7
position object 19,1370,210,740
yrotate object 19,90
instance object 23,7
position object 23,1400,220,760
yrotate object 23,90
return
cabin:
`cabim
make object box 300,100,50,5
position object 300,500,160,600
`texture object 300,12
`scale object texture 300,30,1
clone object 301,300
`position object 301,500,160,660
make object box 302,5,50,12.5
`texture object 302,12
`scale object texture 302,4,1
`position object 302,452.5,160,610
clone object 303,302
`position object 303,452.5,160,650
make object box 304,5,50,55
`position object 304,547.5,160,630
`texture object 304,12
`scale object texture 304,15,1
`roof
MAKE OBJECT TRIANGLE 305, 549, 185, 596, 549, 220, 630, 549, 185, 664
`texture object 305,12
`scale object texture 305,15,1
MAKE OBJECT TRIANGLE 306, 451, 185, 596, 451, 220, 630, 451, 185, 664
`texture object 306,12
`scale object texture 306,15,1
`MAKE OBJECT TRIANGLE Object Number, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3
make object box 307,105,50,5
`position object 307,500.1,202,614
`texture object 307,2
xrotate object 307,45
make object box 308,105,50,5
`position object 308,499.9,202,646
`texture object 308,2
xrotate object 308,-45
make object box 309,7,15,7
for temp= 301 to 309
make mesh from object temp,temp
add limb 300,temp-300,temp
delete object temp
delete mesh temp
next temp
offset limb 300,1,0,0,60
offset limb 300,2,-47.5,0,7.5
offset limb 300,3,-47.5,0,52.5
offset limb 300,4,47.5,0,30
offset limb 300,5,-500,-160,-600
offset limb 300,6,-500,-160,-600
offset limb 300,7,0.1,42,14
offset limb 300,8,-0.1,42,46
offset limb 300,9,45,62,30
`color object 300,rgb(255,0,0)
texture object 300,13
scale object texture 300,5,5
texture limb 300,7,2
texture limb 300,8,2
texture limb 300,5,14
texture limb 300,6,14
scale limb texture 300,2,0.1,1
scale limb texture 300,3,0.1,1
scale limb texture 300,5,0.9,0.9
scale limb texture 300,6,0.9,0.9
set object 300,1,0,0,1,1,0,0
scale object 300,200,250,200
position object 300,900,180,650
make object box 301,5,130,70
offset limb 301,0,0,0,35
position object 301,800,180,675
texture object 301,12
scale object texture 301,15,1
set object 301,1,0,0,1,1,0,0
`yrotate object 301,-95
return
movesnow:
`move snow
for i = 150 to max_snow
snow(i).y = snow(i).y - (snow(i).g / 6)
if snow(i).y <= 120 then new_snow(i)
position object i, snow(i).x + (sin(snow(i).y * 3) * 10), snow(i).y, snow(i).z + (sin(snow(i).y * 3) * 10)
next i
return
movesnowman:
`remstart
if leftkey()=1 then ang=ang-snowmanspeed#
if rightkey()=1 then ang=ang+snowmanspeed#
if ang<0 then ang=359+ang
if ang>359 then ang =0+(ang-359)
yrotate object 500,ang
move object 500,snowmanspeed#
smx#=object position x(500)
smz#=object position z(500)
smy#=get ground height(1,smx#+100,smz#+100)+130
position object 500,smx#,smy#+30,smz#
move=move+1
if move=200000 then move=1
movedata#(move,1)=smx#
movedata#(move,2)=smy#
movedata#(move,3)=smz#
movedata#(move,4)=ang
if snowmen>0
for temp =401 to 400+snowmen
movedatpos=int(move-(snowmandistance/snowmanspeed#)*(temp-400))
position object temp,movedata#(movedatpos,1),movedata#(movedatpos,2),movedata#(movedatpos,3)
yrotate object temp,movedata#(movedatpos,4)
`collision
xdist#=movedata#(movedatpos,1)-smx# : zdist#=movedata#(movedatpos,3)-smz#
snowmandist#=sqrt((xdist#^2)+(zdist#^2))
if snowmandist#<30 then snowmanhit=1
next temp
endif
`remend
return
Movecam:
camany#= camera angle y()
camanx#= camera angle x()
` remstart followcam
SET CAMERA TO FOLLOW smx#,smy#,smz#,ang,200,150,10,1
`SET CAMERA TO FOLLOW X, Y, Z, Angle, Distance, Height, Smooth, Collision
`remend
remstart - freecam
if scancode()=17 then move camera camspeed
if scancode()=30 then rotate camera 0,camany#-90,0 : move camera camspeed :rotate camera 0,camany#,0
if scancode()=31 then move camera 0-camspeed
if scancode()=32 then rotate camera 0,camany#+90,0 : move camera camspeed :rotate camera 0,camany#,0
camany#=camany#+(mousemovex()/2)
camanx#=camanx#+(mousemovey()/2)
rotate camera camanx#,camany#,0
remend
position object 3,camera position x(),camera position y(),camera position z()
return
dropgifts:
`create gift
if gift=0
repeat
freespace=1
px#=rnd(1100)+50:pz#=rnd(1100)+50:py#=1000 :pt#=GET GROUND HEIGHT(1, px#+100,pz#+100)+115
if px#>750 and px#<1050 and pz#>600 and pz#<820 then freespace=0
for checktree= 1 to trees
if px#>treedata(checktree,1)-50 and px#<treedata(checktree,1)+50 and pz#>treedata(checktree,2)-50 and pz#<treedata(checktree,2)+50 then freespace=0
next checktree
until freespace=1
points=startpoints*level
gift=1
endif
`fall gift
if gift=1
`py#=curvevalue(pt#,py#,0.001)
py#=py#-4
if py#<pt#+1 then py#=pt# :gift = 2 `landed
position object 25,px#,py#,pz#
endif
return
gifts:
`gift
scale object 25,20,20,20
xrotate object 25,-90
fix object pivot 25
position object 25,0,-300,0
`position object 25,300,GET GROUND HEIGHT(1, 400,400)+115,300
`for temp=26 to 99
`clone object temp,25
`scale object temp,10,10,10
`px#=rnd(1200):pz#=rnd(1200)
`yrotate object 25,rnd(359)
`ran=rnd(5)
`if ran=1 then texture object temp,26
` if ran=2 then texture object temp,27
` if ran=3 then texture object temp,28
` if ran=4 then texture object temp,29
` if ran=5 then texture object temp,30
`position object temp,px#,GET GROUND HEIGHT(1, px#+100,pz#+100)+115,pz#
`next temp
return
santa:
`santa
santaz#=500
santax#=500
santay#=get ground height(1,santax#+100,santaz#+100)
`body
make object sphere 500,15.5
`zrotate object 500,-5
scale object 500,90,30,100
position object 500,santax#,santay#+143,santaz#
`fix object pivot 500
`head
make object sphere 501,10
scale object 501,80,100,80
`neck
MAKE OBJECT CYLINDER 502,4
`beard
Make object cone 503,10
`nose
Make object sphere 504,5
`hair
make object sphere 505,11
`hat
Make object cone 506,10
make object sphere 507,3
`legs
MAKE OBJECT CYLINDER 508,5
MAKE OBJECT CYLINDER 509,5
MAKE OBJECT CYLINDER 510,4
MAKE OBJECT CYLINDER 511,4
make object sphere 512,5.5
make object sphere 513,5.5
`coat
MAKE OBJECT CYLINDER 514,14
`feet + skys
make object sphere 515,5
make object sphere 516,5
make object sphere 517,5
make object sphere 518,5
`coat bottom
make object sphere 519,15.5
`armstumps
make object sphere 520,5.5
make object sphere 521,5.5
`remstart
`santa arms
make object cube 522,1
MAKE OBJECT CYLINDER 523,3
`MAKE OBJECT CYLINDER 523,3
scale object 523,100,200,100
`scale object 523,100,250,100
make object sphere 524,3.5
`make object sphere 525,3.5
MAKE OBJECT CYLINDER 525,3
scale object 525,100,200,100
zrotate object 525,90
`MAKE OBJECT CYLINDER 522,3
make object sphere 526,3.5
`make object sphere 524,3.5
Make object box 527,1,30,1
`make object box 526,1,30,1
for temp= 523 to 527
make mesh from object temp,temp
add limb 522,temp-522,temp
link limb 522,temp-523,temp-522
delete object temp
delete mesh temp
next temp
offset limb 522,1,0,0,0
offset limb 522,2,0,-3,0
offset limb 522,3,4,-3,0
offset limb 522,4,8,-3,0
offset limb 522,5,8,-16,0
make object cube 523,1
MAKE OBJECT CYLINDER 524,3
`MAKE OBJECT CYLINDER 523,3
scale object 524,100,200,100
`scale object 523,100,250,100
make object sphere 525,3.5
`make object sphere 525,3.5
MAKE OBJECT CYLINDER 526,3
scale object 526,100,200,100
zrotate object 526,90
`MAKE OBJECT CYLINDER 522,3
make object sphere 527,3.5
`make object sphere 524,3.5
Make object box 528,1,30,1
`make object box 526,1,30,1
for temp= 524 to 528
make mesh from object temp,temp
add limb 523,temp-523,temp
link limb 523,temp-524,temp-523
delete object temp
delete mesh temp
next temp
offset limb 523,1,0,0,0
offset limb 523,2,0,-3,0
offset limb 523,3,4,-3,0
offset limb 523,4,8,-3,0
offset limb 523,5,8,-16,0
`make limbs
for temp= 501 to 523
make mesh from object temp,temp
add limb 500,temp-500,temp
`if temp=501 then link limb 500,0,temp-500
`if temp=502 then link limb 500,1,temp-500
`if temp>401 and temp<413 then link limb 400,1,temp-400
`if temp>412 then link limb 400,0,temp-400
delete object temp
delete mesh temp
`if temp<>401 then color limb 400,temp-400,rgb(50,50,50)
next temp
texture object 500,2
`position limbs
`body
color limb 500,0,rgb(255,255,255)
texture limb 500,0,2
scale limb 500,0,90,30,100
`head
offset limb 500,1,0,8,0
rotate limb 500,1,0,0,5
color limb 500,1,rgb(211, 136, 33)
texture limb 500,1,4
scale limb texture 500,1,2,1
`neck
offset limb 500,2,0,3,0
`scale limb 500,2,100,300,100
rotate limb 500,2,0,0,5
color limb 500,2,rgb(1,1,1)
texture limb 500,2,5
`beard
offset limb 500,3,5,3.5,0
scale limb 500,3,60,80,60
rotate limb 500,3,0,0,240
color limb 500,3,rgb(255,255,255)
texture limb 500,3,2
`Nose`
offset limb 500,4,3,7.5,0
scale limb 500,4,80,50,60
color limb 500,4,rgb(211,0,0)
`hair
offset limb 500,5,-1,9,0
scale limb 500,5,80,100,80
color limb 500,5,rgb(255,255,255)
texture limb 500,5,2
`hat
offset limb 500,6,-4.5,16,0
scale limb 500,6,100,130,90
rotate limb 500,6,0,0,30
color limb 500,6,rgb(255,0,0)
offset limb 500,7,-7,21,0
color limb 500,7,rgb(255,255,255)
texture limb 500,7,2
`remstart
`legs
offset limb 500,8,1,-14,-4
offset limb 500,9,1,-14,4
for temp= 8 to 9
scale limb 500,temp,100,240,100
rotate limb 500,temp,0,0,30
color limb 500,temp,rgb(255,1,1)
next temp
offset limb 500,10,4,-24,-4
offset limb 500,11,4,-24,4
for temp= 10 to 11
scale limb 500,temp,100,300,100
rotate limb 500,temp,0,0,-5
color limb 500,temp,rgb(1,1,1)
next temp
`remstart
offset limb 500,12,4.5,-19.5,-4
offset limb 500,13,4.5,-19.5,4
color limb 500,12,rgb(255,1,1)
color limb 500,13,rgb(255,1,1)
` coat
offset limb 500,14,0,-7,0
scale limb 500,14,90,100,100
color limb 500,14,rgb(255,1,1)
` feet and skys
offset limb 500,15,6,-30,-4
offset limb 500,16,6,-30,4
scale limb 500,15,200,100,80
scale limb 500,16,200,100,80
color limb 500,15,rgb(1,1,1)
color limb 500,16,rgb(1,1,1)
`set object 500,1,1,1,1,1,0,0
offset limb 500,17,6,-32,-4
offset limb 500,18,6,-32,4
scale limb 500,17,900,50,100
scale limb 500,18,900,50,100
color limb 500,17,rgb(255,1,1)
color limb 500,18,rgb(255,1,1)
for temp = 15 to 18
rotate limb 500,temp,0,0,5
next temp
`remstart
`coat bottom
scale limb 500,19,90,30,100
offset limb 500,19,0,-14,0
color limb 500,19,rgb(255,255,255)
texture limb 500,19,2
`arms
offset limb 500,20,1,-1,-8
link limb 500,20,21
offset limb 500,21,0,0,16
`scale limb 500,15,100,80,100
`scale limb 500,16,100,80,100
color limb 500,20,rgb(255,1,1)
color limb 500,21,rgb(255,1,1)
link limb 500,20,22
offset limb 500,22,0,-5,0
link limb 500,20,23
offset limb 500,23,0,-5,16
color limb 500,22,rgb(255,1,1)
color limb 500,23,rgb(255,1,1)
set object 500,1,0,0,1,1,0,0
rotate object 500,0,270,0
fix object pivot 500
scale object 500,160,160,160
xrotate object 500,5
return
snowman:
`snowman
smx#=300
smy#=get ground height(1,smx#+100,smz#+100)
smz#=300
`body
make object sphere 400,28
scale object 400,80,100,80
`position object 400,smx#,smy#+114,smz#
`head
make object sphere 401,14
`nose
make object cone 402,4
scale object 402,100,200,100
`hat
make object sphere 403,12
scale object 403,100,20,100
MAKE OBJECT CYLINDER 404,8
make object sphere 405,8.5
scale object 405,100,20,100
`eyes
make object sphere 406,1.5
clone object 407,406
`mouth
make object sphere 408,1
clone object 409,408
clone object 410,408
clone object 411,408
clone object 412,408
` buttons
make object sphere 413,3
clone object 414,413
clone object 415,413
`arms
make object box 416,15,0.7,0.7
make object box 417,15,0.7,0.7
`hands
make object box 418,4,0.5,0.5
make object box 419,4,0.5,0.5
make object box 420,4,0.5,0.5
make object box 421,4,0.5,0.5
zrotate object 418,40
zrotate object 419,-40
zrotate object 420,40
zrotate object 421,-40
`scarf
make object cylinder 422,11
position object 422,smx#,smy#+129,smz#
make object plain 423,2.5,10
make object plain 424,2.5,10
`add limbs
texture object 400,2
for temp= 401 to 424
make mesh from object temp,temp
add limb 400,temp-400,temp
if temp=401 then link limb 400,0,temp-400
if temp>401 and temp<413 then link limb 400,1,temp-400
if temp>412 then link limb 400,0,temp-400
delete object temp
delete mesh temp
if temp<>401 then color limb 400,temp-400,rgb(50,50,50)
next temp
`position limbs
offset limb 400,1,0,18,0 `head
texture limb 400,1,2
`nose
rotate limb 400,2,0,0,270
offset limb 400,2,7,0,0
color limb 400,2,rgb(255,75,32)
`hat
offset limb 400,3,0,5,0
offset limb 400,4,0,9,0
offset limb 400,5,0,13,0
`eyes
offset limb 400,6,6,2,-2
offset limb 400,7,6,2,2
`mouth
offset limb 400,8,6,-2.7,0
offset limb 400,9,5.9,-2.5,1
offset limb 400,10,5.9,-2.5,-1
offset limb 400,11,5.8,-2,2
offset limb 400,12,5.8,-2,-2
`buttons
offset limb 400,13,10,9,0
offset limb 400,14,12.5,4.5,0
offset limb 400,15,13.5,0,0
`arms limb 17 and 21 seem to have swapped somehow with links pooo cant link hands
offset limb 400,16,13,9,-8
offset limb 400,17,13,9,8
rotate limb 400,17,0,-15,0
rotate limb 400,16,0,15,0
`hands
offset limb 400,18,19,10.5,9.5
offset limb 400,19,19,7.5,9.5
offset limb 400,20,19,10.5,-9.5
offset limb 400,21,19,7.5,-9.5
`scarf
offset limb 400,22,0,15,0
offset limb 400,23,-9,10.6,2
rotate limb 400,23,235,90,0
offset limb 400,24,9,10.6,-2
rotate limb 400,24,305,90,0
for temp=16 to 21
color limb 400,temp,rgb(180, 86, 35)
next temp
texture limb 400,4,25
SCALE LIMB TEXTURE 400,4,2,1
for temp= 22 to 24
texture limb 400,temp,25
next temp
`set object stuff
set object 400,1,1,1,1,1,0,0
yrotate object 400,270
fix object pivot 400
scale object 400,200,200,200
`position object 400,300,300,0
`remstart
`for temp= 1 to snowmen
`instance object 400+temp,400
`position object 400+temp,300,300,0-(temp*25)
`scale object temp+400,200,200,200
`next temp
position object 400,0,-1000,0
`remend
return
rem ============================================================================================
rem === WriteToImageMemblock() ===
rem ============================================================================================
function WriteToImageMemblock(MemblockID,ImageWidth,ImageHeight,X,Y,RedValue,GreenValue,BlueValue)
rem Find relative position in memblock
MemblockPosition=X+(Y*ImageWidth)
rem Check the position is in the memblock range
if MemblockPosition>=0
if MemblockPosition<(ImageWidth*ImageHeight)
rem Adjust the memblock accordingly
write memblock dword MemblockID,12+(MemblockPosition*4),rgb(RedValue,GreenValue,BlueValue)
endif
endif
rem End the function
endfunction
rem ============================================================================================
rem === ReadFromImageMemblock() ===
rem ============================================================================================
function ReadFromImageMemblock(MemblockID,ImageWidth,ImageHeight,X,Y)
rem Find relative position in memblock
MemblockPosition=X+(Y*ImageWidth)
rem Check the position is in the memblock range
if MemblockPosition>=0
if MemblockPosition<(ImageWidth*ImageHeight)
rem Adjust the memblock accordingly
ColorValue=memblock dword(MemblockID,12+(MemblockPosition*4))
endif
endif
rem End the function
endfunction ColorValue
`function for create +1 or -1
function sign()
x = int(rnd(1))-1
if x = 0 then x = 1
endfunction x
`function for calculate new snow's position
function new_snow(no)
snow(no).g = rnd(6) + 3
snow(no).x = (rnd(600)* sign())+600
snow(no).y = rnd(300) + 300
snow(no).z = (rnd(600)* sign())+600
endfunction
function colourtext(letter$,size,image)
` the colour thing takes too long to do for too little benifet so decided to go with black
ink rgb(113, 0, 0),rgb(0,0,0)
if image>102 and image<> 117 then ink rgb(25,25,25),rgb(0,0,0)
if image=129 then ink rgb(113, 0, 0),rgb(0,0,0)
set text font "Arial"
set text size size
cls rgb(0,0,0)
`box 500,0,1000,25,rgb(155,55,55),rgb(0,155,0),rgb(155,55,55),rgb(0,155,0)
`box 500,25,1000,50,rgb(0,155,0),rgb(155,55,55),rgb(0,155,0),rgb(155,55,55)
text 1,-3, letter$
cutx=len(letter$)*(size/1.7)
`for tempx=0 to 250
`for tempy=0 to 50
`if point(tempx,tempy)>0
`dot tempx,tempy,point(tempx+500,tempy)
`cutx=tempx
`if tempy>cuty then cuty=tempy
`endif
`next tempy
`next tempx
`cutx=cutx+1
`cuty=cuty+1
get image image,0,0,cutx,size+5,1
endfunction
function createsound(name$,soundtype,soundnumber,frequency#,length#,loudness#,bend#,decay#,vibratospeed#,vibratodepth#,tremelospeed#,tremelodepth#,attack#)
outWord as word
dword1 as dword: dword2 as dword: dword3 as dword: dword4 as dword
dword5 as dword: dword6 as dword: dword7 as dword
samples=int((length#/1000)*44100)
if memblock exist(1) then delete memblock 1
make memblock 1,samples*2+44
` write 28 memblock header bytes
dword1=1 ` gg query: is this the number of channels?
dword2=2
dword3=22050 ` gg query: seems to be half the number of samples per second - why?
dword4=88200 ` gg query: is this the number of bytes per second?
dword5=4 ` gg query: what does this represent?
dword6=16 ` gg query: (ditto) ?
dword7=0 ` gg query: (ditto) ?
position=0
write memblock byte 1, position, asc("R") : inc position
write memblock byte 1, position, asc("I") : inc position
write memblock byte 1, position, asc("F") : inc position
write memblock byte 1, position, asc("F") : inc position
write memblock dword 1, position, samples*2+36 : inc position,4
write memblock byte 1, position, asc("W") : inc position
write memblock byte 1, position, asc("A") : inc position
write memblock byte 1, position, asc("V") : inc position
write memblock byte 1, position, asc("E") : inc position
write memblock byte 1, position, asc("f") : inc position
write memblock byte 1, position, asc("m") : inc position
write memblock byte 1, position, asc("t") : inc position
write memblock byte 1, position, asc(" ") : inc position
write memblock dword 1, position, 16 : inc position,4
write memblock word 1, position, dword1 : inc position,2
write memblock word 1, position, dword2 : inc position,2
write memblock dword 1, position, dword3 : inc position,4
write memblock dword 1, position, dword4 : inc position,4
write memblock word 1, position, dword5 : inc position,2
write memblock word 1, position, dword6 : inc position,2
write memblock byte 1, position, asc("d") : inc position
write memblock byte 1, position, asc("a") : inc position
write memblock byte 1, position, asc("t") : inc position
write memblock byte 1, position, asc("a") : inc position
write memblock dword 1, position, samples*2 : inc position,4
rem generate and write wave
if file exist(name$+".wav")=1 then delete file name$+".wav"
`inc param_attackamount#,0.0001
riseinloudness#=loudness#
for x=1 to samples
outInteger=int(sin((x/122.5)*(frequency#+vibratodepth#*sin(theta#)))*(loudness#-fallinloudness#-riseinloudness#+tremelodepth#*sin(phi#)))*3.0
if outInteger <-32767 then outInteger=-32767 ` gg query: is this the valid range?
if outInteger>32767 then outInteger=32767 ` gg query: (ditto) ?
outWord=outInteger
inc theta#,vibratospeed#
inc phi#,tremelospeed#
dec frequency#,bend#
if fallinloudness#<loudness#
inc fallinloudness#,decay#
endif
if riseinloudness#>0
dec riseinloudness#,attack#
endif
write memblock word 1,position,outWord : inc position,2
next x
open to write 1,name$+".wav"
make file from memblock 1,1
close file 1
if sound exist(soundnumber)=1 then delete sound soundnumber
if soundtype
load 3dsound name$+".wav", soundnumber
else
load sound name$+".wav", soundnumber
endif
`wave file not needed
if file exist(name$+".wav")=1 then delete file name$+".wav"
` memblock no longer required
delete memblock 1
endfunction
enjoy