this must be simple...?
Blitz3D Forums/Blitz3D Beginners Area/this must be simple...?
| ||
This must be simple, but I just can’t figure it out. I have a fps style environment which the user can use the arrow keys to swing the main camera around to look at the ‘world’. I would like to use the same arrow keys to control the rotation of a mesh object, using the space bar to toggle between both control methods. I have tried a few approaches without success. This latest effort doesn’t work at all…any suggestions? on=0 ;main loop******************************************************************************************** While Not KeyHit(1) If on=1 lights_movement c_arm_movement unlock_table position_cameras check_flag Else lights_movement camera_pick camera_movement position_cameras check_flag End If UpdateWorld RenderWorld Rect x,y-3,1,7 Rect x-3,y,7,1 Flip Wend ;***************************************************************************************************** Function check_flag() If KeyDown(57) on=1-on EndIf End Function the other functions work perfectly, but introducing another loop layer seems to muck things up completely. any suggestions...please thanks,Shawnus |
| ||
ok i can't help but try placing your cod in {code} {/code} change {} to [] so {code} hi {/code} becomes hi |
| ||
First line:Global on=0You need to make 'on' global to access it from a function, otherwise it's another 'on' being used in the function :) Fredborg |
| ||
Thanks for the replies. Actually, in my original code 'on' was global- I just published a condensed version to show people the basic structure. I Still haven't figured it out... Shawnus |
| ||
i would use on = 1 and then do on = on*-1 but thats just a prefrence, it may actually be working... try doing what your doing but putting a FlushInput(or something) and then a delay(100) and see if it works |
| ||
Change:KeyDown(57) --> KeyHit(57) Maybe? Fredborg |