Okay thanks guys i ill check out that spookys thing, and also IanM, for right now it was only the players speed that was sort of screwin up things.
[edit] okay i'm lookin at spooky's method...well...i dont exactly get what hes trying to do. If i just attached my code, could someone explain to me where i needed to add it? Sorry, its kinda long (300 lines). Thanks
Rem Project: RPG
Rem Created: 26/06/2004 15:48:37
Rem ***** Main Source File *****
autocam off
hide mouse
randomize 4
rem set variables for player location to the coordinates
player_x#=0
player_y#=0
player_z#=0
rem set the speed variables
rem the speed of the player can be changed by increasing or decreasing this value
player_z_speed#=0.03
player_x_speed#=0.03
player_y_speed#=0.03
rem define money variable
money=0
rem define flyingability
flyingability=0
`the default value for flying ability is 0, meaning that by default the player
`cannot fly
rem set initial camera coordinates
camera_x#=0
camera_y#=17.5
camera_z#=-10
rem set camera speed variables
rem this MUST be the same as the player speeds
camera_x_speed#=0.03
camera_y_speed#=0.03
camera_z_speed#=0.03
rem the camerachange1 is the variable for the initial/default camera view
camerachange=1
rem create floor
make matrix 6,5,5,1,1
rem create player and house
make object sphere 1,5
make object box 2,8,6,6
rem crete thing that gives ya flying ability
make object sphere 5,2
scale object 5,50,50,50
rem create money
make object sphere 3,2
make object sphere 4,2
rem position objects
position object 1,player_x#,player_y#,player_z#
position object 2,10,2,10
position object 3,0,0,5
position object 4,-13,0,6
position object 5, -2,0,9
`colour house and money
color object 2,rgb(255,0,0)
color object 3,rgb (0,255,0)
color object 4,rgb (0,0,255)
color object 5,rgb (255,0,255)
`Flying timer
fly=0
```MAIN LOOP```
do
rem if the "1" key is pressed, the camerachangevalue is changed to 1, the default view
if scancode()=2
camerachange=1
endif
rem if the "2" key is pressed, the camerachangevalue is changed to 2, the close-up view
if scancode()=3
camerachange=2
endif
rem if camerachange is 1, then the camera is positioned
rem effectively, 17.5 units higher than the player and 10 units behind
if camerachange=1
`position camera
position camera camera_x#,camera_y#,camera_z#
rem the camera is rotated so it "points" at the player
rotate camera 40,0,0
endif
rem if camerachange is 2, then the camera is positioned
rem 5 units behind the player and 10 units behind
if camerachange=2
position camera player_x#,player_y#+5,player_z#-10
rem the camera is not rotated because it is pretty much directly behind the player
rotate camera 0,0,0
endif
`move player
if upkey()=1
player_z#=player_z#+player_z_speed#
camera_z#=camera_z#+camera_z_speed#
endif
if downkey()=1
player_z#=player_z#-player_z_speed#
camera_z#=camera_z#-camera_z_speed#
endif
if leftkey()=1
player_x#=player_x#-player_x_speed#
camera_x#=camera_x#-camera_x_speed#
endif
if rightkey()=1
player_x#=player_x#+player_x_speed#
camera_x#=camera_x#+camera_x_speed#
endif
rem moving upwards
if spacekey()=1
if flyingability=1
player_y#=player_y#+player_y_speed#
camera_y#=camera_y#+camera_y_speed#
endif
endif
if controlkey()=1
if flyingability=1
`so it will ONLY move down if
`the players Y value is greater than 0
`basically, if he is ABOVE ground
if object position y(1)>0
player_y#=player_y#-player_y_speed#
camera_y#=camera_y#-camera_y_speed#
endif
endif
endif
`reposition the player-object-thingy
position object 1,player_x#,player_y#,player_z#
`set object collision to boxes for the house
Set object collision to boxes 2
`set object collision to spheres for the character
Set object collision to spheres 1
rem COLLISION WITH HOUSE
````````````````````
`````````````````````
`````from front of the box
If Object collision(1,2)>0 and upkey()=1
player_z_speed#=0
camera_z_speed#=0
endif
if downkey()=1 and Object collision(1,2)>0
position object 1,player_x#,player_y#, player_z#-0.1
endif
if object collision(1,2)=0 and player_z_speed=0
player_z_speed#=0.03
camera_z_speed#=0.03
endif
````````````
````````from the left of the box
If Object collision(1,2)>0 and rightkey()=1
player_x_speed#=0
camera_x_speed#=0
endif
if leftkey()=1 and Object collision(1,2)>0
position object 1,player_x#-0.1,player_y#, player_z#
endif
if object collision(1,2)=0 and player_x_speed=0
player_x_speed#=0.03
camera_x_speed#=0.03
endif
```````````````
````````from the right of the box
If Object collision(1,2)>0 and leftkey()=1
player_x_speed#=0
camera_x_speed#=0
endif
if rightkey()=1 and Object collision(1,2)>0
position object 1,player_x#+0.1,player_y#, player_z#
endif
if object collision(1,2)=0 and player_x_speed=0
player_x_speed#=0.03
camera_x_speed#=0.03
endif
```````````````
````````from the back of the box
If Object collision(1,2)>0 and downkey()=1
player_z_speed#=0
camera_z_speed#=0
endif
if upkey()=1 and Object collision(1,2)>0
position object 1,player_x#,player_y#, player_z#+0.1
endif
if object collision(1,2)=0 and player_z_speed=0
player_z_speed#=0.03
camera_z_speed#=0.03
endif
```````````````
````````from the top of the box
If Object collision(1,2)>0 and controlkey()=1
player_y_speed#=0
camera_y_speed#=0
endif
if spacekey()=1 and Object collision(1,2)>0
position object 1,player_x#,player_y#+0.1, player_z#
endif
if object collision(1,2)=0 and player_y_speed=0
player_y_speed#=0.03
camera_y_speed#=0.03
endif
```````````````
````````````
rem COLLSION CHECKING FOR HOUSE DONE ... yay
`` BLANK
`this is simply to write the Door is Locked Message
if object collision (1,2)
if Object collision(1,2)>0
text 10,50,"The Door is Locked"
endif
endif
if object exist (5)
if object collision (1,5)
flyingability=1
delete object 5
`timer()=starttime
endif
endif
`pick-up money
if object exist (3)
if object collision (1,3)
money=money+50
delete object 3
endif
endif
if object exist (4)
if object collision (1,4)
money=money+100
delete object 4
endif
endif
`print info
`text 10,10,"player_x#"+str$(player_x#)
text 0,10,"cash "+str$(money)
if flyingability=1
text 0,430, "You can now fly!"
fly=fly+1
endif
if player_y#=0
fly=0
endif
if fly= 5481
flyingability=0
player_y#=player_y#-player_y_speed#
camera_y#=camera_y#-camera_y_speed#
endif
loop
if you run this on like say a 3 GHZ the player will go reallly fast but if you run on like a 1.8 or so it wont go as fast, thats what im trying to change...th