i have now manged to make the character attack when you press spacebar but to be honest its not really a game yet so i am going to try to and stop the character going outside of the matrix. I thought i could do this by putting boxs around the matrix, hiding them then using some sliding collision or something. Is there a better way of doing this that will save time
.
I'm then going to get or make a model of a dragon and then get it to try and kill the man and you(the man) have to kill the dragon.
IF anyone has any animated models of dragons they would be very handy.
Oh, Here is my Code(DBC)
rem set sync rate to 40 and hide the mouse
SYNC RATE 40:HIDE MOUSE
rem make matrix
make matrix 1,500,500,10,10
randomize matrix 1,25
LOAD BITMAP "grassy01.bmp",1
GET IMAGE 1,0,0,128,128
DELETE BITMAP 1
PREPARE MATRIX TEXTURE 1,1,1,1
FOG ON:FOG DISTANCE 300
rem Load 3D object and append walking data to it
LOAD OBJECT "H-Knight-Idle.x",1
SCALE OBJECT 1,750,750,750
APPEND OBJECT "H-Knight-Move.x",1,100
APPEND OBJECT "H-Knight-Attack1.x",1,200
APPEND OBJECT "H-Knight-Die.x",1,300
APPEND OBJECT "H-Knight-Impact.x",1,400
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1
rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,10
rem load sword
LOAD OBJECT "sword5.x",2
scale object 2,1500,1500,1500
zrotate object 2,110
yrotate object 2,90
rotate limb 1,13,0,0,180
glue object to limb 2,1,13
fix object pivot 1
rem load shield
LOAD OBJECT "woodshld.x",3
SCALE OBJECT 3,200,200,200
yrotate object 3,300
zrotate object 3,90
glue object to limb 3,1,18
fix object pivot 1
rem load music and play it.
load music "dungeon.mid",1
loop music 1
rem Activate manual syncronization
SYNC ON
rem Begin loop
DO
rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-8.0
IF RIGHTKEY()=1 THEN a#=a#+8.0
a#=wrapvalue(a#)
rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,1.5) : z#=NEWZVALUE(z#,a#,1.5) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-1.5) : z#=NEWZVALUE(z#,a#,-1.5) : stage=1
IF SPACEKEY()=1 and stage=0 then PLAY OBJECT 1,200,250
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,20
ENDIF
oldstage=stage
ENDIF
rem Update character position and angle
POSITION OBJECT 1,x#,get ground height(1,x#,z#)+5,z#
YROTATE OBJECT 1,a#
rem Position camera off center
POSITION CAMERA x#,y#+50,z#-75
rem Refresh screen
SYNC
rem End loop
LOOP