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.

DarkBASIC Professional Discussion / How to add quetions through out your game random though out game/maze

Author
Message
Broncofan
16
Years of Service
User Offline
Joined: 7th Apr 2010
Location:
Posted: 7th Apr 2010 22:48
I am trying to add quetions to my game and i was wondring on how to add them to my game
Thanks for the help
broncofan
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th Apr 2010 03:39 Edited at: 8th Apr 2010 03:54
Hmm, what do you mean exactly? Putting a question in should be as easy as.

text 0,0,"What is your name? "
input name$
cls
text 0,0,"Hello ";name$

But obviously input stops the game so is not good for a game in general, and cls would wipe your entire screen. More info would be useful.

Random questions would be a case of making an array to store them, then calling the relevant question using the rnd command.

randomize timer()
flag=0
Dim questions$(2)

questions(1)="You are attacked by a dwarf. Fight?"
questions(2)="All is clear."

flag=rnd(2)+1

do
gosub question
sync
loop

question:
if flag=1
text 0,0,questions(1)
endif
if flag=2
text 0,0,questions(2)
endif
return

Hope that helps. If not just ask.

http://s6.bitefight.org/c.php?uid=103081
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Apr 2010 17:42
Do you mean "question" or "quest"? Questions are easy. Quests have a lot more involvment. What kind of game is it?

The fastest code is the code never written.
Broncofan
16
Years of Service
User Offline
Joined: 7th Apr 2010
Location:
Posted: 9th Apr 2010 21:17
well this is a game for my computer class and i need to make it educational so i was thinking about adding quetions to it randomly though the map so they cant mimerize the map and it would be differnt each time they play
Broncofan
16
Years of Service
User Offline
Joined: 7th Apr 2010
Location:
Posted: 9th Apr 2010 21:35 Edited at: 9th Apr 2010 23:49
This what i have so far for my game

if u could I would aslo like to know how to add a timer for this game this my frist game and I want to be decsent and pepole would have fun

Login to post a reply

Server time is: 2026-07-26 15:31:32
Your offset time is: 2026-07-26 15:31:32