Please! Help Me!

Blitz3D Forums/Blitz3D Beginners Area/Please! Help Me!

I am making a 3d game where the player moves like pacman,
accept with the addition of diagonal movement.
The controls are w,s,a,d,wa,wd,ds,as. All four single buttons work fine and wa and wd works as well.
The problem is that the ds,and as, combos move it at twice the speed as it should and moves it in the wrong direction.
I have tried everything I could think of and am verry fustrated but realy would like to finish a game!
can someone please help me?
I have assembled part of the program with the problem function.

 Graphics3D 640,480 
;Graphics3D 800,600 

SeedRnd MilliSecs()
plane = CreatePlane()

cl=1
Global light=CreateLight(1)
LightConeAngles light,1,30
LightRange light,125 
Global cam=CreateCamera()
Global sphere=CreateSphere()
ScaleEntity sphere,3,3,3 

Global camangle 
camangle=0 

Global rsx#= .50 ;right movment value 
Global lsx#=-.50 ;left movment value 

Global fsz#=-.50 ;forward movement value 
Global bsz#= .50 ;back movement value
Global ROBOX = CreateCube ()

EntityShininess ROBOX,1 


;ROBOX = LoadMesh("data\boxmsh.b3d")
PositionEntity ROBOX,EntityX(sphere),EntityY(plane),EntityZ(sphere)
ScaleEntity ROBOX,.1,.1,.1 
Global dirbox = CreateCube ()
EntityAlpha dirbox,.5
Global pointer = CreateCube ()
EntityAlpha pointer,.5
;PositionEntity dirbox,EntityX(sphere),EntityY(sphere)+5,EntityZ(sphere)+5
;EntityBox ROBOX,-.05,-.05,-.05,.1,.1,.1
EntityRadius ROBOX,5 

EntityType ROBOX,4 


PositionEntity cam,EntityX(sphere)-20,EntityY(plane)+40,EntityZ(sphere)-20


While Not KeyHit(1)



