I'm having trouble... the idea is a simple sphere movement game, and all I have is the left key coded (when you press left, you go left), and already it doesn't work correctly. My problems:
1. When I animate it, the sphere refuses to budge. To get it to move you have to take out the animate command.
2. When you press left (assuming you have taken out the animate command so it can move) it not only turns left, but flies into the air - essentially turning left at an angle. I've rotated and turned the sphere's brains out, and still it doesn't work. Is there a way to find the sphere's axis? I don't know how to fix this.
Here's the code:
1. When I animate it, the sphere refuses to budge. To get it to move you have to take out the animate command.
2. When you press left (assuming you have taken out the animate command so it can move) it not only turns left, but flies into the air - essentially turning left at an angle. I've rotated and turned the sphere's brains out, and still it doesn't work. Is there a way to find the sphere's axis? I don't know how to fix this.
Here's the code:
Graphics3D 800, 600 SeedRnd MilliSecs() Const leftkey = 203, rightkey = 205, upkey = 200, downkey = 208 Const spacebar = 57, enter = 28 light = CreateLight() PositionEntity light, 0, 0, 0 camera = CreateCamera() PositionEntity camera, 0, 10, 0 sphere = CreateSphere() PositionEntity sphere, 0, 1, 20 EntityType sphere, 1 spheretex = LoadTexture("blitzlogo.bmp") ScaleTexture spheretex,.125,.25 RotateTexture spheretex, 90 EntityTexture sphere, spheretex RotateEntity sphere, 0, 0, 90 For frame = 0 To 10 TurnEntity sphere, 0, 36, 0 SetAnimKey sphere, frame Next sequence = AddAnimSeq(sphere, frame - 1) PointEntity camera, sphere ground = CreatePlane() PositionEntity ground, 0, -1, 0 EntityType ground, 2 Collisions 1, 2, 2, 2 SetBuffer BackBuffer() Animate sphere, 1, .5 While Not KeyDown(1) If KeyDown(leftkey) TurnEntity sphere, -15, 0, 0 EndIf MoveEntity sphere, 0, 0, .5 UpdateWorld RenderWorld Text 0, 0, EntityZ(sphere) - EntityZ(camera) If Animating(sphere) Text 0, 20, "Animating" EndIf Flip Delay 15 WendAny help would be much appreciated.