pop-up graphics with time loop trouble

BlitzPlus Forums/BlitzPlus Beginners Area/pop-up graphics with time loop trouble

gerald(Posted 2011) [#1]
I want a graphic to pop-up for 2 seconds. I am using a waitmouse() for interaction control. This seems to shut off the interaction of the graphics with the timer control.

My coding is a little weak. Is there a quick fix or do I need to start with the pop up timer as a primary feature not the mouse hit/waitmouse() control?

is there a loop that will time the graphics and still allow the waitmouse() to sit where it does?

Gerald


Gladclef - Ben B(Posted 2011) [#2]
Can't you write a custom code for the mouse/timer?
eg:

endTime = millisecs()+2000

while(1)
	if (mousedown(1)==1 or mousedown(2)==1 or mousedown(3)==1)
		exit
	endif
	if (millisecs > endTime)
		exit
	endif
end while



gerald(Posted 2011) [#3]
Thanks,

I was able to use a while loop with the time variable and a goto to cycle through it and another goto to move to next event.

gerald


Gladclef - Ben B(Posted 2011) [#4]
Hmm, so I'm glad that you got it work, but I would like to say something about the goto statement:

It's basically a hack that was left in high level languages because people didn't want to migrate from its use as languages evolved, specifically from assembly to fortran to c.

The use of goto is strongly discouraged as it makes code very difficult to read and maintain, and java even prevents you from every using the word "goto" ever, even as a variable name.

That said, it's a great hack if used wisely. It's just near impossible to use it wisely and I don't even trust myself with it.

Good luck! ;)

Last edited 2011