Here is the new code.. Without the LAN Multi-player part i was "Trying" to do.. As i said it whould be best if you didn´t saw it =).. Thanks //Freezer
Rem jumping hat
Rem movie
rem Specify your AVI filename and an animation number
rem load animation "war hats.avi",1
rem Place your AVI in the top left corner of the screen
rem place animation 1,0,0,animation width(1),animation height(1)
rem Will play your AVI animation
rem play animation 1
rem Will wait for you to press any key
rem suspend for key
rem Delete the animation
rem delete animation 1
Rem Hoppande hatt
autocam off : sync rate 60
hide mouse : sync on
rem This command will load a midi music file into number one
load music "musik.mp3",1
rem Play the music that was loaded into number one
loop music 1
rem Will wait for you to press any key
rem suspend for key
rem Stop the music from playing
rem stop music 1
rem Delete music from memory and free the music number used
rem delete music 1
rem Load and play music
rem load music "Music1.MID",1 : loop music 1
rem Make four walls
make object box 1,10,200,1000 : position object 1,-500,100,0 : color object 1,rgb(155,40,20)
make object box 2,10,200,1000 : position object 2, 500,100,0 : color object 2,rgb(155,40,20)
make object box 3,1000,200,10 : position object 3, 0,100,-500 : color object 3,rgb(155,40,20)
make object box 4,1000,200,10 : position object 4, 0,100, 500 : color object 4,rgb(155,40,20)
rem Make a floor and create texture for it
make object box 5,1000,10,1000 : position object 5,0,-5,0 : color object 5,rgb(0,255,0)
load image "golv.bmp",1
texture object 5,1
rem create bitmap 1,32,32 : cls rgb(0,155,0) : ink rgb(0,145,0),0 : box 4,4,12,12
rem get image 1,0,0,32,32 : delete bitmap 1 : texture object 5,1
rem scale object texture 5,200,200
rem Make a pedestal steps
for t=0 to 4
make object box 6+t,50,8,50
position object 6+t,0,4+(t*15),100+(t*50)
load image "plattor.bmp",1
texture object 6+t,1
`color object 6+t,rgb(200,200,55)
next t
rem make more steps
rem 12th step
make object box 12,50,8,50
position object 12,0,80,350
texture object 12,1
rem 13th step
make object box 13,50,8,50
position object 13,0,100,400
texture object 13,1
rem 14th step
make object box 14,50,8,50
position object 14,0,120,450
texture object 14,1
rem 15th step
make object box 15,945,8,25
position object 15,0,140,485
texture object 15,1
rem 16th step
make object box 16,25,8,1000
position object 16,485,140,0
texture object 16,1
rem 17th step
make object box 17,25,8,1000
position object 17,-485,140,0
texture object 17,1
rem 18th step
make object box 18,945,8,25
position object 18,0,140,-485
texture object 18,1
rem Make a player object (and a non-rotated collision box for it)
make object Cone 11,10
load image "mössa.bmp",1
texture object 11,1
rem create bitmap 1,32,32 : cls rgb(0,155,0) : ink rgb(0,145,0),0 : box 4,4,12,12
rem get image 1,0,0,32,32 : delete bitmap 1 : texture object 5,1
position object 11,0,0,0
`color object 11,rgb(20,100,255)
make object collision box 11,-5,-5,-5,5,5,5,0
disable object zdepth 11
rem Make the pedastal use non-rotated box collision
for t=0 to 4
make object collision box 6+t,-25,-4,-25,25,4,25,0
next t
make object collision box 12,-25,-4,-25,25,4,25,0
make object collision box 13,-25,-4,-25,25,4,25,0
make object collision box 14,-25,-4,-25,25,4,25,0
make object collision box 15,-500,-4,-12,500,4,25,0
make object collision box 16,-12,-4,-500,12,4,500,0
make object collision box 17,-12,-4,-500,12,4,500,0
make object collision box 18,-500,-4,-12,500,4,25,0
rem Make the wall and floor objects into static objects (for auto-camera collision)
for t=1 to 10
make static object t
objx#=object position x(t)
objy#=object position y(t)
objz#=object position z(t)
objsx#=object size x(t)/2.0
objsy#=object size y(t)/2.0
objsz#=object size z(t)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
delete object t
next t
rem Make sky black
color backdrop 0
rem Start off player gravity
playergrav#=2.0
rem Main loop
do
rem User prompts
`ink rgb(255,255,0),0
`center text 320,2,"War Hats"
`center text 320,10,"_______________________________________________________"
`center text 320,30,"Använd höger, vänster, upp och ner pil för att styra. Hoppa gör man med SPACE"
rem Store old positions
oldposx#=object position x(11)
oldposy#=object position y(11)
oldposz#=object position z(11)
rem Control player object
if upkey()=1 then move object 11,2
if downkey()=1 then move object 11,-2
if leftkey()=1 then yrotate object 11,wrapvalue(object angle y(11)-3)
if rightkey()=1 then yrotate object 11,wrapvalue(object angle y(11)+3)
if spacekey()=1 and playergrav#=0.0 then playergrav#=2.0
`if shiftkey()=1 then Stop Music 1
rem Get current object position
posx#=object position x(11)
posy#=object position y(11)
posz#=object position z(11)
rem Handle a touch of gravity
playergrav#=playergrav#-0.1
posy#=posy#+playergrav#
rem Handle sliding collision for player object with other objects
position object 11,posx#,posy#,posz#
if object collision(11,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=0.0
endif
rem Set a size for the player object
s#=object size y(11)/2.0
rem Ensure camera stays out of static collision boxes
if get static collision hit(oldposx#-s#,oldposy#-s#,oldposz#-s#,oldposx#+s#,oldposy#+s#,oldposz#+s#,posx#-s#,posy#-s#,posz#-s#,posx#+s#,posy#+s#,posz#+s#)=1
dec posx#,get static collision x()
dec posy#,get static collision y()
dec posz#,get static collision z()
if get static collision y()<>0.0 then playergrav#=0.0
endif
rem Update with new object position
position object 11,posx#,posy#,posz#
rem Use camera tracker to follow player object
angle#=object angle y(11)
camdist#=25.0 : camhigh#=posy#+10.0 : camfade#=3.5
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
rem Tilt camera down a little
xrotate camera 15
rem For fun, slightly move pedastal step
rem move object 10,0.1
rem Update screen
sync
rem End loop
loop
rem Restore object if ever leave this loop
enable object zdepth 11