Hi, I'm new to arkbasic and I was hoping someone might be able to help me understand a problem I'm having with Darkbasic Classic.
I was messing around with some of the tutorials and came up with the code that's attached to this post. My problem is that every time I try to implement collision detection I end up having the frames per second lowered from about 35 to 45 FPS to about 5 FPS.
For example I would do the following:
IF Object Collision(10,0)>0
Position Object 10,X#,0,Z#
ENDIF
But as I said that lowers the FPS considerably. I've tried putting it in the events themselves instead of just inside the loop, for example:
IF Upkey()=1 AND Spacekey()=0
IF Object Collision(10,0)>0
Position Object 10,X#,0,Z#
ENDIF
Move Object 10,-5
Loop Object 10,2,23
Set Object Speed 10,20
ELSE
Stop Object 10
ENDIF
But of course that doesn't work either. It will keep the frame rate working properly as long as you don't try to go forward. The minute you do however, it drops the frame rate again. I've tried different things and ended up with either the bad frame rate, the player's model/object not being able to move forwards or backwards at all or else the collision detection won't work at all.
It could be my computer but I don't understand why it wouldn't be able to handle this code when I've run other examples and games with little trouble.
If someone could please help me understand why the collision detection won't work I would very much appreciate it, thanks.
_./-''-._
| Sieg |
-:_.._/:-