In need of a good goto

Blitz3D Forums/Blitz3D Programming/In need of a good goto

Doggie(Posted 2004) [#1]
Here's the code:
If KeyDown(200) Then
MoveEntity player,0,0,-2
MoveEntity cam,0,0,-2 
MoveEntity sphere,0,0,-4 
For e=1 To MAX_ENEMIES
MoveEntity enemy[e]\pivot,2,0,2
PointEntity enemy[e]\pivot,player
PositionEntity enemy[e]\pivot,EntityX(enemy[e]\pivot)+Rnd(1,4),tery+6,EntityZ(enemy[e]\pivot)+Rnd(1,2)
Next
EndIf


If KeyDown(208) Then
MoveEntity player,0,0,2
MoveEntity cam,0,0,2
MoveEntity sphere,0,0,4 
For e=1 To MAX_ENEMIES
;MoveEntity enemy[e]\pivot,-2,0,2
PointEntity enemy[e]\pivot,player
;PositionEntity enemy[e]\pivot,EntityX(enemy[e]\pivot)+Rnd(1,4),tery+6,EntityZ(enemy[e]\pivot)
Next
EndIf

What I'm trying to do is get my sprite soldiers to follow the player. In the actual game they won't do this automatically like in this example I just left it that way for testing. Also you'll notice the cam is not parented to the player and that's because I'm using a smooth follow cam. But anyways. The problem is the sprites either all bunch up or when I'm not going directly in the X direction they don't follow so well. Any ideas?

Thanks


Paolo(Posted 2004) [#2]
I don't know if I understand well,
but try by having first the "PointEntity" command and then the "movements" command, I mean, first you should align and then move.

PointEntity enemy[e]\pivot,player
MoveEntity enemy[e]\pivot,2,0,2

if it is not, then I don't know...
Paolo.


Doggie(Posted 2004) [#3]
Aw fer cryin' out loud...
I can't believe I hadn't even noticed I did that.
Yep, that pretty much solved it 'cept that I still need to make adjustments for when the player is moving at intermediate angles...Thanks for your help.