Computer Bay
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Qbasic

3 posters

Go down

Qbasic Empty Qbasic

Post by Dehdesh Sun Oct 26, 2008 8:49 pm

A simple programming language, that just about anyone could learn, but I'm having a lot of fun with it, I just finished my own little turn based battle engine. You can either choose either heal or attack, and I have set the ai to where he doesn't heal when he has full hp, and he always heals when his hp is below 10. I could probably fine tune this to where the AI is pretty close to unstoppable, but that wouldn't be fun... I was wondering, could I clean this code up a little bit so that it takes up less lines, and get a similar effect?


Code:

CLS
hp = 100
maxhp = 100
hpb = 100
maxhpb = 100
SLEEP 1
CLS
PRINT hp; "/"; maxhp
PRINT hpb; "/"; maxhpb
1 PRINT ""
PRINT ""
INPUT "attack or heal"; a$
IF a$ = "attack" THEN GOTO 2
IF a$ = "heal" THEN GOTO 3
GOTO 1
2 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb - num
SLEEP 1
CLS
PRINT hp; "/"; maxhp
COLOR 4
PRINT "-"; num
COLOR 7
PRINT hpb; "/"; maxhpb
IF hpb <= 0 GOTO 8
GOTO 6
NEXT
LOOP
3 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp + num
SLEEP 1
CLS
IF hp > 100 THEN hp = 100
COLOR 2
PRINT "+"; num
COLOR 7
PRINT hp; "/"; maxhp
PRINT hpb; "/"; maxhpb
GOTO 6
NEXT
LOOP
4 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp - num
SLEEP 1
CLS
COLOR 4
PRINT "-"; num
COLOR 7
PRINT hp; "/"; maxhp
PRINT hpb; "/"; maxhpb
IF hp <= 0 GOTO 7
GOTO 1
NEXT
LOOP
5 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb + num
SLEEP 1
CLS
IF hpb > 100 THEN hpb = 100
PRINT hp; "/"; maxhp
COLOR 2
PRINT "+"; num
COLOR 7
PRINT hpb; "/"; maxhpb
GOTO 1
NEXT
LOOP
6 DO
RANDOMIZE TIMER
FOR count = 1 TO 2
LET num = RND
LET num = INT(2 * num) + 1
IF hpb = 100 GOTO 4
IF hpb < 10 GOTO 5
IF num = 1 GOTO 5
IF num = 2 GOTO 4
NEXT
LOOP
7 PRINT "you lose!"
END
8 PRINT "YOU WIN!"
END
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Thu Oct 30, 2008 1:04 pm

I've updated my engine to where you can buy items after the battle, select your name, and included mana potions. I am currently working on an EXP system to where you level up after defeating the opponent a certain amount of times.
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Mon Nov 03, 2008 2:47 pm

I've dropped in exp now, and am planning to put in menus and a movable character.

Here is my code so far:

Code:
CLS
INPUT "what is your name"; name$
SLEEP 1
CLS
sword = 0
shield = 0
manapot = 2
ammy = 0
armor = 0
H = 0
I = 0
j = 0
k = 0
l = 0
m = 0
a = 0
b = 0
c = 0
d = 0
xp = 0
maxexp = 100
lvl = 0
arch = 100
cast = 100
cash = 100
hp = 100
maxhp = 100
hpb = 100
maxhpb = 100
manab = 100
nameb$ = "enemy"
mana = 100
manamax = 100
x = 1
y = 20

1
2 SLEEP 1
CLS



PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab




PRINT ""
PRINT ""
INPUT "attack, heal, or potion"; a$
IF a$ = "attack" THEN GOTO 3
IF a$ = "heal" THEN IF mana > 0 THEN GOTO 4
IF a$ = "heal" THEN IF mana = 0 GOTO 21
IF a$ = "potion" THEN IF manapot > 0 GOTO 40
GOTO 2

3 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hpb = hpb - num
SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
COLOR 4
PRINT "-"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hpb <= 0 GOTO 9
GOTO 7
NEXT
LOOP

4 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hp = hp + num
SLEEP 1
CLS
IF hp > maxhp THEN hp = maxhp
mana = mana - 10
COLOR 2
PRINT "+"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 7
NEXT
LOOP

5 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp - num
SLEEP 1
CLS
COLOR 4
PRINT "-"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hp <= 0 GOTO 8
GOTO 2
NEXT
LOOP

6 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb + num
SLEEP 1
CLS
manab = manab - 10
IF hpb > 100 THEN hpb = 100
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
COLOR 2
PRINT "+"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 2
NEXT
LOOP

7 DO
RANDOMIZE TIMER
FOR count = 1 TO 2
LET num = RND
LET num = INT(2 * num) + 1
IF manab = 0 GOTO 5
IF hpb = 100 GOTO 5
IF hpb < 10 GOTO 6
IF num = 1 GOTO 6
IF num = 2 GOTO 5