PointEntity cam,sphere
test_input(rsx#,lsx#,fsz#,bsz#)


RenderWorld


UpdateWorld
Flip 
Wend
ClearWorld()
 
End






Function test_input(rsx#,lsx#,fsz#,bsz#) 


;check for movement by user
;needs a point entity comand for the robox turn methodiology mophisizm
 

;32=right,17=forward,31=back,30=left
;1 invisable boxes north south for control of robot


;to be testinput function



If KeyDown(17)=False  And KeyDown(30)= True  Then ;left a
 PositionEntity dirbox,EntityX(sphere)+45,leval#,EntityZ(sphere)  
 TranslateEntity sphere,lsx#*2,0,0:PointEntity ROBOX,dirbox
 PositionEntity pointer,EntityX(sphere)-45,leval#,EntityZ(sphere)
 PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
 PointEntity light,pointer
End If   
 

If KeyDown(17) = False And KeyDown(32) = True Then ;right
  PositionEntity dirbox,EntityX(sphere)-45,leval#,EntityZ(sphere)
  TranslateEntity sphere,rsx#*2,0,0:PointEntity ROBOX,dirbox
  PositionEntity pointer,EntityX(sphere)+45,leval#,EntityZ(sphere)
  PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
  PointEntity light,pointer
End If
 
;rsx#= .50 ;right movment value 
;lsx#=-.50 ;left movment value
;fsz#=-.50 ;forward movement value 
;bsz#= .50 ;back movement value
 
;usy#=-.50 ;up movement value 
;dsy#= .50 ;down movement value

   ;If KeyDown(17) = True Then ;forward w
If KeyDown(17)=True And KeyDown(30) = True Then ;leftforward q
  PositionEntity dirbox,EntityX(sphere)+45,leval#,EntityZ(sphere)-45
  TranslateEntity sphere,lsx#,0,bsz#:PointEntity ROBOX,dirbox 
  PositionEntity pointer,EntityX(sphere)-45,leval#,EntityZ(sphere)+45
  PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
  PointEntity light,pointer
 
Else If KeyDown(17) = True And KeyDown(32) = True
  PositionEntity dirbox,EntityX(sphere)-45,leval#,EntityZ(sphere)-45
  TranslateEntity sphere,rsx#,0,bsz#:PointEntity ROBOX,dirbox 
  PositionEntity pointer,EntityX(sphere)+45,leval#,EntityZ(sphere)+45
  PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
  PointEntity light,pointer

Else If KeyDown(17)=True 					;entityY(plane)
 PositionEntity dirbox,EntityX(sphere),leval#,EntityZ(sphere)-45
 TranslateEntity sphere,0,0 ,bsz#*2:PointEntity ROBOX,dirbox
 PositionEntity pointer,EntityX(sphere),leval#,EntityZ(sphere)+45
 PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
 PointEntity light,pointer
End If 
;rsx#= .50 ;right movment value 
;lsx#=-.50 ;left movment value
;fsz#=-.50 ;forward movement value 
;bsz#= .50 ;back movement value
 
;rsx#= .50 ;right movment value 
;lsx#=-.50 ;left movment value
;fsz#=-.50 ;forward movement value 
;bsz#= .50 ;back movement value
 
;usy#=-.50 ;up movement value 
;dsy#= .50 ;down movement value
If KeyDown(31) = True And KeyDown(30)=True Then ;left aw
 PositionEntity dirbox,EntityX(sphere)+45,leval#,EntityZ(sphere)+45  
 TranslateEntity sphere,lsx#,0,fsz#:PointEntity ROBOX,dirbox
 PositionEntity pointer,EntityX(sphere)-45,leval#,EntityZ(sphere)-45
 PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
 PointEntity light,pointer

Else If KeyDown(31) = True And KeyDown(32)=True Then ;right dw
 PositionEntity dirbox,EntityX(sphere)-45,leval#,EntityZ(sphere)+45  
 TranslateEntity sphere,rsx#,0,fsz#:PointEntity ROBOX,dirbox
 PositionEntity pointer,EntityX(sphere)+45,leval#,EntityZ(sphere)-45
 PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
 PointEntity light,pointer
 
 
Else If KeyDown(31) = True Then  ;back s
 PositionEntity dirbox,EntityX(sphere),leval#,EntityZ(sphere)+45   
 TranslateEntity sphere,0,0,fsz#*2:PointEntity ROBOX,dirbox 
 PositionEntity pointer,EntityX(sphere),leval#,EntityZ(sphere)-45
 PositionEntity light,EntityX(sphere),leval#,EntityZ(sphere)
 PointEntity light,pointer
End If




End Function





 


I have no idea what the hell you're doing there that code is seriously ugly so I'm not going to work through it..

Why aren't you just going something like

Graphics3D 640,480
camera=CreateCamera()
PositionEntity camera,0,0,-50

player = CreateSphere(6)

middle = CreatePivot()
vector = CreatePivot()

; keyboard control (cursor keys)
upkey = 200
downkey = 208
leftkey = 203
rightkey = 205

Repeat
	PositionEntity vector,0,0,0
	
	; shift vector around based on keyboard input
	If KeyDown(upkey) Then TranslateEntity vector,0,1,0
	If KeyDown(downkey) Then TranslateEntity vector,0,-1,0
	If KeyDown(leftkey) Then TranslateEntity vector,-1,0,0
	If KeyDown(rightkey) Then TranslateEntity vector,1,0,0
	
	If EntityDistance(vector,middle)>1
		; keep the speed constant
		PointEntity vector,middle
		MoveEntity vector,0,0,EntityDistance(vector,middle)-1
	EndIf
	
	TranslateEntity player,EntityX(vector),EntityY(vector),EntityZ(vector)
	
	RenderWorld
	
	Flip

Until KeyHit(1)


I strongly suggest you to separate the movement logic by the key press logic.

In other terms, I would do something like this:

.
.
key_status = key_logic()
move_logic(key_status)

;==========================
function key_logic()
;==========================
;check combination of keys and return an unique value
;
if keydown(whatever_A) and keydown(whatever_B) then
return 1
endif
;
if keydown(whatever_C) and keydown(whatever_D) then
return 2
endif
;
if keydown(whatever_E) and keydown(whatever_F) then
return 3
endif
;
;other keys here
;
;==========================
function move_logic(move)
;==========================
;move the player accordingly whith the param passed
select move
case 1
case 2
case 3
;
;other cases here
;
end select

In this way, you should not have any problem regarding double speed and the likes.

More, you seem to move a bunch of entities all together - do you know EntityParent command ? It can help a lot !
:)

Hope this has sense for you,
Sergio.

[EDITED]
Rob, how come you're some millisecs faster than me !!! Do you have some sort of 'still-no-reply-topic search engine' ?
:)

