Posted: 25th Jun 2007 4:35
+ Code Snippet
Rem ******************************************
Rem Keyboard Movement Based On Camera Angle **
Select Camera_A# `check for camera angle
   Case 0 `camera at 0 degrees
      If Keystate(17)=1 Then Inc Cursor_Z#,1 `move cursor in the z direction(+)
      If Keystate(31)=1 Then Inc Cursor_Z#,-1 `move cursor in the z direction(-)
      If Keystate(30)=1 Then Inc Cursor_X#,-1 `move cursor in the x direction(-)
      If Keystate(32)=1 Then Inc Cursor_X#,1 `move cursor in the x direction(+)
   EndCase
   Case 90 `camera at 90 degrees
      If Keystate(17)=1 Then Inc Cursor_X#,1 `move cursor in the x direction(+)
      If Keystate(31)=1 Then Inc Cursor_X#,-1 `move cursor in the x direction(-)
      If Keystate(32)=1 Then Inc Cursor_Z#,1 `move cursor in the z direction(+)
      If Keystate(30)=1 Then Inc Cursor_Z#,-1 `move cursor in the z direction(-)
   EndCase
   Case 180 `camera at 180 degrees
      If Keystate(17)=1 Then Inc Cursor_Z#,-1 `move cursor in the z direction(-)
      If Keystate(31)=1 Then Inc Cursor_Z#,1 `move cursor in the z direction(+)
      If Keystate(30)=1 Then Inc Cursor_X#,-1 `move cursor in the x direction(-)
      If Keystate(32)=1 Then Inc Cursor_X#,1 `move cursor in the x direction(+)
   EndCase
   Case 270 `camera at 270 degrees
      If Keystate(17)=1 Then Inc Cursor_X#,-1 `move cursor in the x direction(-)
      If Keystate(31)=1 Then Inc Cursor_X#,1 `move cursor in the x direction(+)
      If Keystate(32)=1 Then Inc Cursor_Z#,1 `move cursor in the z direction(+)
      If Keystate(30)=1 Then Inc Cursor_Z#,-1 `move cursor in the z direction(-)
   Endcase
EndSelect



thats my little case check for moving a cursor...the thing is only the first case works, all the others don't work when Camera_A# is equal to the case check. The Camera_A# does update to the right number, I've check, it's just the code under the case wont run. Thanks for any help.
Posted: 25th Jun 2007 4:43
You're comparing integers to a float, add .0 to the end of those numbers and it should work fine.
Posted: 25th Jun 2007 4:45
Benjamin, you're one fast cat. Although I was going to suggest the opposite: Make Camera_A an integer.
Posted: 25th Jun 2007 17:46
ah, thats so weird. I thought adding a "#" to the end automatically created an Integer? Just like "$" creates a string. So I'm guessing variables are declared when the first value is added? Weird...but I guess I should have known that.

BWM