NEXT
LOOP
8 PRINT "you lose!"
GOTO 22



9 PRINT "YOU WIN!"
cash = cash + 500
PRINT "You now have $"; cash
IF lvl < 10 THEN xp = xp + 100
PRINT "EXP:"; xp; "/"; maxexp
IF xp >= maxexp THEN IF lvl < 10 THEN lvl = lvl + 1: PRINT "LEVEL UP!": xp = xp - maxexp: maxexp = maxexp + 100


PRINT xp
SLEEP
CLS


10 PRINT "Welcome to the store"
SLEEP
CLS
IF value = 0 THEN PRINT "would you like to buy anything? (Y,N)"
IF value = 1 THEN PRINT "would you like to buy anything else? (Y,N)"
INPUT b$
IF b$ = "n" THEN GOTO 19
SLEEP 1
CLS

IF b$ = "y" GOTO 20
GOTO 10
20 PRINT "here is our inventory:(to exit input exit)"
PRINT "1.manapotion $20  2.Sword  $1000  3.Shield $1000"
PRINT "4.Armor $3000  5.Magic Ammulet $3000 6. HAX! $100000"
PRINT "YOUR CASH: $"; cash
INPUT c$

IF c$ = "1" THEN IF cash >= 20 THEN manapot = manapot + 1: cash = cash - 20

IF c$ = "2" THEN IF cash >= 1000 THEN sword = 1: cash = cash - 1000

IF c$ = "3" THEN IF cash >= 1000 THEN shield = 1: cash = cash - 1000

IF c$ = "4" THEN IF cash >= 3000 THEN armor = 1: cash = cash - 3000

IF c$ = "5" THEN IF cash >= 3000 THEN ammy = 1: cash = cash - 3000

IF c$ = "6" THEN IF cash >= 100000 THEN hax = 1: cash = cash - 100000

IF c$ = "exit" GOTO 19

IF sword = 1 THEN s = 20: r = 50: x = s + 1 + l: y = r + 20 + m

IF armor = 1 THEN G = 200: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF shield = 1 THEN H = 100: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF ammy = 1 THEN k = 200: mana = 100 + k + j: manamax = 100 + k + j

IF hax = 1 THEN I = 10000: hp = 100 + G + I + H: maxhp = 100 + G + I + H: j = 10000: mana = 100 + k + j: l = 20000: x = s + 1 + l: m = 50000: y = r + 20 + m

PRINT "you bought #"; c$
value = 1
SLEEP 1
GOTO 10


19
value = 0
PRINT "next battle? (Y,N)"
INPUT q$

mana = 100 + k + j
manamax = 100 + k + j
hp = 100 + G + I + H
maxhp = 100 + G + I + H
x = s + 1 + l
y = r + 20 + m

IF lvl = 1 THEN a = 5: c = 5: b = 2: d = 3: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d


IF lvl = 2 THEN a = 7: c = 7: b = 3: d = 4: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 3 THEN a = 10: c = 10: b = 5: d = 6: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b:  y = y + d

IF lvl = 4 THEN a = 15: c = 15: b = 7: d = 8: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 5 THEN a = 20: c = 20: b = 9: d = 10: hp = hp + a: maxhp = maxhp + a: manamax = manamax + c: mana = mana + c: x = x + b: y = y + d

IF lvl = 6 THEN a = 50: c = 50: b = 11: d = 12: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 7 THEN a = 75: c = 75: b = 13: d = 14: hp = hp + a: maxhp = maxhp + a: mana = mana + a: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 8 THEN a = 100: c = 100: b = 15: d = 17: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 9 THEN a = 125: c = 125: b = 20: d = 40: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 10 THEN a = 150: c = 150: b = 25: d = 50: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d


IF q$ = "y" THEN hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 1
IF q$ = "n" GOTO 50
GOTO 19


21 PRINT "out of mana!"
GOTO 1


22 INPUT "Try again? (y,n)"; s$
IF s$ = "y" THEN hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 1
IF s$ = "n" GOTO 50





40 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
mana = mana + num
SLEEP 1
CLS
manapot = manapot - 1
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF c > d THEN c = d
GOTO 6
NEXT
LOOP





50 END
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by therealbuba Mon Nov 03, 2008 4:04 pm

Thats very good.

You taking classes or is it something you enjoy and want to pursue ?
therealbuba
therealbuba
Admin
Admin

Number of posts : 277
Age : 35
Location : Canada
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue0 / 1000 / 100Qbasic Right_bar_bleue

Registration date : 2008-07-24

Back to top Go down

Qbasic Empty Re: Qbasic

Post by therealbuba Mon Nov 03, 2008 4:05 pm

How can i test this out on my comp?
therealbuba
therealbuba
Admin
Admin

Number of posts : 277
Age : 35
Location : Canada
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue0 / 1000 / 100Qbasic Right_bar_bleue