"I have no idea what the hell you're doing there that code is seriously ugly so I'm not going to work through it.."
Sorry about the sloppy code, the result of changing it 20 or
thirty times.
What it does (not to well) is...
The sphere is the key entity, for colitions and placement
of the dirbox located behind the sphere, and for the pointer box located in front. Then the most important piece
is the robox I made in milkshape.It kinda looks like r2.
The cam stays locked on the sphere. The sphere does not rotate becouse then if I parent the camera to it the cam will turn with it and that is not desired, as the cam should be locked at an angle like Diablo and always face
the same direction (NorthEast). Another reason not to parent the sphere is that when on the roof or outside of
the structure the sphere stays inside the structure this serves to contain the robox from leaving the edge and floating out into space. Now the dirbox "direction box"
controls the turning by relocating it to the right or left front or back, ect... The ROBOX then points its back to the dirbox. And last but not least is the pointer box whitch is there for the light and head to point at. The idea is to have the pointer box attached to the mouse so the head and light rotate 360 for lazer fire.
Anyhow thats the idea of it all.
So all that being the case,Please corrct me if I'm thinking all wrong.
I should parent the dirbox to the to the robox. parent the pointerbox to the to the light and head and leave the cam and sphere the way they are? And I will seperate the key presses and the movement.

PS If you don,t here from me before Dawn i have fell off the edge.
Thanks for the help.

A word of warning about your key combinations. Some keyboards can't take multple alpha-numberic key presses and I'd change your keys to something like: q, w, e, a, d, z, x, c for directional control.

I was thinking about making a function for options to switch controls to the arrow keys. I guess I could write
one for for that to be a option. How bad is that? I mean
if a keyboard that can,t handle it, what does it do?
I did not know that thank you.

Anyhow I have it working now. I just did what semar said and it worked perfect. I have spent the day making a ship leval for it. I still nead to change the if statments.
I'm gonna wait until I get the head rotation working cause that'll be part of it.

"A word of warning about your key combinations. Some keyboards can't take multple alpha-numberic key presses and I'd change your keys to something like: q, w, e, a, d, z, x, c for directional control."

Hey ! Now this is bugging me. Originaly I was only going to have just w,s,a,d individualy but noticed I kept hitting
two keys on accident, so I gave it something to do in that event. Now even if I wen't to the far more confusing " q, w, e, a, d, z,x, c" control whats to keep someone from hitting multiple keys by accident? What keyboards don't support multiple keypresses?

Plenty of keyboards don't support certain key combinations, not just a few specific models. Best to offer the option to redefine them, although it's hardly necessary at this stage!

Ok I have made some of the recomended changes and here is the real code for the game and I would like some constructive coments. It all works alot better with the real leval but this demonstrates the camera and colitions.
It also has Marks tweening code.



