Posts: 3
Threads: 1
Joined: Mar 2004
Hello, i have just started QBasic...i think three days ago ;]
So i have learned main things on basic and, I would like to know how to create text-based games? For example RPG?
I just need main things, how should i start...
/\ /\^ /\^
/ \ / \ETALLICA/_\
/ * \ / \
\ / \/ \/ \/
Silent-Death
Unregistered
Welcome to the World of Qbasic
!
Well here's a simple thing...
Code:
CLS
Print "You are Faced with two doors"
Print "1- Pick the left one"
Print "2- Pick the right one"
Print "Well what is your choice?";
INPUT Choice
IF Choice = 1 THEN
CLS
Print "There was a monster behind there and he ate you..."
END
END IF
IF Choice = 2 THEN
CLS
Print "You opened the door and entered a room."
END IF
Print "There's a opened window..."
Print "1- Look outside"
Print "2- Dance till you can't dance no more =P"
Print "Well what is your choice?";
INPUT Choice
IF Choice = 1 THEN
CLS
Print "You looked out the window and fell out..."
END
END IF
IF Choice = 2 THEN
CLS
Print "You started to dance..."
END IF
And so on... if you don't really understand some of the commands and such just tell me and i'll explain them. You can add so much more to this, just this is a rough example.
Posts: 3
Threads: 1
Joined: Mar 2004
hey:]
thanks for care, but this thing i know allready, but for example, hoe to do stats of the hero?I mean HP, strenght and so on:]
I think I want to much for now, but im interested ;]
[/code]
/\ /\^ /\^
/ \ / \ETALLICA/_\
/ * \ / \
\ / \/ \/ \/
Posts: 2,765
Threads: 138
Joined: Nov 2002
variables
Code:
health = 10
strength = 10
soon = 10
'blahblahblah
PRINT "You found a potion!"
PRINT "1) Drink it"
PRINT "2) Throw it"
INPUT CHOICE
IF CHOICE = 1 THEN
PRINT
PRINT "Your health went up by 5!"
health = helth + 5
ELSE
PRINT
PRINT "You threw it and blah
END IF
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 2,771
Threads: 96
Joined: Oct 2003
Posts: 3
Threads: 1
Joined: Mar 2004
OK, thats clear... and the last question....
How to do the fight scenes...
for example you meet an enemy and you fight him (if you want to fight ofcourse:]) If ure stronger and you have more HP u kill him, but u loose your hp (however u get str or exp or smth:]), but if ure weaker u die...
/\ /\^ /\^
/ \ / \ETALLICA/_\
/ * \ / \
\ / \/ \/ \/
Posts: 3,616
Threads: 287
Joined: Jan 2003
Psuedocode...
Code:
IF YouHitAnEnemy AND YouChooseToFight THEN
IF (YourHP > EnemyHP) AND (YouAreStrongerThanEnemy) THEN
KillEnemy
IncreaseStrength
IncreasePoints
DecreaseHP
ELSE
YouDie
END IF
END IF
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 2,765
Threads: 138
Joined: Nov 2002
Quote:oopsies, WT...... typo!!
me? is it the end quote? *stabs it*
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.