Registration date : 2008-07-24

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Mon Nov 03, 2008 4:58 pm

copy this into a text doc and save as (something).bas
download any Qbasic scripting device, and click file, open, then open (something).bas
I learned about Q in my electronics class, and ever since I can't get enough. XD
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Tue Nov 04, 2008 4:08 pm

UPDATE!

I have now implemented randomized battles, and a keypress battle menu!

Code:
SCREEN 13
xval = 100: yval = 100
CLS
INPUT "what is your name"; name$
SLEEP 1
CLS

sword = 0
shield = 0
manapot = 2
ammy = 0
armor = 0
H = 0
I = 0
j = 0
k = 0
l = 0
m = 0
a = 0
b = 0
c = 0
d = 0
xp = 0

maxexp = 100
lvl = 0
arch = 100
cast = 100
cash = 100
hp = 100
maxhp = 100
hpb = 100
maxhpb = 100
manab = 100
nameb$ = "enemy"
mana = 100
manamax = 100
x = 1
y = 20

1 gotobattle = 0
DO
RANDOMIZE TIMER
FOR count = 1 TO 100
LET num = RND
LET num = INT(100 * num)

key$ = INKEY$
CIRCLE (xval, yval), 7
IF key$ = "w" AND yval > 10 THEN CLS : yval = yval - 1: IF num = 10 GOTO 2
IF key$ = "a" AND xval > 10 THEN CLS : xval = xval - 1: IF num = 10 GOTO 2
IF key$ = "s" AND yval < 190 THEN CLS : yval = yval + 1: IF num = 10 GOTO 2
IF key$ = "d" AND xval < 310 THEN CLS : xval = xval + 1: IF num = 10 GOTO 2
NEXT
LOOP


2
PRINT "incoming battle!(press r to continue)"
DO
key$ = INKEY$
IF key$ = "r" THEN GOTO 250
LOOP


250 SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab




PRINT ""
PRINT ""
PRINT "1.attack"
PRINT "2.heal"
PRINT "3.potion"
DO
key$ = INKEY$
IF key$ = "1" THEN GOTO 3
IF key$ = "2" THEN IF mana > 0 THEN GOTO 4
IF key$ = "2" THEN IF mana = 0 GOTO 21
IF key$ = "3" THEN IF manapot > 0 GOTO 40
LOOP

3 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hpb = hpb - num
SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 4
PRINT "-"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hpb <= 0 GOTO 9
GOTO 7
NEXT
LOOP

4 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hp = hp + num
SLEEP 1
CLS
IF hp > maxhp THEN hp = maxhp
mana = mana - 10
COLOR 2
PRINT "+"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 7
NEXT
LOOP

5 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp - num
SLEEP 1
CLS
COLOR 4
PRINT "-"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hp <= 0 GOTO 8
GOTO 250
NEXT
LOOP

6 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb + num
SLEEP 1
CLS
manab = manab - 10
IF hpb > 100 THEN hpb = 100
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 2
PRINT "+"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 250
NEXT
LOOP

7 DO
RANDOMIZE TIMER
FOR count = 1 TO 2
LET num = RND
LET num = INT(2 * num) + 1
IF manab = 0 GOTO 5
IF hpb = 100 GOTO 5
IF hpb < 10 GOTO 6
IF num = 1 GOTO 6
IF num = 2 GOTO 5

NEXT
LOOP
8 PRINT "you lose!"
GOTO 22



9 PRINT "YOU WIN!"
cash = cash + 500
PRINT "You now have $"; cash
IF lvl < 10 THEN xp = xp + 100
PRINT "EXP:"; xp; "/"; maxexp
IF xp >= maxexp THEN IF lvl < 10 THEN lvl = lvl + 1: PRINT "LEVEL UP!": xp = xp - maxexp: maxexp = maxexp + 100


PRINT xp
SLEEP
CLS


10 PRINT "Welcome to the store"
SLEEP
CLS
IF value = 0 THEN PRINT "would you like to buy anything? (Y,N)"
IF value = 1 THEN PRINT "would you like to buy anything else? (Y,N)"
INPUT b$
IF b$ = "n" THEN GOTO 19
SLEEP 1
CLS

IF b$ = "y" GOTO 20
GOTO 10
20 PRINT "here is our inventory:(to exit input exit)"
PRINT "1.manapotion $20  2.Sword  $1000  3.Shield $1000"
PRINT "4.Armor $3000  5.Magic Ammulet $3000 6. HAX! $100000"
PRINT "YOUR CASH: $"; cash
INPUT c$

IF c$ = "1" THEN IF cash >= 20 THEN manapot = manapot + 1: cash = cash - 20

IF c$ = "2" THEN IF cash >= 1000 THEN sword = 1: cash = cash - 1000

IF c$ = "3" THEN IF cash >= 1000 THEN shield = 1: cash = cash - 1000