Graphics3D 640,480 
;Graphics3D 800,600 
AutoMidHandle True
SeedRnd MilliSecs() 
cl=1

Global light=CreateLight(1)
LightConeAngles light,1,130
LightRange light,1600 

Global cam=CreateCamera()
CameraFogMode cam,True 
CameraFogRange cam,.005,1000
CameraFogColor cam,20,10,75
CameraClsColor cam,20,10,75 
CameraRange cam,1,250  

grid_tex=CreateTexture( 32,32,8 ) 
ScaleTexture grid_tex,10,10 
SetBuffer TextureBuffer( grid_tex ) 
Color 0,0,64:Rect 0,0,32,32 
Color 200,20,255:Rect 0,0,32,32,False 

;load models
;lift_mesh=LoadMesh ("platform.b3d")
;ScaleEntity lift_mesh,1.45,1,1.40

;lift_mesh2 = CreateCylinder(12)
;ScaleEntity lift_mesh2,47,1,55



;cube_tex_1= LoadTexture("Data/rednumbers.bmp")
;load levals
;all levals must be made so that the floor hights are multiples of 5
;ie; in other words ceiling hight = 4 floor hight = 5
;when changing levals robox must have an unhitherd path


plane=CreateCube()
;Global plane=LoadMesh ("spacecraftcarier/shipleval8.b3d")
;Global plane=LoadMesh ("spacecraftcarier/box2.b3d")
;Global plane=LoadMesh ("spacecraftcarier/spacecarrier10.b3d")
Global leval# = EntityY(plane)


ScaleEntity plane,150,50,150
EntityColor plane,110,0,100
;planetex=LoadTexture("spacecraftcarier/sqaurpannelgrid.bmp")
;planetex2=LoadTexture("spacecraftcarier/sqaurpannelgrid.bmp")
;EntityShininess plane,.5 

;ScaleTexture planetex2 ,16,16 
;EntityTexture plane,planetex2
; Enable/disable terrain shading 
;TerrainShading plane,1  
EntityFX plane,16
EntityType plane,3 
;EntityBlend plane,1
;EntityAlpha plane,.45 
;TerrainDetail plane,4000,True 
 



;mirror=CreateMirror()
Type bot
 Field x#
 Field y#
 Field z#
; Field leval  ; variable to multiply * 5  and to show what leval bot referance is on
 Field scale# ;scale of head and base models 
 ;Field head_Dir
 Field speed ;1
 Field model
 Field Dir_Box
 Field box 
 
 Field Dir_Pointer
 Field dirx#
 Field diry#
 Field dirz#
 Field power
End Type


Global Robo.bot=New bot
	Robo\x# = 0
	Robo\y# = 0
	Robo\z# = 0
	Robo\scale# = .1
	Robo\speed# = 1
	;Robo\model = LoadMesh("data\r1_d1.b3d")
	Robo\model = CreateCube ()
		EntityColor Robo\model,100,50,50
		ScaleEntity Robo\model,3,5,3
		;ScaleEntity Robo\model,Robo\scale# ,Robo\scale# ,Robo\scale#
		EntityShininess Robo\model,1
		EntityRadius Robo\model,5
		EntityType Robo\model,4 
 		
	Robo\Dir_Box = CreateCube();parrent to robo?
		EntityAlpha Robo\Dir_Box,0 
		ScaleEntity Robo\Dir_Box,1,1,1
	Robo\dirx# = 0 : Robo\diry# = 0 : Robo\dirz# = 0

  
Global head.bot = New bot
	head\x# = 0
	head\y# = Robo\y# + 5
	head\z# = 0
	head\scale# = .1
	head\speed# = 1
    ;head\model = LoadMesh("data\r1_d1_head.b3d")
	head\model = CreateCube() ;parrent = Robo\model
	head\dirx# = 0 : head\diry# = 0 : head\dirz# = 0
		ScaleMesh head\model,3,3,3

