Hi there
Software: DarkBasic Pro
Version: 5.2 Upgrade
Please could someone check the following code; i am writing a small demo which is a 3rd person perpective (ala Resident evil style) and was wondering about the controls for the player
Below is my code for the player movement, this is fine, but i want to know what the position is for the player when you press UP arrow.
Could someone please check the code and put in suggestion on how to achieve this
Declared variables for player
global player_x_pos = 175
global player_y_pos = 0
global player_z_pos = -200
global player_x_angle=0
global player_y_angle=0
global player_z_angle=0
Loading character .x file code
load object "playerH-SWAT-Idle.x",3
`Swat movement animation is 25
append object "playerH-SWAT-Move.x",3,25
print "Scaling model for swat and setting postion"
scale object 3,1000*15,1000*15,1000*15
position object 3,player_x_pos,player_y_pos,player_z_pos
Controlling player code in the main loop
do
player_x_angle = Object angle X(3)
player_y_angle = Object angle Y(3)
player_z_angle = Object angle Z(3)
if upkey()=1 then loop object 3,26,50 : move object 3,-5
if upkey()=0 then SET OBJECT FRAME 3, 0
` if downkey()=1 then loop object 3,26,50 : move object 3,5
` if downkey()=0 then SET OBJECT FRAME 3, 0
If Leftkey()=1 then rotate object 3,0,wrapvalue(player_y_angle)-5,0
if Rightkey()=1 then rotate object 3,0,wrapvalue(player_y_angle)+5,0
if keystate(DIK_T)= 1 then debug_info()
RunCollisionPRO()
sync
loop
Many thanks
Kind Regards
Nadeem
A Good Programmer never blames his tools