IF c$ = "4" THEN IF cash >= 3000 THEN armor = 1: cash = cash - 3000

IF c$ = "5" THEN IF cash >= 3000 THEN ammy = 1: cash = cash - 3000

IF c$ = "6" THEN IF cash >= 100000 THEN hax = 1: cash = cash - 100000

IF c$ = "exit" GOTO 19

IF sword = 1 THEN S = 20: r = 50: x = S + 1 + l: y = r + 20 + m

IF armor = 1 THEN G = 200: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF shield = 1 THEN H = 100: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF ammy = 1 THEN k = 200: mana = 100 + k + j: manamax = 100 + k + j

IF hax = 1 THEN I = 10000: hp = 100 + G + I + H: maxhp = 100 + G + I + H: j = 10000: mana = 100 + k + j: l = 20000: x = S + 1 + l: m = 50000: y = r + 20 + m

PRINT "you bought #"; c$
value = 1
SLEEP 1
GOTO 10


19
value = 0

mana = 100 + k + j
manamax = 100 + k + j
hp = 100 + G + I + H
maxhp = 100 + G + I + H
x = S + 1 + l
y = r + 20 + m

IF lvl = 1 THEN a = 5: c = 5: b = 2: d = 3: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 2 THEN a = 7: c = 7: b = 3: d = 4: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 3 THEN a = 10: c = 10: b = 5: d = 6: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b:  y = y + d

IF lvl = 4 THEN a = 15: c = 15: b = 7: d = 8: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 5 THEN a = 20: c = 20: b = 9: d = 10: hp = hp + a: maxhp = maxhp + a: manamax = manamax + c: mana = mana + c: x = x + b: y = y + d

IF lvl = 6 THEN a = 50: c = 50: b = 11: d = 12: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 7 THEN a = 75: c = 75: b = 13: d = 14: hp = hp + a: maxhp = maxhp + a: mana = mana + a: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 8 THEN a = 100: c = 100: b = 15: d = 17: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 9 THEN a = 125: c = 125: b = 20: d = 40: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 10 THEN a = 150: c = 150: b = 25: d = 50: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d


hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 1

21 PRINT "out of mana!"
GOTO 250


22 INPUT "Try again? (y,n)"; S$
IF S$ = "y" THEN hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 2
IF S$ = "n" GOTO 50





40 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
mana = mana + num
SLEEP 1
CLS
manapot = manapot - 1
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF c > d THEN c = d
GOTO 6
NEXT
LOOP





50 END


Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by therealbuba Tue Nov 04, 2008 8:21 pm

thx ill check it out.
therealbuba
therealbuba
Admin
Admin

Number of posts : 277
Age : 35
Location : Canada
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue0 / 1000 / 100Qbasic Right_bar_bleue

Registration date : 2008-07-24

Back to top Go down

Qbasic Empty Re: Qbasic

Post by admin Wed Nov 05, 2008 7:27 am

Nice, I am accutally writing a program fro computer bay rite now with Qbasic Very Happy
admin
admin
Admin
Admin

Number of posts : 228
Age : 37
Location : Work
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-20

http://www.thecomputerbay.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Wed Nov 05, 2008 1:46 pm

kewlies, what's it gunna do?

also, I'm going to implement a "store" character into the game so that you can talk to him to access the store instead of having to win battles, and I will change the "input" commands to "inkey$" commands soon =D
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by therealbuba Wed Nov 05, 2008 2:35 pm

You should definitely publish your finished product and make 12 year olds pay an overpriced sum to play your game Razz.
therealbuba
therealbuba
Admin
Admin

Number of posts : 277
Age : 35
Location : Canada
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue0 / 1000 / 100Qbasic Right_bar_bleue

Registration date : 2008-07-24

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Sun Nov 09, 2008 1:03 pm

Make an arcade, and charge 50 cents per play (after you die you have to put in another 50 cents) XD




UPDATE: I've added a store owner, and a collision script with the store owner (press R to talk to him!)


Code:
SCREEN 13
xval = 100: yval = 100
CLS
PRINT x
INPUT "what is your name"; name$
SLEEP 1
CLS

sword = 0
Shield = 0
manapot = 2
ammy = 0
armor = 0
H = 0
I = 0
j = 0
k = 0
l = 0
m = 0
a = 0
b = 0
c = 0
d = 0
xp = 0

maxexp = 100
lvl = 0
arch = 100
cast = 100
cash = 100
hp = 100
maxhp = 100
hpb = 100
maxhpb = 100
manab = 100
nameb$ = "enemy"
mana = 100
manamax = 100
x = 1
y = 20

1 gotobattle = 0
DO
RANDOMIZE TIMER
FOR count = 1 TO 100
LET num = RND
LET num = INT(100 * num)

