Hmm, nope that makes the car go sideways for some reason lol but still no animation ><
This is my script
`Setup App
Sync On : Sync Rate 0
autocam off
set display mode 1280,1024,32,
`Start menu loop
Do
if Button(20,55,"New Game")=1 then Goto New_Game
Button(20,95,"Load Game")
Button(20,15,"Welcome to Harry Jacksons, BLOCK RACING!")
If Button(20,135,"Exit")=1 then End
`Sync/Loop
sync
loop
`If new game button pressed
New_Game:
cls
Repeat
Text 512-(text width("Press any key to Start!")/2),384,"Press any key to Start!"
sync
Until scancode()>0
`Make Player
load object "media\Dark Tank.x",1
scale object 1,2,2,2
rotate object 1,0,0,90
position object 1,0,.75,0
`Grass Texture
cls
for i=1 to 64
for t=1 to 64
color=rnd(255)
ink rgb(0,color,0),rgb(0,color,0)
box i-1,t-1,i+1,t+1
next t
next i
get image 1000,1,1,64,64
`Make World
make object plain 1000,2000,2000
xrotate object 1000,-90
texture object 1000,1000
scale object texture 1000,300,300
set object texture 1000,2,0
`Set Values
Speed as float
Acell as float
Acell=.01
Friction as integer
Friction=150 : `Note: A higher friction value = Less friction(Yea, it's kinda strange)
time=timer()
`Start Main Loop
Do
`Needed for Timer Based Movement
if screen fps()<>0 then Gametime#=(60.0/screen fps())
Moving=0
`Controls
If Upkey()=1
Moving=1
if speed<1.9
inc Speed,Acell*gametime#
endif
endif
If Downkey()=1
Moving=1
if speed>-1.9
dec Speed,Acell*gametime#
endif
endif
If Leftkey()=1
Moving=1
dec a#,150.0*((speed/10.5))*gametime#
endif
If Rightkey()=1
Moving=1
inc a#,150.0*((speed/10.5))*gametime#
endif
`Effect Object
move object 1,Speed
yrotate object 1,a#
speed=curvevalue(0,speed,friction)
`Effect Camera
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position Camera curvevalue(posx#,camera position x(),10),object position y(1)+6,curvevalue(posz#,camera position z(),10)
Point Camera object position x(1),object position y(1)+6,object position z(1)
`animate player
if object playing(1)=0 and Moving=1
play object 1
endif
if Moving=0
stop object 1
endif
`Sync/Loop
sync
Loop
end
`*******************
`FUNCTIONS
`*******************
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
This is the one i want to get the animations going on:
`Setup App
Sync On : Sync Rate 0
autocam off
set display mode 1280,1024,32,
`Start menu loop
Do
if Button(20,55,"New Game")=1 then Goto New_Game
Button(20,95,"Load Game")
Button(20,15,"Welcome to Harry Jacksons, BLOCK RACING!")
If Button(20,135,"Exit")=1 then End
`Sync/Loop
sync
loop
`If new game button pressed
New_Game:
cls
Repeat
Text 512-(text width("Press any key to Start!")/2),384,"Press any key to Start!"
sync
Until scancode()>0
`Make Player
load object "media\dark tank.x",1
load image "media\tanks03.dds",1
texture object 1,1
scale object 1,20,20,20
position object 1,0,.75,0
`Grass Texture
cls
for i=1 to 64
for t=1 to 64
color=rnd(255)
ink rgb(0,color,0),rgb(0,color,0)
box i-1,t-1,i+1,t+1
next t
next i
get image 1000,1,1,64,64
`Make World
make object plain 1000,2000,2000
xrotate object 1000,-90
texture object 1000,1000
scale object texture 1000,300,300
set object texture 1000,2,0
`Set Values
Speed as float
Acell as float
Acell=.01
Friction as integer
Friction=150 : `Note: A higher friction value = Less friction(Yea, it's kinda strange)
time=timer()
`Start Main Loop
Do
`Needed for Timer Based Movement
if screen fps()<>0 then Gametime#=(60.0/screen fps())
`Controls
If Upkey()=1 and speed<1.9
inc Speed,Acell*gametime#
endif
If Downkey()=1 and speed>-1.9
dec Speed,Acell*gametime#
endif
If Leftkey()=1
dec a#,150.0*((speed/10.5))*gametime#
endif
If Rightkey()=1
inc a#,150.0*((speed/10.5))*gametime#
endif
`Effect Object
move object 1,Speed
yrotate object 1,a#
speed=curvevalue(0,speed,friction)
`Effect Camera
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position Camera curvevalue(posx#,camera position x(),10),object position y(1)+6,curvevalue(posz#,camera position z(),10)
Point Camera object position x(1),object position y(1)+6,object position z(1)
`Sync/Loop
sync
Loop
end
`*******************
`FUNCTIONS
`*******************
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
Thanks, Svothe
A Violent Pigeon is a good Pigeon.