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.

Newcomers DBPro Corner / Trying to display text for certain time . HELP

Author
Message
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 11th Nov 2003 01:48
Well i started making a astroids clone but then fianlly got aliens workign and made like a little alien shoot up game. Now im trying to display the level in the center of the screan for a few seconds . If i type :
if score=250 then inc alienspeed#,1 :inc rgb(255,255,255),0 :center text 320,240,"Level 1"
if score=1500 then inc alienspeed#,2 :inc rgb(255,255,255),0 :center text 320,240,"Level 2"
if score=2500 then inc alienspeed#,3 :inc rgb(255,255,255),0 :center text 320,240,"Level 3"
if score=3500 then inc alienspeed#,4 :inc rgb(255,255,255),0 :center text 320,240,"Level Xtreme"


then it only shows up really quick and disappears again. is there som ecommand that i can display the text without stopping the game for a certain time like 3 seconds if yes write here and email me !!!

thx
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 11th Nov 2003 02:47
Also i need some help with the mousemovement

mousemovex() direction=

when i put direction1 then in keyboard it moves left when i put direction 2 it moves right how cna i combine these 2 with the mosue that it moves when the mouse moves to the left or right side ?
if i got any info let me know
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Nov 2003 02:50
I did this with particles using the timer() function. I just posted that code here the other day. Search this forum and DBP Discussion for the term "Particle" and/or "Particle Loop". The question was about how to display particles for a short time in the main loop with out halting the main loop - it should help you out.

-RUST-
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 11th Nov 2003 04:41
thx dude that helped me alot yeha i found the aliens code in soem other game witht he speed and score so i used that ^^ jsut rewrote it a littl bit and changed soem stuff aroudn but thx again
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Nov 2003 05:45
no prob


-RUST-
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Nov 2003 07:43
Wouldn't this be easier, less code, and more versatile?

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Nov 2003 16:15
phaelax, yes, the code in the original post is redundant but it's not really what he was asking about. And for both of you, the best way imho would be to write a sub or func that changes all of the items (ie alien speed, ink color, center's the text, and prints correct message - all in one reusable piece of code. Most likely a function would be nice, to send in the correct arguments, not caring about any return.

-RUST-
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 11th Nov 2003 21:56
yeha a function thats what i ll do nto too much space hmm i never though of that thx again
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Nov 2003 00:54


-RUST-
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 12th Nov 2003 04:13
hmm
i sitll dont think i get it right in the article u posted about particles i didnt c any code snipped so i couldnt figure it out with the function im getting a friend to help me cause im fairly new but cool
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Nov 2003 06:23 Edited at: 12th Nov 2003 06:24
pseudo code:

do
...
if something
timedelay=timer()+ length_of_time_in_millis
post my message as a sprite other object
endif

if timedelay < timer() then hide my message as a sprite other object
...
loop


This way the messag object gets put up but is not removed until the outter if-then equates to true. The reason I say message object is that I think plain text will get erased on next sync but a sprite or image etc won't - double check me on that. but the above is the logic you could build upon.

hope that helps

-RUST-
Mr Fraggs
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location: US
Posted: 12th Nov 2003 23:33
tight u saved me yeah !!!!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Nov 2003 01:29




-RUST-

Login to post a reply

Server time is: 2024-09-21 09:29:28
Your offset time is: 2024-09-21 09:29:28