key$ = INKEY$
CIRCLE (xval, yval), 7
CIRCLE (150, 20), 7
LET d = SQR((xval - 150) ^ 2 + (yval - 20) ^ 2)
IF key$ = "r" AND d <= 25 GOTO 10
IF key$ = "w" AND yval > 10 THEN CLS : yval = yval - 1: IF num = 10 GOTO 2
IF key$ = "a" AND xval > 10 THEN CLS : xval = xval - 1: IF num = 10 GOTO 2
IF key$ = "s" AND yval < 190 THEN CLS : yval = yval + 1: IF num = 10 GOTO 2
IF key$ = "d" AND xval < 310 THEN CLS : xval = xval + 1: IF num = 10 GOTO 2
IF d < 14 AND xval > 150 THEN CLS : xval = xval + 1
IF d < 14 AND xval < 150 THEN CLS : xval = xval - 1
IF d < 14 AND yval > 20 THEN CLS : yval = yval + 1
IF d < 14 AND yval < 20 THEN CLS : yval = yval - 1
NEXT
LOOP


2
PRINT "incoming battle!(press r to continue)"
DO
key$ = INKEY$
IF key$ = "r" THEN GOTO 250
LOOP


250 SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab




PRINT ""
PRINT ""
PRINT "1.attack"
PRINT "2.heal"
PRINT "3.potion"
DO
key$ = INKEY$
IF key$ = "1" THEN GOTO 3
IF key$ = "2" THEN IF mana > 0 THEN GOTO 4
IF key$ = "2" THEN IF mana = 0 GOTO 21
IF key$ = "3" THEN IF manapot > 0 GOTO 40
IF key$ = "4" THEN hpb = 0
LOOP

3 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hpb = hpb - num
SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 4
PRINT "-"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hpb <= 0 GOTO 9
GOTO 7
NEXT
LOOP

4 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hp = hp + num
SLEEP 1
CLS
IF hp > maxhp THEN hp = maxhp
mana = mana - 10
COLOR 2
PRINT "+"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 7
NEXT
LOOP

5 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp - num
SLEEP 1
CLS
COLOR 4
PRINT "-"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hp <= 0 GOTO 8
GOTO 250
NEXT
LOOP

6 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb + num
SLEEP 1
CLS
manab = manab - 10
IF hpb > 100 THEN hpb = 100
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 2
PRINT "+"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 250
NEXT
LOOP

7 DO
RANDOMIZE TIMER
FOR count = 1 TO 2
LET num = RND
LET num = INT(2 * num) + 1
IF manab = 0 GOTO 5
IF hpb = 100 GOTO 5
IF hpb < 10 GOTO 6
IF num = 1 GOTO 6
IF num = 2 GOTO 5

NEXT
LOOP
8 PRINT "you lose!"
GOTO 22



9 PRINT "YOU WIN!"
cash = cash + 500
PRINT "You now have $"; cash
IF lvl < 10 THEN xp = xp + 100
PRINT "EXP:"; xp; "/"; maxexp
IF xp >= maxexp THEN IF lvl < 10 THEN lvl = lvl + 1: PRINT "LEVEL UP!": xp = xp - maxexp: maxexp = maxexp + 100
SLEEP
CLS
GOTO 19

10 PRINT "Welcome to the store"
SLEEP
CLS
IF value = 0 THEN PRINT "would you like to buy anything? (Y,N)"
IF value = 1 THEN PRINT "would you like to buy anything else? (Y,N)"
INPUT b$
IF b$ = "n" THEN GOTO 19
SLEEP 1
CLS

IF b$ = "y" GOTO 20
GOTO 10
20 PRINT "here is our inventory:(to exit input exit)"
PRINT "1.manapotion    $20  2.Sword  $1000  "
PRINT "3.Shield        $1000 4.Armor  $3000"
PRINT "5.Magic Ammulet $3000 6. HAX!  $100000"
PRINT "YOUR CASH: $"; cash
INPUT c$

IF c$ = "1" THEN IF cash >= 20 THEN manapot = manapot + 1: cash = cash - 20

IF c$ = "2" THEN IF cash >= 1000 THEN sword = 1: cash = cash - 1000

IF c$ = "3" THEN IF cash >= 1000 THEN Shield = 1: cash = cash - 1000

IF c$ = "4" THEN IF cash >= 3000 THEN armor = 1: cash = cash - 3000

IF c$ = "5" THEN IF cash >= 3000 THEN ammy = 1: cash = cash - 3000

IF c$ = "6" THEN IF cash >= 100000 THEN hax = 1: cash = cash - 100000

IF c$ = "exit" GOTO 19

IF sword = 1 THEN s = 20: r = 50: x = s + 1 + l: y = r + 20 + m

IF armor = 1 THEN G = 200: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF Shield = 1 THEN H = 100: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF ammy = 1 THEN k = 200: mana = 100 + k + j: manamax = 100 + k + j

