Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / And yet another question for 2D...

Author
Message
dlefik79
20
Years of Service
User Offline
Joined: 26th Jun 2003
Location:
Posted: 26th Jun 2003 18:24
Oh wait, yeah this forum is all 2D...anyhow, I been trying like mad to figure out how to flash text during a game without hindering game performance. Like I tried a loop that would wait for a duration, clear text, wait again, print text, and repeat the process, but it ended up affecting the whole overall program. Like for example, you start the game and while it's playing, put some text in the middle of the screen like "Press Start To Begin", and flash that text at a medium consistent speed while playing a demo of the game at the same time, sorta like those old arcade games that would flash "Insert Coins" while you were watching the demo of the game. Thanks in advance if someone could help me out, I hate asking for stuff like this as I should try and do it myself, which I have, for quite a while but can't figure it out.
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 18:29
Here is some nice code Fresh from the oven

=======
do
REM do all your crap here..such as printing objects, images, etc

if x=5 then print "INSERT COINS!"
x=x+1
if x>5 then x=0
sync

loop
=======

Is that what you're looking for?

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
dlefik79
20
Years of Service
User Offline
Joined: 26th Jun 2003
Location:
Posted: 26th Jun 2003 19:08
YES!! It worked man, I took your idea, and came up with this and it works beautiful!!!! I added the code I wrote so you could see how I did it. Man thank you soo much, it was soo simple, and I feel so dumb lol. Thanks again morph!

Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 19:16
Glad to help.


I believe the code may run fast on 2 GHZ machines compared to 600 MHZ. It will probably blink faster, but I dunno. You'll have to test it.

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
ftrules
20
Years of Service
User Offline
Joined: 1st Jul 2003
Location:
Posted: 1st Jul 2003 20:02
I had a similar problem and I used your code and it works almost perfect.The problem is it blinks too fast.Can you help me?
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Jul 2003 20:33 Edited at: 1st Jul 2003 20:42
Really all the blinking should be controlled with the timer.

Time = Timer()+1000
do
If time <= timer()
Time = Timer()+1000
do your stuff here!
Endif
Loop
dlefik79
20
Years of Service
User Offline
Joined: 26th Jun 2003
Location:
Posted: 2nd Jul 2003 09:25
Yeah, right where I put if x = 20, just increase 20 to whatever duration you want. Now the only problem I'm having is say you have multiple text on a screen but you want to only blink on thing, using the cls method wouldn't be too good because if I'm guessin' right, it clears all the text, thus blinking everything else.....

Megaman X Gold
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location: Canada
Posted: 2nd Jul 2003 21:41
Why don't you, instead of a cls function, have the text command refer to a string value, and when you would normally want that text to be seen have the value "Press Start" and then when you don't want it seen have it replace using "". I don't know if that's a good idea, but it's what I'd try to do. 0.0

Cya.

Life is more like a box of Grenades. Throw the pin instead of the grenade, and it blows up in your face...along with the rest still beside you.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Jul 2003 22:01 Edited at: 2nd Jul 2003 22:02
You can make text opaque and use "(SPACES)" to cover it up!
LuciferX
20
Years of Service
User Offline
Joined: 16th May 2003
Location: United States
Posted: 8th Jul 2003 07:26
yes, the timer one is correct.

i was thinking of the sleep command, but that would not blink at an exact interval

Do or do not, there is no try. -Yoda

Login to post a reply

Server time is: 2024-04-23 13:33:13
Your offset time is: 2024-04-23 13:33:13