Global target.bot = New bot
	
	target\Dir_Pointer = CreateCube()
		EntityAlpha target\Dir_Pointer,.5
	target\dirx# = 0
	target\diry# = leval#
	target\dirz# = 0

Global coll.bot = New bot
 	coll\box = CreateCube()
		EntityAlpha coll\box,.5 
		ScaleEntity coll\box,3,3,3
		PositionEntity coll\box,0,leval#+4,0
		EntityRadius coll\box,3
		EntityType coll\box,1 

	coll\x# = 0
	coll\y# = leval#
	coll\z# = 0




;RotateEntity plane,0,90,0 
PositionEntity cam,0,40,0 
PointEntity cam,plane 

 
;nbx=5
;nbz=-5





;ScaleTexture cube_tex_1,3.25,2
Dim cubes(6) 
For n=1 To 6 
cubes(n)=CreateCube() 
EntityType cubes(n),2 



 
PositionEntity cubes(n),50+n*2,leval#+7,-50+n*2
EntityColor cubes(n),Rnd(255),Rnd(255),Rnd(255)
;EntityTexture cubes(n),cube_tex_1
ScaleEntity cubes(n),6,6,6 
EntityBox cubes(n),-6,-6,-6,12,12,12 
EntityRadius cubes(n),6 
Next 



Global camangle 
camangle=0 
;Global rsx#= 1 ;right movment value 
;Global lsx#=-1 ;left movment value 
;Global fsz#=-1;forward movement value 
;Global bsz#= 1 ;back movement value
Const rsx#= 2 ;right movment value 
Const lsx#=-2 ;left movment value 
Const fsz#=-2;forward movement value 
Const bsz#= 2 ;back movement value


Const GRAVITY# = -.01;DRV

Const FPS=15
Global period=1000/FPS
Global time=MilliSecs()-period 

 
  
Collisions 1,3,2,3
Collisions 2,3,2,2 

Collisions 1,2,3,2 
Collisions 2,2,3,2 

SetBuffer BackBuffer()
;MAIN*********************************************************************
While Not KeyHit(1)

t=t+1

	Repeat
		elapsed=MilliSecs()-time
	Until elapsed


	ticks=elapsed/period
	tween#=Float(elapsed Mod period)/Float(period)


	
For k=1 To ticks
 time=time+period
 If k=ticks Then
		
		CaptureWorld
; Game updates ***********************************************************	
                     
 	coll\x# = EntityX(coll\box);                                          
 	coll\y# = EntityY(coll\box);                                          
 	coll\z# = EntityZ(coll\box)
 	Robo\x# = EntityX(Robo\model)
 	Robo\y# = EntityY(Robo\model)
 	Robo\z# = EntityZ(Robo\model)  

		
	keys_pressed = testkeys(keys_pressed)

	updatePosition(cam)
	
	If keys_pressed >= 0 Then 
		Gosub test_input
	EndIf 

;update elivator()  every 20 cycles
	If t > 20 Then  
		elivator()
		t=0
	EndIf    
 EndIf
 UpdateWorld
