timer help needed

Blitz3D Forums/Blitz3D Beginners Area/timer help needed

767pilot(Posted 2004) [#1]
look at the code below. I have 2timers 1 for 60 and 1 for 10.
Problem i have is that the targets move very fast on the screen. Using both timers makes no difference that I can see. Using just timer 1 makes the mouse move slow.
I want the mouse to move full speed but be able to control the speed of the targets with a timer. How can I do this please?



767pilot(Posted 2004) [#2]
also how do i put code on these forums into the scrolling box?


Ross C(Posted 2004) [#3]
Put either:

For the code box, without scroll bars:

(code)

ENTER CODE HERE

(/code)

For the code box with scroll bars:

(codebox)

ENTER CODE HERE

(/codebox)

but, use [] instead of ()


Ross C(Posted 2004) [#4]
As with regards to your timer issue. What are you trying to do? Are you trying to keep the game running at a particular frame rate (speed)? Or are you trying to slow down the targets a little. If your trying to slow down the targets, then don't move them as much each loop.

I think you need to explain a little more (well to me anyway :) )


puki(Posted 2004) [#5]
"Ross" to the rescue - he's like a St Bernard.

I think he should finish his game so that 'Blitz Research' can do a "Ross C" interview.


767pilot(Posted 2004) [#6]
solved, just created a loop where it added 1 each time the main loop was run then checked to see if it equaled 20. if it did then it moves the targets then resets the flag to 0. by altering this number i can control more or less the speed of the target movement

thanks


Ross C(Posted 2004) [#7]
That's is one way to do it. BUT, on a different computer, the counter may count faster, because your basically depending on the graphics being rendered at the same speed on everyones computer, if you know what i mean.

lol @ puki

If Blitz Research gave me an interview, it would be a slap in the face to alot of the guys out there :)


767pilot(Posted 2004) [#8]
but as long as a timer is used ie createtimer(60) and in the loop 'waitevent timer' is used would that not compensate for the speed of the computer?