IF hax = 1 THEN I = 10000: hp = 100 + G + I + H: maxhp = 100 + G + I + H: j = 10000: mana = 100 + k + j: l = 20000: x = s + 1 + l: m = 50000: y = r + 20 + m

PRINT "you bought #"; c$
value = 1
SLEEP 1
GOTO 10


19
value = 0

mana = 100 + k + j
manamax = 100 + k + j
hp = 100 + G + I + H
maxhp = 100 + G + I + H
x = s + 1 + l
y = r + 20 + m

IF lvl = 1 THEN a = 5: c = 5: b = 2: d = 3: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 2 THEN a = 7: c = 7: b = 3: d = 4: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 3 THEN a = 10: c = 10: b = 5: d = 6: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b:  y = y + d

IF lvl = 4 THEN a = 15: c = 15: b = 7: d = 8: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 5 THEN a = 20: c = 20: b = 9: d = 10: hp = hp + a: maxhp = maxhp + a: manamax = manamax + c: mana = mana + c: x = x + b: y = y + d

IF lvl = 6 THEN a = 50: c = 50: b = 11: d = 12: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 7 THEN a = 75: c = 75: b = 13: d = 14: hp = hp + a: maxhp = maxhp + a: mana = mana + a: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 8 THEN a = 100: c = 100: b = 15: d = 17: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 9 THEN a = 125: c = 125: b = 20: d = 40: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 10 THEN a = 150: c = 150: b = 25: d = 50: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d


hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 1

21 PRINT "out of mana!"
GOTO 250


22 INPUT "Try again? (y,n)"; s$
IF s$ = "y" THEN hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 2
IF s$ = "n" GOTO 50





40 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
mana = mana + num
SLEEP 1
CLS
manapot = manapot - 1
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF c > d THEN c = d
GOTO 6
NEXT
LOOP





50 END


Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Sun Nov 09, 2008 7:12 pm

I had some extra time, so I threw together another room (with nothing special about it of course...), but in case you haven't figured it out yet, there is a secret cheat on the battle screen that reduces the enemy hp to 0 (this is in here so I can thoroughly test the game of course, and will be removed when I have finished) So, here's the source so far!


Code:
SCREEN 13
xval = 100: yval = 100
CLS
PRINT x
INPUT "what is your name"; name$
SLEEP 1
CLS

sword = 0
Shield = 0
manapot = 2
ammy = 0
armor = 0
H = 0
I = 0
j = 0
k = 0
l = 0
m = 0
a = 0
b = 0
c = 0
d = 0
xp = 0

maxexp = 100
lvl = 0
arch = 100
cast = 100
cash = 100
hp = 100
maxhp = 100
hpb = 100
maxhpb = 100
manab = 100
nameb$ = "enemy"
mana = 100
manamax = 100
x = 1
y = 20

1 gotobattle = 0
DO
RANDOMIZE TIMER
FOR count = 1 TO 100
LET num = RND
LET num = INT(100 * num)

key$ = INKEY$
CIRCLE (xval, yval), 7
CIRCLE (150, 20), 7
LINE (200, 197)-(3, 197)
LINE (317, 197)-(225, 197)
LINE (318, 3)-(318, 197)
LINE (3, 197)-(3, 3)
LINE (318, 3)-(3, 3)
LET room = 0
LET da = SQR((xval - 212) ^ 2 + (yval - 197) ^ 2)
LET d = SQR((xval - 150) ^ 2 + (yval - 20) ^ 2)
IF key$ = "r" AND da <= 25 THEN CLS : GOTO 39
IF key$ = "r" AND d <= 25 THEN GOTO 10
IF key$ = "w" AND yval > 10 THEN CLS : yval = yval - 1: IF num = 10 GOTO 2
IF key$ = "a" AND xval > 10 THEN CLS : xval = xval - 1: IF num = 10 GOTO 2
IF key$ = "s" AND yval < 190 THEN CLS : yval = yval + 1: IF num = 10 GOTO 2
IF key$ = "d" AND xval < 310 THEN CLS : xval = xval + 1: IF num = 10 GOTO 2
IF d < 14 AND xval > 150 THEN CLS : xval = xval + 1
IF d < 14 AND xval < 150 THEN CLS : xval = xval - 1
IF d < 14 AND yval > 20 THEN CLS : yval = yval + 1
IF d < 14 AND yval < 20 THEN CLS : yval = yval - 1
NEXT
LOOP


2
PRINT "incoming battle!(press r to continue)"
DO
key$ = INKEY$
IF key$ = "r" THEN GOTO 250
LOOP


250 SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab




PRINT ""
PRINT ""
PRINT "1.attack"
PRINT "2.heal"
PRINT "3.potion"
DO
key$ = INKEY$
IF key$ = "1" THEN GOTO 3
IF key$ = "2" THEN IF mana > 0 THEN GOTO 4
IF key$ = "2" THEN IF mana = 0 GOTO 21
IF key$ = "3" THEN IF manapot > 0 GOTO 40
IF key$ = "4" THEN hpb = 0
LOOP