Next 
move_box(ent,x#,y#,z#)

RenderWorld tween#
;elivator()
 


 












UpdateWorld


Color 255,255,0

Text 0,40,"keys_pressed " + keys_pressed
Text 0,60,"X = " +  Robo\x#
Text 0,80,"y = "+  Robo\y#
Text 0,100,"z = "+ Robo\z#

Text 100,60,"robot x "+ coll\x#
Text 100,80,"robot Y "+ coll\y#
Text 100,100,"robot Z "+coll\x#
Text 0,0,"press shift to change veiws. hold down spacebar for first person"
Text 0,10,"use w,s,a,d for general movement and up and down arows to change levals"





 

 
Flip 
Wend
ClearWorld()
 
End
;end of main**************************************************************

Function updatePosition(cam) 
	
If KeyHit(42) Then camangle = camangle+1
 
	If camangle > 2 Then camangle = 0 
	If camangle = 1  
		PositionEntity cam,coll\x#,leval#+40,coll\z# 
	EndIf 
	If camangle=2  
		PositionEntity cam,coll\x#-22.5,leval#+30,coll\z#-22.5 
		
	EndIf 

	PointEntity cam,coll\box
	If KeyDown(57)   
		PositionEntity cam,coll\x#,leval#+12,coll\z#
		PointEntity cam,target\Dir_Pointer

		camangle=2
	EndIf
	
	
	
;PositionEntity ROBOX,EntityX(sphere),leval#,EntityZ(sphere);;;;;;;;;;;;;sitionEntity Robo\model,coll\x#,leval#,coll\z# 
PositionEntity Robo\model,coll\x#,leval#,coll\z#


;PositionEntity sphere,EntityX(ROBOX),leval#+4,EntityZ(ROBOX);;;;;;;;;;;;;
PositionEntity coll\box,coll\x#,leval#+4,coll\z#
 
End Function

Function elivator()
If KeyHit(208)

leval# = leval# - 50
 PositionEntity coll\box,Robo\x#,leval#,Robo\z# 
 PositionEntity Robo\Dir_Box,coll\x#,leval#,coll\z#+45   
 PositionEntity target\Dir_pointer,coll\x#,leval#,coll\z#-45
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_pointer

 camangle = 2
 
	

EndIf 

If KeyHit(200)

leval# = leval# + 50 

 PositionEntity coll\box,Robo\x#,leval#,Robo\z#
 PositionEntity Robo\Dir_Box,coll\x#,leval#,coll\z#+45   
 PositionEntity target\Dir_pointer,coll\x#,leval#,coll\z#-45
 PositionEntity light,coll\x#,leval#,coll\z#
 PointEntity light,target\Dir_pointer
 
 camangle=2
 

	

EndIf   
End Function 

Function move_box(ent,x#,y#,z#)

 If EntityCollided(coll\box,2) 
	For n=1 To CountCollisions(coll\box) 
		
		ent = CollisionEntity(coll\box,n) 

		;x#=CollisionNX(coll\sphere,n)*.25
		;y#=CollisionNY(sphere,n)/.50
		;z#=CollisionNZ(coll\sphere,n)*.25
		x#=CollisionNX(coll\box,n)*.75
		z#=CollisionNZ(coll\box,n)*.75

		TranslateEntity ent,-x#,0,-z# 
 
	Next
 EndIf 
End Function 

Function testkeys(keys_pressed)
;forward right
	If KeyDown(17) And KeyDown(32) Then
		Return 1
	EndIf 
;forward left
	If KeyDown(17) And KeyDown(30) Then
		Return 2
	EndIf 
;back left
	If KeyDown(31) And KeyDown(30) Then
		Return 3
	EndIf 
;back right
	If KeyDown(31) And KeyDown(32) Then
		Return 4
	EndIf
;forward	
	If KeyDown(17) Then
		Return 5
	EndIf 
;back	
	If KeyDown(31) Then
		Return 6
	EndIf 
;right	
 	If KeyDown(32) Then
		Return 7
	EndIf 
;left	
	If KeyDown(30) Then
		Return 8
	EndIf 
End Function



;Function test_input(rsx#,lsx#,fsz#,bsz#,keys_pressed)
 .test_input
;rsx#= .50 ;right movment value 
;lsx#=-.50 ;left movment value
;fsz#=-.50 ;forward movement value 
;bsz#= .50 ;back movement value
;check for movement by user
;needs a point entity comand for the robox turn methodiology mophisizm
;32=right,17=forward,31=back,30=left
;1 invisable boxes north south for control of robot
;Select True


Select keys_pressed

;If keys_pressed = 1
Case 1 ;forward right
  PositionEntity Robo\Dir_Box ,coll\x#-45,leval#,coll\z#-45
  TranslateEntity coll\box,rsx#,0,bsz#:PointEntity Robo\model,Robo\Dir_Box 
  PositionEntity target\Dir_Pointer,coll\x#+45,leval#+4,coll\z#+45
  PositionEntity light,coll\x#,leval# + 12,coll\z# ;need to turn light into type field
  PointEntity light,target\Dir_Pointer
Return 
 
 ;If keys_pressed = 2 Then 
Case 2 ;forward left
  PositionEntity Robo\Dir_Box,coll\x#+45,leval#,coll\z#-45
  TranslateEntity coll\box,lsx#,0,bsz#:PointEntity  Robo\model,Robo\Dir_Box 
  PositionEntity target\Dir_Pointer,coll\x#-45,leval#+4,coll\x#+45
  PositionEntity light,coll\x#,leval#+12,coll\z#
  PointEntity light,target\Dir_Pointer
Return
 
;If keys_pressed = 3 Then 
Case 3 ;back left
 PositionEntity Robo\Dir_Box,coll\x#+45,leval#,coll\z#+45  
 TranslateEntity coll\box,lsx#,0,fsz#:PointEntity Robo\model,Robo\Dir_Box
 PositionEntity target\Dir_Pointer,coll\x#-45,leval#+4,coll\z#-45
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_Pointer
Return

;If keys_pressed = 4 Then
Case 4 ;back right
 PositionEntity Robo\Dir_Box,coll\x#-45,leval#,coll\z#+45  
 TranslateEntity coll\box,rsx#,0,fsz#:PointEntity Robo\model,Robo\Dir_Box
 PositionEntity target\Dir_Pointer,coll\x#+45,leval#+4,coll\z#-45
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_Pointer
Return
;EndIf
 
;If keys_pressed = 5 
Case 5 ;forward
 PositionEntity Robo\Dir_Box,coll\x#,leval#,coll\z#-45
 TranslateEntity coll\box,0,0 ,bsz#*2:PointEntity Robo\model,Robo\Dir_Box
 PositionEntity target\Dir_Pointer,coll\x#,leval#+4,coll\z#+45
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_Pointer
Return                      
;EndIf 
 
;If keys_pressed = 6 Then
Case 6  ;back 
 PositionEntity Robo\Dir_Box,coll\x#,leval#,coll\z#+45   
 TranslateEntity coll\box,0,0,fsz#*2:PointEntity Robo\model,Robo\Dir_Box
 PositionEntity target\Dir_Pointer,coll\x#,leval#+4,coll\z#-45
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_Pointer
Return 
;End If
 
;If keys_pressed = 7 Then 
Case 7 ;right
  PositionEntity Robo\Dir_Box,coll\x#-45,leval#,coll\z#
  TranslateEntity coll\box,rsx#*2,0,0:PointEntity Robo\model,Robo\Dir_Box
  PositionEntity target\Dir_Pointer,coll\x#+45,leval#+4,coll\z#
  PositionEntity light,coll\x#,leval#+12,coll\z#
  PointEntity light,target\Dir_Pointer
Return
;End If
 
;If keys_pressed = 8 Then 
Case 8 ;left 
 PositionEntity Robo\Dir_Box,coll\x#+45,leval#,coll\z#  
 TranslateEntity coll\box,lsx#*2,0,0:PointEntity Robo\model,Robo\Dir_Box
 PositionEntity target\Dir_Pointer,coll\x#-45,leval#+4,coll\z#
 PositionEntity light,coll\x#,leval#+12,coll\z#
 PointEntity light,target\Dir_Pointer
Return

;End If   
  

;End Function
 
End Select  
Return
 






	



 



Some things I would like to know.
Why do I have to keep the move_box(ent,x#,y#,z#)
call out of the tween or is that for the best.
Do you find the controls comfortable, natural?
Will I get Gorge Lucus send his wookies after me for using an r2-d2 likeness.