hello.....
i just cant seem to produce a fast bullet out of my character(box)...
plz help!!!!!!
here is my code
Rem Project: prac1
Rem Created: 1/23/2012 7:56:57 PM
Rem ***** Main Source File *****
sync on
set window off
hide mouse
autocam off
`set some starting variables
facing# = 0 :`direction camera is looking left and right
pitch# = 0 :`direction camera is looking up and down
camera_distance# = 50 :`how far camera is away from player
camera_height# = 10 :`distance above player camera is pointing at
movement_speed# = 0.5 :`how fast the player moves
turn_multiplier# = 0.1 :`a factor that controls how fast the player turns left and right
pitch_multiplier# = 0.1 :`a factor that controls how fast the player looks up and down
jump_speed# = 0.5 :`initial jump speed
gravity# = 0.003 :`gravity
`make something for the ground and a cube to represent the player
make matrix 1, 1000,1000,10,10
make object cube 1, 10
position object 1, 500,5,500
`main loops
do
`arrow keys to move the player
if upkey() = 1 then move object 1, movement_speed#
if downkey() = 1 then move object 1, movement_speed#*-1
if leftkey() = 1 then move object left 1, movement_speed#
if rightkey() = 1 then move object right 1, movement_speed#
`jump controls
if jump = 0
if controlkey() = 1
`set the velocity in the y direction to the initial jump speed
y_vel# = jump_speed#
jump = 1
endif
endif
`calculate vertical velocity and move object in the y axis
y_vel# = y_vel# - gravity#
move object up 1, y_vel#
`check to see if the object has hit the ground
if object position y(1) < 5
`stop the object from falling
position object 1, object position x(1), 5, object position z(1)
`set velocity in the y direction to zero
y_vel# = 0
jump = 0
endif
`mouse to look left, right and up, down
move_mouse_x# = mousemovex() :`write mouse move to variable
move_mouse_y# = mousemovey() :`write mouse move to variable
`calculate the direction the player and camera is facing
facing# = wrapvalue(facing# + move_mouse_x#*turn_multiplier#) :`left and right
pitch# = wrapvalue(pitch# + move_mouse_y#*pitch_multiplier#) :`up and down
`restrict up and down movement camera pitch
campitchtest# = wrapvalue(pitch#+180)
if campitchtest# < 90 then pitch# = 270
if campitchtest# > 270 then pitch# = 90
`rotate the cube (player) to the new facing left and right
yrotate object 1, facing#
`this is the first method for camera control
set camera to follow object position x(1), object position y(1), object position z(1), facing#, camera_distance#, camera_height#, 10,0
`this line lets the player look up down
xrotate camera pitch#
set cursor 0,0
print "use arrow keys to move, mouse to look and control to jump"
print
center text screen width()/2,screen height()/2,"+"
sync
loop
A.P