3 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hpb = hpb - num
SLEEP 1
CLS
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 4
PRINT "-"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hpb <= 0 GOTO 9
GOTO 7
NEXT
LOOP

4 DO
RANDOMIZE TIMER
FOR count = x TO y
LET num = RND
LET num = INT(y * num) + 1
hp = hp + num
SLEEP 1
CLS
IF hp > maxhp THEN hp = maxhp
mana = mana - 10
COLOR 2
PRINT "+"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 7
NEXT
LOOP

5 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hp = hp - num
SLEEP 1
CLS
COLOR 4
PRINT "-"; num
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF hp <= 0 GOTO 8
GOTO 250
NEXT
LOOP

6 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
hpb = hpb + num
SLEEP 1
CLS
manab = manab - 10
IF hpb > 100 THEN hpb = 100
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA:"; mana
PRINT "POTIONS:"; manapot
PRINT ""
COLOR 2
PRINT "+"; num
COLOR 7
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
GOTO 250
NEXT
LOOP

7 DO
RANDOMIZE TIMER
FOR count = 1 TO 2
LET num = RND
LET num = INT(2 * num) + 1
IF manab = 0 GOTO 5
IF hpb = 100 GOTO 5
IF hpb < 10 GOTO 6
IF num = 1 GOTO 6
IF num = 2 GOTO 5

NEXT
LOOP
8 PRINT "you lose!"
GOTO 22



9 PRINT "YOU WIN!"
cash = cash + 500
PRINT "You now have $"; cash
IF lvl < 10 THEN xp = xp + 100
PRINT "EXP:"; xp; "/"; maxexp
IF xp >= maxexp THEN IF lvl < 10 THEN lvl = lvl + 1: PRINT "LEVEL UP!": xp = xp - maxexp: maxexp = maxexp + 100
SLEEP
CLS
GOTO 19

10 PRINT "Welcome to the store"
SLEEP
CLS
IF value = 0 THEN PRINT "would you like to buy anything? (Y,N)"
IF value = 1 THEN PRINT "would you like to buy anything else? (Y,N)"
INPUT b$
IF b$ = "n" THEN GOTO 19
SLEEP 1
CLS

IF b$ = "y" GOTO 20
GOTO 10
20 PRINT "here is our inventory:(to exit input exit)"
PRINT "1.manapotion    $20  2.Sword  $1000  "
PRINT "3.Shield        $1000 4.Armor  $3000"
PRINT "5.Magic Ammulet $3000 6. HAX!  $100000"
PRINT "YOUR CASH: $"; cash
INPUT c$

IF c$ = "1" THEN IF cash >= 20 THEN manapot = manapot + 1: cash = cash - 20

IF c$ = "2" THEN IF cash >= 1000 THEN sword = 1: cash = cash - 1000

IF c$ = "3" THEN IF cash >= 1000 THEN Shield = 1: cash = cash - 1000

IF c$ = "4" THEN IF cash >= 3000 THEN armor = 1: cash = cash - 3000

IF c$ = "5" THEN IF cash >= 3000 THEN ammy = 1: cash = cash - 3000

IF c$ = "6" THEN IF cash >= 100000 THEN hax = 1: cash = cash - 100000

IF c$ = "exit" GOTO 19

IF sword = 1 THEN s = 20: r = 50: x = s + 1 + l: y = r + 20 + m

IF armor = 1 THEN G = 200: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF Shield = 1 THEN H = 100: hp = 100 + G + I + H: maxhp = 100 + G + I + H

IF ammy = 1 THEN k = 200: mana = 100 + k + j: manamax = 100 + k + j

IF hax = 1 THEN I = 10000: hp = 100 + G + I + H: maxhp = 100 + G + I + H: j = 10000: mana = 100 + k + j: l = 20000: x = s + 1 + l: m = 50000: y = r + 20 + m

PRINT "you bought #"; c$
value = 1
SLEEP 1
GOTO 10


19
value = 0

mana = 100 + k + j
manamax = 100 + k + j
hp = 100 + G + I + H
maxhp = 100 + G + I + H
x = s + 1 + l
y = r + 20 + m

IF lvl = 1 THEN a = 5: c = 5: b = 2: d = 3: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 2 THEN a = 7: c = 7: b = 3: d = 4: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 3 THEN a = 10: c = 10: b = 5: d = 6: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b:  y = y + d

IF lvl = 4 THEN a = 15: c = 15: b = 7: d = 8: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 5 THEN a = 20: c = 20: b = 9: d = 10: hp = hp + a: maxhp = maxhp + a: manamax = manamax + c: mana = mana + c: x = x + b: y = y + d

IF lvl = 6 THEN a = 50: c = 50: b = 11: d = 12: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 7 THEN a = 75: c = 75: b = 13: d = 14: hp = hp + a: maxhp = maxhp + a: mana = mana + a: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 8 THEN a = 100: c = 100: b = 15: d = 17: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d

