Well I think I'm going to start again...I tried to do it without using any media or animations but it isn't working out. Here is what I had:
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem === Project: PoPR ===
rem === Created: 31/03/2007 10:26:39 ===
rem === Author: Andrew Neale ===
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem === GlobalSetup ===
rem ==========================================================================================
rem ==========================================================================================
GlobalSetup:
rem Set screen resolution
set display mode 800,600,32
rem Hide loading
HideLoading()
rem Disable default cursor
hide mouse
rem Set transparent colour
set image colorkey 255,0,128
rem Disable autocam
autocam off
rem Correct lighting
set normalization on
rem Set random seed
randomize timer()
rem Initialise Cloggy's D3D dll
d3d_init
rem Declare constants, types and variables
gosub DeclareConstants
gosub DeclareTypes
gosub DeclareVariables
rem ==========================================================================================
rem ==========================================================================================
rem === Main ===
rem ==========================================================================================
rem ==========================================================================================
Main:
rem Hide loading
HideLoading()
rem Delete any exiting media
DeleteAll()
rem Produce texture
`Floor(grass)
cls
lock pixels
d3d_color 0,164,0,255
d3d_box 0,0,64,64
d3d_color 0,196,0,255
for i=0 to 128
d3d_dot rnd(64),rnd(64)
next i
unlock pixels
FLOOR_TEXTURE_IMAGE=FindFreeImage()
get image FLOOR_TEXTURE_IMAGE,0,0,64,64
`Rock
cls
lock pixels
d3d_color 240,220,140,255
d3d_box 0,0,64,64
d3d_color 160,148,86,255
for i=0 to 128
d3d_dot rnd(64),rnd(64)
next i
unlock pixels
ROCK_TEXTURE_IMAGE=FindFreeImage()
get image ROCK_TEXTURE_IMAGE,0,0,64,64
`Sky
cls
lock pixels
d3d_color 110,180,255,255
d3d_box 0,0,512,512
for i=0 to 16
x=24+rnd(464)
y=24+rnd(208)
maxr=8+rnd(16)
for r=1 to maxr
s#=r
t#=maxr
h#=s#/t#
d3d_color 255,255,255,255.0-(255.0*h#)
d3d_circle x,y,r,0
next r
next i
unlock pixels
SKY_TEXTURE_IMAGE=FindFreeImage()
get image SKY_TEXTURE_IMAGE,0,0,512,512
`Grass strands
cls
lock pixels
d3d_color 255,0,128,255
d3d_box 0,0,64,64
d3d_color 0,164,0,255
for s=1 to 16
t=1+rnd(7)
x1=8+rnd(48)
x2=x1+8-rnd(16)
for p=(x1-(t/2)) to (x1+(t/2))
d3d_line p,64,x2,0
next p
next s
unlock pixels
GRASS_TEXTURE_IMAGE=FindFreeImage()
get image GRASS_TEXTURE_IMAGE,0,0,64,64
`Sword(metal)
cls
lock pixels
d3d_color 128,128,128,255
d3d_box 0,0,64,64
d3d_color 196,196,196,255
for i=0 to 128
d3d_dot rnd(64),rnd(64)
next i
unlock pixels
SWORD_TEXTURE_IMAGE=FindFreeImage()
get image SWORD_TEXTURE_IMAGE,0,0,64,64
rem Make simple floor
FLOOR_OBJECT=FindFreeObject()
make object plain FLOOR_OBJECT,1000,1000
xrotate object FLOOR_OBJECT,90
fix object pivot FLOOR_OBJECT
texture object FLOOR_OBJECT,FLOOR_TEXTURE_IMAGE
scale object texture FLOOR_OBJECT,50,50
sc_setupobject FLOOR_OBJECT,SC_LEVEL_GROUP,SC_POLYGON_COLLSION
rem Make some rocks
for r=1 to 20
ROCK_OBJECT=FindFreeObject()
make object sphere ROCK_OBJECT,100
scale object ROCK_OBJECT,20+rnd(50),20+rnd(150),20+rnd(50)
texture object ROCK_OBJECT,ROCK_TEXTURE_IMAGE
scale object texture ROCK_OBJECT,10,10
a#=rnd(360)
d#=rnd(500)
x#=sin(a#)*d#
z#=cos(a#)*d#
position object ROCK_OBJECT,x#,0,z#
sc_setupobject ROCK_OBJECT,SC_LEVEL_GROUP,SC_POLYGON_COLLISION
next r
rem Make sky
SKY_OBJECT=FindFreeObject()
make object sphere SKY_OBJECT,1000
set object cull SKY_OBJECT,0
set object ambient SKY_OBJECT,0
set object light SKY_OBJECT,0
texture object SKY_OBJECT,SKY_TEXTURE_IMAGE
rem Make grass strands
FIRST_GRASS_OBJECT=FindFreeObject()
for g=1 to 64
if g=64
LAST_GRASS_OBJECT=FindFreeObject()
endif
GRASS_OBJECT=FindFreeObject()
make object plain GRASS_OBJECT,20,20
texture object GRASS_OBJECT,GRASS_TEXTURE_IMAGE
set object ambient GRASS_OBJECT,0
set object light GRASS_OBJECT,0
set object transparency GRASS_OBJECT,4
a#=rnd(360)
d#=rnd(500)
x#=sin(a#)*d#
z#=cos(a#)*d#
position object GRASS_OBJECT,x#,10,z#
next g
rem Make player object
PLAYER_OBJECT=FindFreeObject()
make object box PLAYER_OBJECT,20,50,20
exclude object on PLAYER_OBJECT
rem Make sword
SWORD_OBJECT=FindFreeObject()
make object box SWORD_OBJECT,1,50,5
offset limb SWORD_OBJECT,0,0,25,0
texture object SWORD_OBJECT,SWORD_TEXTURE_IMAGE
rem Initial values
Player.Position.X=0.0
Player.Position.Y=200.0
Player.Position.Z=0.0
Player.Angle.X=0.0
Player.Angle.Y=0.0
Player.Angle.Z=0.0
Player.Gravity=0.0
Player.Collision.OnFloor=0
Player.Collision.Hit=0
Player.Collision.Height=50.0
Player.Collision.MinDiameter=20.0
Player.Collision.MaxDiameter=20.0
rem Lock frame rate to 60fps
LockFrameRate(60)
rem Start the main loop
do
rem Read input into variables
gosub StoreInput
rem Control player
ControlPlayer()
rem Update camera
UpdateCamera()
rem Handle sword
HandleSword()
rem Update grass
HandleGrass()
rem Refresh the screen
sync
rem End the loop
loop
rem ==========================================================================================
rem ==========================================================================================
rem === EndOfProgram ===
rem ==========================================================================================
rem ==========================================================================================
EndOfProgram:
end
rem ==========================================================================================
rem ==========================================================================================
rem === Subroutines ===
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem === StoreInput ===
rem ==========================================================================================
StoreInput:
rem Store mouse data in variable
Mouse.OldClick=Mouse.Click
Mouse.Click=mouseclick()
Mouse.Position.X=mousex()
Mouse.Position.Y=mousey()
Mouse.Position.Z=mousez()
Mouse.Speed.X=mousemovex()
Mouse.Speed.Y=mousemovey()
Mouse.Speed.Z=mousemovez()
rem Store key presses
Key.W=keystate(17)
Key.A=keystate(30)
Key.S=keystate(31)
Key.D=keystate(32)
rem Back to call
return
rem ==========================================================================================
rem === DeclareConstants ===
rem ==========================================================================================
DeclareConstants:
rem Declare all constants related to Sparky's dll
`Collision types
#constant SC_POLYGON_COLLISION 0
#constant SC_SPHERE_COLLISION 1
#constant SC_BOX_COLLISION 2
`Collision groups
#constant SC_LEVEL_GROUP 1
rem Back to call
return
rem ==========================================================================================
rem === DeclareTypes ===
rem ==========================================================================================
DeclareTypes:
rem Declare all generic types
type XYZFloat
X as float
Y as float
Z as float
endtype
rem Declare all types related to input
type Mouse
Click as integer
OldClick as integer
Position as XYZFloat
Speed as XYZFloat
endtype
type Key
W as boolean
A as boolean
S as boolean
D as boolean
endtype
rem Declare all types related to the player
type Collision
Height as float
MinDiameter as float
MaxDiameter as float
Hit as integer
OnFloor as integer
endtype
type Sword
Bob as float
Block as integer
Attack as integer
Slash as integer
endtype
type Player
Position as XYZFloat
Angle as XYZFloat
Gravity as float
Collision as Collision
Sword as Sword
endtype
rem Back to call
return
rem ==========================================================================================
rem === DeclareVariables ===
rem ==========================================================================================
DeclareVariables:
rem Declare all variables related to input
global Mouse as Mouse
global Key as Key
rem Declare all variables related to the player
global Player as Player
rem Declare all variables related to object ids
global PLAYER_OBJECT as integer
global SWORD_OBJECT as integer
global FIRST_GRASS_OBJECT as integer
global LAST_GRASS_OBJECT as integer
rem Back to call
return
rem ==========================================================================================
rem ==========================================================================================
rem === Functions ===
rem ==========================================================================================
rem ==========================================================================================
rem ==========================================================================================
rem === HandleSword() ===
rem ==========================================================================================
function HandleSword()
rem Control movement
`At rest
if Mouse.Click=0
if Player.Sword.Block>0
Player.Sword.Block=Player.Sword.Block-4
endif
Player.Sword.Slash=Player.Sword.Slash-8
if Player.Sword.Slash<0
Player.Sword.Slash=0
endif
if Player.Sword.Attack=60
Player.Sword.Attack=0
Player.Sword.Slash=150
else
if Player.Sword.Attack>0
Player.Sword.Attack=Player.Sword.Attack-4
endif
endif
else
`Attacking
if Mouse.Click=1 and Player.Sword.Slash=0
Player.Sword.Block=Player.Sword.Block-8
if Player.Sword.Block<0
Player.Sword.Block=0
endif
Player.Sword.Attack=Player.Sword.Attack+4
if Player.Sword.Attack>60
Player.Sword.Attack=60
endif
else
`Blocking
if Mouse.Click=2
Player.Sword.Attack=Player.Sword.Attack-8
if Player.Sword.Attack<0
Player.Sword.Attack=0
endif
Player.Sword.Slash=Player.Sword.Slash-8
if Player.Sword.Slash<0
Player.Sword.Slash=0
endif
Player.Sword.Block=Player.Sword.Block+4
if Player.Sword.Block>60
Player.Sword.Block=60
endif
endif
endif
endif
rem Update object
position object SWORD_OBJECT,camera position x(),camera position y(),camera position z()
rotate object SWORD_OBJECT,camera angle x(),camera angle y(),camera angle z()
move object right SWORD_OBJECT,15+(sin(Player.Sword.Bob)*5)-(Player.Sword.Block/4)
move object up SWORD_OBJECT,-30+abs(cos(Player.Sword.Bob)*5)
move object SWORD_OBJECT,30
rotate object SWORD_OBJECT,camera angle x()+10,camera angle y(),camera angle z()
if Player.Sword.Slash>0
rotate limb SWORD_OBJECT,0,-Player.Sword.Attack-(sin(Player.Sword.Slash-108)*90.0),0,Player.Sword.Block-Player.Sword.Attack-`Player.Sword.Slash
else
rotate limb SWORD_OBJECT,0,-Player.Sword.Attack,0,Player.Sword.Block-Player.Sword.Attack-Player.Sword.Slash
endif
rem End the function
endfunction
rem ==========================================================================================
rem === HandleGrass() ===
rem ==========================================================================================
function HandleGrass()
rem Loop through and point at camera
for g=FIRST_GRASS_OBJECT to LAST_GRASS_OBJECT
point object g,camera position x(),object position y(g),camera position z()
next g
rem End the function
endfunction
rem ==========================================================================================
rem === RunGroupCollision() ===
rem ==========================================================================================
function RunGroupCollision(ColObj,Group,Exclude,MaxDiameter#,MinDiameter#,Height#,ReturnFlag)
rem State flags
OnFloor=0
Hit=0
rem Store ColObj position
x#=object position x(ColObj)
y#=object position y(ColObj)
z#=object position z(ColObj)
rem Collision
y1=sc_raycastgroup(Group,x#,y#,z#,x#,y#-50,z#,Exclude)
y1#=sc_getcollisiondistance(0)
if y1#>0.0 and y1#<(Height#/2)
y#=y#+((Height#/2)-y1#)
OnFloor=1
Hit=1
endif
y2=sc_raycastgroup(Group,x#,y#,z#,x#,y#+50,z#,Exclude)
y2#=sc_getcollisiondistance(0)
if y2#>0.0 and y2#<(Height#/2)
if OnFloor=0
y#=y#-((Height#/2)-y2#)
OnFloor=2
Hit=1
else
OnFloor=3
Hit=1
endif
endif
for ay=0 to 315 step 45
i=sc_raycastgroup(Group,x#,y#-(Height#/4.0),z#,newxvalue(x#,ay,50),y#-(Height#/4.0),newzvalue(z#,ay,50),Exclude)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MinDiameter#/2)
x#=newxvalue(x#,ay,i#-(MinDiameter#/2))
z#=newzvalue(z#,ay,i#-(MinDiameter#/2))
Hit=1
endif
next ay
for ay=0 to 315 step 45
i=sc_raycastgroup(Group,x#,y#+(Height#/2.0),z#,newxvalue(x#,ay,50),y#+(Height#/2.0),newzvalue(z#,ay,50),Exclude)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MinDiameter#/2)
x#=newxvalue(x#,ay,i#-(MinDiameter#/2))
z#=newzvalue(z#,ay,i#-(MinDiameter#/2))
Hit=1
endif
next ay
for ay=0 to 315 step 45
i=sc_raycastgroup(Group,x#,y#,z#,newxvalue(x#,ay,50),y#,newzvalue(z#,ay,50),Exclude)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MaxDiameter#/2)
x#=newxvalue(x#,ay,i#-(MaxDiameter#/2))
z#=newzvalue(z#,ay,i#-(MaxDiameter#/2))
Hit=1
endif
next ay
rem Update object
position object ColObj,x#,y#,z#
rem Set return value
if ReturnFlag=0
ReturnValue=OnFloor
else
if ReturnFlag=1
ReturnValue=Hit
else
ReturnValue=(Hit*4)+OnFloor
endif
endif
rem End the function
endfunction ReturnValue
rem ==========================================================================================
rem === RunObjectCollision() ===
rem ==========================================================================================
function RunObjectCollision(ColObj,LvlObj,MaxDiameter#,MinDiameter#,Height#,ReturnFlag)
rem State flags
OnFloor=0
Hit=0
rem Store ColObj position
x#=object position x(ColObj)
y#=object position y(ColObj)
z#=object position z(ColObj)
rem Collision
y1=sc_raycast(LvlObj,x#,y#,z#,x#,y#-50,z#,0)
y1#=sc_getcollisiondistance(0)
if y1#>0.0 and y1#<(Height#/2)
y#=y#+((Height#/2)-y1#)
OnFloor=1
Hit=1
endif
y2=sc_raycast(LvlObj,x#,y#,z#,x#,y#+50,z#,0)
y2#=sc_getcollisiondistance(0)
if y2#>0.0 and y2#<(Height#/2)
if OnFloor=0
y#=y#-((Height#/2)-y2#)
OnFloor=2
Hit=1
else
OnFloor=3
Hit=1
endif
endif
for ay=0 to 315 step 45
i=sc_raycast(LvlObj,x#,y#-(Height#/4.0),z#,newxvalue(x#,ay,50),y#-(Height#/4.0),newzvalue(z#,ay,50),0)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MinDiameter#/2)
x#=newxvalue(x#,ay,i#-(MinDiameter#/2))
z#=newzvalue(z#,ay,i#-(MinDiameter#/2))
Hit=1
endif
next ay
for ay=0 to 315 step 45
i=sc_raycast(LvlObj,x#,y#+(Height#/2.0),z#,newxvalue(x#,ay,50),y#+(Height#/2.0),newzvalue(z#,ay,50),0)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MinDiameter#/2)
x#=newxvalue(x#,ay,i#-(MinDiameter#/2))
z#=newzvalue(z#,ay,i#-(MinDiameter#/2))
Hit=1
endif
next ay
for ay=0 to 315 step 45
i=sc_raycast(LvlObj,x#,y#,z#,newxvalue(x#,ay,50),y#,newzvalue(z#,ay,50),0)
i#=sc_getcollisiondistance(0)
if i#>0.0 and i#<(MaxDiameter#/2)
x#=newxvalue(x#,ay,i#-(MaxDiameter#/2))
z#=newzvalue(z#,ay,i#-(MaxDiameter#/2))
Hit=1
endif
next ay
rem Update object
position object ColObj,x#,y#,z#
rem Set return value
if ReturnFlag=0
ReturnValue=OnFloor
else
if ReturnFlag=1
ReturnValue=Hit
else
ReturnValue=(Hit*4)+OnFloor
endif
endif
rem End the function
endfunction ReturnValue
rem ==========================================================================================
rem === ControlPlayer() ===
rem ==========================================================================================
function ControlPlayer()
rem Adjust angle
Player.Angle.X=Player.Angle.X+Mouse.Speed.Y
if Player.Angle.X<-75
Player.Angle.X=-75
endif
if Player.Angle.X>75
Player.Angle.X=75
endif
Player.Angle.Y=Player.Angle.Y+Mouse.Speed.X
rem Control with W,A,S+D
Move=0
if Key.W=1
if Key.S=0
if Key.A=0
if Key.D=0
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y)*3.0)
Move=1
else
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y+45)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y+45)*3.0)
Move=1
endif
else
if Key.D=0
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y-45)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y-45)*3.0)
Move=1
endif
endif
endif
else
if Key.S=1
if Key.A=0
if Key.D=0
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y+180)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y+180)*3.0)
Move=1
else
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y+135)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y+135)*3.0)
Move=1
endif
else
if Key.D=0
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y-135)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y-135)*3.0)
Move=1
endif
endif
else
if Key.A=1
if Key.D=0
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y-90)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y-90)*3.0)
Move=1
endif
else
if Key.D=1
Player.Position.X=Player.Position.X+(sin(Player.Angle.Y+90)*3.0)
Player.Position.Z=Player.Position.Z+(cos(Player.Angle.Y+90)*3.0)
Move=1
endif
endif
endif
endif
rem Control gravity
Player.Gravity=Player.Gravity+0.05
if Player.Gravity>5.0
Player.Gravity=5.0
endif
Player.Position.Y=Player.Position.Y-Player.Gravity
rem Update player object
position object PLAYER_OBJECT,Player.Position.X,Player.Position.Y,Player.Position.Z
rotate object PLAYER_OBJECT,0.0,Player.Angle.Y,0.0
rem Collision with level
v=RunGroupCollision(PLAYER_OBJECT,SC_LEVEL_GROUP,0,Player.Collision.MaxDiameter,Player.Collision.MinDiameter,Player.Collision.Height,2)
if v>3
Player.Collision.Hit=1
Player.Collision.OnFloor=v-4
else
Player.Collision.Hit=0
Player.Collision.OnFloor=v
endif
rem Update gravity
if Player.Collision.OnFloor=1
Player.Gravity=1.0
endif
rem Control boobing sword
if Player.Collision.OnFloor=1
if Move=1
Player.Sword.Bob=wrapvalue(Player.Sword.Bob+6)
else
Player.Sword.Bob=curveangle(0,Player.Sword.Bob,10)
endif
else
Player.Sword.Bob=curveangle(0,Player.Sword.Bob,10)
endif
rem Update player co-ordinates
Player.Position.X=object position x(PLAYER_OBJECT)
Player.Position.Y=object position y(PLAYER_OBJECT)
Player.Position.Z=object position z(PLAYER_OBJECT)
rem End the function
endfunction
rem ==========================================================================================
rem === UpdateCamera() ===
rem ==========================================================================================
function UpdateCamera()
rem Update the camera to it's variables co-ordinates
position camera Player.Position.X,Player.Position.Y+20,Player.Position.Z
rotate camera Player.Angle.X,Player.Angle.Y,Player.Angle.Z
rem End the function
endfunction
rem ==========================================================================================
rem === Distance2D() ===
rem ==========================================================================================
function Distance2D(x1#,y1#,x2#,y2#)
rem Calculate distance
Distance#=sqrt(((x2#-x1#)^2)+((y2#-y1#)^2))
rem End the function
endfunction Distance#
rem ==========================================================================================
rem === FindFreeObject() ===
rem ==========================================================================================
function FindFreeObject()
rem Loop through buttons till a space is found
id=-1
i=1
done=0
repeat
if object exist(i)=0
id=i
done=1
endif
i=i+1
if i=65535
done=1
endif
until done=1
rem End the function
endfunction id
rem ==========================================================================================
rem === FindFreeImage() ===
rem ==========================================================================================
function FindFreeImage()
rem Loop through buttons till a space is found
id=-1
i=1
done=0
repeat
if image exist(i)=0
id=i
done=1
endif
i=i+1
if i=200
done=1
endif
until done=1
rem End the function
endfunction id
rem ==========================================================================================
rem === DeleteAllObjects() ===
rem ==========================================================================================
function DeleteAllObjects()
rem Loop through and delete all existing objects
for o=1 to 65535
if object exist(o)=1
delete object o
endif
next o
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllImages() ===
rem ==========================================================================================
function DeleteAllImages()
rem Loop through and delete all existing images
for i=1 to 200
if image exist(i)=1
delete image i
endif
next i
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllSprites() ===
rem ==========================================================================================
function DeleteAllSprites()
rem Loop through and delete all existing sprites
for s=1 to 100
if sprite exist(s)=1
delete sprite s
endif
next s
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllAnimations() ===
rem ==========================================================================================
function DeleteAllAnimations()
rem Loop through and delete all existing animations
for a=1 to 32
if animation exist(a)=1
delete animation a
endif
next a
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllEffects() ===
rem ==========================================================================================
function DeleteAllEffects()
rem Loop through and delete all existing Effects
for e=1 to 100
if effect exist(e)=1
delete effect e
endif
next e
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllSounds() ===
rem ==========================================================================================
function DeleteAllSounds()
rem Loop through and delete all existing sounds
for s=1 to 100
if sound exist(s)=1
delete sound s
endif
next s
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllMusic() ===
rem ==========================================================================================
function DeleteAllMusic()
rem Loop through and delete all existing music
for m=1 to 100
if music exist(m)=1
delete music m
endif
next m
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllLights() ===
rem ==========================================================================================
function DeleteAllLights()
rem Loop through and delete all existing lights
for l=1 to 7
if light exist(l)=1
delete light l
endif
next l
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllCameras() ===
rem ==========================================================================================
function DeleteAllCameras()
rem Loop through and delete all existing cameras
for c=1 to 10
if camera exist(c)=1
delete camera c
endif
next c
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAllBitmaps() ===
rem ==========================================================================================
function DeleteAllBitmaps()
rem Loop through and delete all existing bitmaps
for b=1 to 32
if bitmap exist(b)=1
delete bitmap b
endif
next b
rem End the function
endfunction
rem ==========================================================================================
rem === DeleteAll() ===
rem ==========================================================================================
function DeleteAll()
rem Run all deletion functions
DeleteAllObjects()
DeleteAllImages()
DeleteAllSprites()
DeleteAllAnimations()
DeleteAllEffects()
DeleteAllSounds()
DeleteAllMusic()
DeleteAllLights()
DeleteAllCameras()
DeleteAllBitmaps()
rem End the function
endfunction
rem ==========================================================================================
rem === LockFrameRate() ===
rem ==========================================================================================
function LockFrameRate(FPS)
rem Lock the frame rate to specified values
sync on
sync rate FPS
rem End the function
endfunction
rem ==========================================================================================
rem === HideLoading() ===
rem ==========================================================================================
function HideLoading()
rem Clear screen
LockFrameRate(0)
sync
rem Displaying loading screen
text screen width()-text width("LOADING"),screen height()-text height("LOADING"),"LOADING"
sync
rem End the function
endfunction
rem ==========================================================================================
rem === MemblockCommand() ===
rem ==========================================================================================
function MemblockCommand()
rem Never used memblock command to initialise sparky's collision dll
delete memblock 255
rem End the function
endfunction
Hold right click to block, hold left to attack. W,A,S+D movement. I'll try again now but using animations.