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 / help with my first game

Author
Message
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 10th Jul 2004 01:57
i made a version of pong :p and i am using dbc
but when score hits 10 i want to print a menu doind with this code:

i think it works the only problem is that it only displays a split second and then displays the pong screen (including the background color and the paddles/ball), but ofc i don't want that i want it to display the prints and wait for the input.
How do i do that? (i bet its simple :p)
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jul 2004 01:59 Edited at: 10th Jul 2004 02:00
if you want to delay for a cetain period of time use WAIT command...
WAIT takes milliseconds as a parameter so to wait for three seconds you would say

WAIT 3000

after the 3000 milliseconds (3 seconds) has elapsed, execution will continue


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 10th Jul 2004 03:40
i put a wait 3000 command after this code:
if player1score#=2
input "won, again? (1)yes or (2)no",keuze
else
input "lost, again? (1)yes or (2)no",keuze
endif

and i deleted all the suspend key commands, but now it just freezes the game when the paddles and ball is drawn, so it doesn't seem to freeze at the right time, very strange so if you still got some ideas or anybody else i ll post the full code with it now


Don't mind the dutch code or prints you get the idea what they mean by looking at the code

thanks
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jul 2004 04:01 Edited at: 10th Jul 2004 04:02
try this instead



changes:
moved SYNC to bottom of do loop
changed keuze to keuze$
changed if keuze$ = 2 to if keuze$ = "2"


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 10th Jul 2004 08:14
nope, still just freezes and you can type your the "2" but in the screen with the paddles and the ball
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 12th Jul 2004 03:16
so nobody got a clue about how to put a little menu in it
maybe better if i make a function with the game in and a function with the menu in or should i work with labels (if the menu is active i jump to a lable where the meny is?)?

tia
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 13th Jul 2004 01:20
well i was able to delete the objects, but still the text only displays for a few seconds. i tried using a label so my menu is out of the main loop but that doesn't help, using a function doesn't help either. I tried putting the sync off in the menu but that doesn't help either
But still the text is there only a split second and if i type in 2 then it does the menu right :s
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 15th Jul 2004 07:04 Edited at: 15th Jul 2004 07:06
Try This:



What I did was make a loop that will keep on outputting those commands until you press a 1 or a 2.

It should work better.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 15th Jul 2004 07:49
Yeah, I've had similar troubles getting text to appear in a very general sense, it seems it must be printed each time through the loop. So, when you want to make a short menu or prompt like that, you have to make a mini-loop just to print the text until you get an input, or stop an input of some kind. Dunno why that's so, it just seems to be the case.
S.

Any truly great code should be indisguishable from magic.
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 16th Jul 2004 00:11
thanks for the help

but if i paste it under my code it still doesn't do it i changed it to this:

to get compilation errors out but it still displays the paddles :s
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 16th Jul 2004 06:46
Sorry, I didn't read your variable correctly:


"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 16th Jul 2004 07:22
thank you its working now, i should have seen that part of the vars being wrong
(forgot to delete my first menu so ofc it hung :s)
but can you tell me what that backdrop command does? because if i do it and i start a new game the trajectory of the ball keep being seen, so i put it in comment and now the ball is shown right so i guess its not needed?
Can you give me an explenation why you need to put the menu in commands because without the loop it shouldn't disappear as it can't run the code after the suspend key command without a key being pressed or can it??

thx for the help again :d
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 16th Jul 2004 11:15
Backdrop off makes it so the text is drawn over the 3D objects. If you didn't have that command, then the text could be hidden by the Ball or paddle. Use backdrop on as soon as the menu is donw to return it to normal.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
raar
20
Years of Service
User Offline
Joined: 9th Jul 2004
Location:
Posted: 17th Jul 2004 00:01
i just deleted the backdrop command and delete my 3 objects so that solves the printing over objects too and i make the objects again after the menu is processed
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 17th Jul 2004 01:21
Ok.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949

Login to post a reply

Server time is: 2024-09-22 16:19:19
Your offset time is: 2024-09-22 16:19:19