IF lvl = 9 THEN a = 125: c = 125: b = 20: d = 40: hp = hp + a: maxhp = maxhp + a: mana = mana + c: maxmana = maxmana + c: x = x + b: y = y + d

IF lvl = 10 THEN a = 150: c = 150: b = 25: d = 50: hp = hp + a: maxhp = maxhp + a: mana = mana + c: manamax = manamax + c: x = x + b: y = y + d


hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100
IF room = 0 GOTO 1
IF room = 1 GOTO 41
21 PRINT "out of mana!"
GOTO 250


22 INPUT "Try again? (y,n)"; s$
IF s$ = "y" THEN hp = maxhp: hpb = maxhpb: mana = manamax: manab = 100: GOTO 2
IF s$ = "n" GOTO 50





40 DO
RANDOMIZE TIMER
FOR count = 1 TO 20
LET num = RND
LET num = INT(20 * num) + 1
mana = mana + num
SLEEP 1
CLS
manapot = manapot - 1
COLOR 7
PRINT name$
PRINT "LEVEL:"; lvl
PRINT "HP:"; hp; "/"; maxhp
PRINT "MANA"; mana
PRINT "POTIONS:"; manapot
PRINT ""
PRINT nameb$
PRINT "HP:"; hpb; "/"; maxhpb
PRINT "MANA:"; manab
IF c > d THEN c = d
GOTO 6
NEXT
LOOP


39 PRINT "you exit the store"
xvala = 212
yvala = 12
41 DO
RANDOMIZE TIMER
FOR count = 1 TO 100
LET num = RND
LET num = INT(100 * num)
LET room = 1
LET db = SQR((xvala - 212) ^ 2 + (yvala - 3) ^ 2)
key$ = INKEY$
CIRCLE (xvala, yvala), 7
LINE (317, 197)-(3, 197)
LINE (318, 3)-(318, 197)
LINE (3, 197)-(3, 3)
LINE (200, 3)-(3, 3)
LINE (318, 3)-(225, 3)
IF key$ = "w" AND yvala > 10 THEN CLS : yvala = yvala - 1: IF num = 10 GOTO 2
IF key$ = "a" AND xvala > 10 THEN CLS : xvala = xvala - 1: IF num = 10 GOTO 2
IF key$ = "s" AND yvala < 190 THEN CLS : yvala = yvala + 1: IF num = 10 GOTO 2
IF key$ = "d" AND xvala < 310 THEN CLS : xvala = xvala + 1: IF num = 10 GOTO 2
IF key$ = "r" AND db < 15 THEN CLS : GOTO 1
NEXT
LOOP


50 END
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by therealbuba Mon Nov 10, 2008 3:29 pm

Awesome... but somehow this reminds me of that shitty game runescape, filled with whiny 12 year olds. I know the language is different qbasic vs java, but same premise Razz
therealbuba
therealbuba
Admin
Admin

Number of posts : 277
Age : 35
Location : Canada
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue0 / 1000 / 100Qbasic Right_bar_bleue

Registration date : 2008-07-24

Back to top Go down

Qbasic Empty Re: Qbasic

Post by admin Mon Nov 10, 2008 5:02 pm

therealbuba wrote:Awesome... but somehow this reminds me of that shitty game runescape, filled with whiny 12 year olds. I know the language is different qbasic vs java, but same premise Razz

Lol...

Dehdesh, perhaps you wanna help me make the program if you interesting just say it....
admin
admin
Admin
Admin

Number of posts : 228
Age : 37
Location : Work
Operating System : Windows Vista
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-20

http://www.thecomputerbay.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Mon Nov 10, 2008 9:27 pm

It's more like a final fantasy than a run escape.

(run escape is point and click, and has more of a real time based fighting system, although it seems more like a turn based disguised as a real time, plus you don't have annoying random battles XD)

I plan on dropping in classes, maybe a few more items, some funky new enemies, and every now and again, some KoL, XKCD, irony, and inside humor.
What I need to do is find out how to create a save and load script...

Although, I can see how run escape reminds you of the shell of a game XD




What kind of program are you making, and how may I help?
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Dehdesh Wed Nov 12, 2008 6:46 pm

Um, hello? Someone quench my thirst of curiosity please.

Anyhow, I think I am going to throw in random names for the enemy as per room pretty soon.
Dehdesh
Dehdesh
V.I.P Member
V.I.P Member

Number of posts : 152
Age : 33
Location : right here
Warning Level :
Qbasic Left_bar_bleue1 / 1001 / 100Qbasic Right_bar_bleue

Gender : Qbasic 2nu6n20jpg
Registration date : 2008-07-30

http://dehdesh.vndv.com

Back to top Go down

Qbasic Empty Re: Qbasic

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum