Can anyone make this game any better because at the moment i am stuck. I have been doing it for fun and with my friend - cue Lewis Houghton. It is below what we have done so far:

DECLARE SUB Battle ()

ON ERROR GOTO errline

DIM guy(50), guysh(50)
DIM sprite1(50), sprite2(50), sprite3(50)
DIM map1(21, 15), enemy(100)
SCREEN 13

guyname$ = "Bob the Brave"
guyhealth = 100
guymaxhealth = 100
guydamage = 10
guybasedamage = 3
guylevel = 1
guyexp = 0
guyweapon$ = "Dagger"
guydefense = 10
guybasedefence = 3
guyarmour$ = "Clothing"

enemyname$ = "Blob"
enemyhealth = 25
enemymaxhealth = 25
enemydamage = 7
enemybasedamage = 1
enemyweapon$ = "Itself"
enemydefense = 5
enemybasedefence = 1
enemyarmour$ = "Slime"
experiencegive = 38

level2exp = 100
level3exp = 175
level4exp = 275
level5exp = 400
level6exp = 550
level7exp = 725
level8exp = 925
level9exp = 1150
level10exp = 1400

guyX = 20
guyY = 8

xe = 160
ye = 100
re = 8

FOR y = 1 TO 13
FOR x = 1 TO 15

READ clr
PSET (x, y), clr

NEXT: NEXT
GET (1, 1)-(15, 13), sprite1

FOR y = 1 TO 13
FOR x = 1 TO 15

READ clr
PSET (x, y), clr

NEXT: NEXT
GET (1, 1)-(15, 13), sprite2

FOR y = 1 TO 13
FOR x = 1 TO 15

READ clr
PSET (x, y), clr

NEXT: NEXT
GET (1, 1)-(15, 13), sprite3

CLS
FOR y = 1 TO 15
FOR x = 1 TO 21
READ map1(x, y)
NEXT: NEXT


FOR y = 1 TO 13
FOR x = 1 TO 15

READ clr
PSET (x, y), clr

NEXT: NEXT
GET (1, 1)-(15, 13), guy

FOR y = 1 TO 13
FOR x = 1 TO 15

READ clr
PSET (x, y), clr

NEXT: NEXT
GET (1, 1)-(15, 13), guysh
CLS

LINE (0, 0)-(18, 16), 10, BF

CIRCLE (9, 8), re, 4
PAINT (7, 7), 4, 4
GET (0, 0)-(18, 16), enemy

CLS

FOR y = 1 TO 15
FOR x = 1 TO 21

IF map1(x, y) = 1 THEN PUT (x * 15 - 15, y * 13 - 13), sprite1
IF map1(x, y) = 2 THEN PUT (x * 15 - 15, y * 13 - 13), sprite2
IF map1(x, y) = 3 THEN PUT (x * 15 - 15, y * 13 - 13), sprite3
NEXT: NEXT

PUT (guyX * 15 - 15, guyY * 13 - 13), guysh, AND
PUT (guyX * 15 - 15, guyY * 13 - 13), guy, OR
start:
DO
press$ = INKEY$

IF press$ = CHR$(0) + CHR$(75) AND map1(guyX - 1, guyY) <> 3 THEN
IF guyX > 1 THEN guyX = guyX - 1
END IF

IF press$ = CHR$(0) + CHR$(77) AND map1(guyX + 1, guyY) <> 3 THEN
IF guyX < 20 THEN guyX = guyX + 1
END IF

IF press$ = CHR$(0) + CHR$(72) AND map1(guyX, guyY - 1) <> 3 THEN
IF guyY > 1 THEN guyY = guyY - 1
END IF

IF press$ = CHR$(0) + CHR$(80) AND map1(guyX, guyY + 1) <> 3 THEN
IF guyY < 14 THEN guyY = guyY + 1
END IF

IF oldguyx <> guyX OR oldguyy <> guyY THEN
oldguyx = guyX
oldguyy = guyY
FOR y = 1 TO 15
FOR x = 1 TO 21

IF map1(x, y) = 1 THEN PUT (x * 15 - 15, y * 13 - 13), sprite1, PSET
IF map1(x, y) = 2 THEN PUT (x * 15 - 15, y * 13 - 13), sprite2, PSET
IF map1(x, y) = 3 THEN PUT (x * 15 - 15, y * 13 - 13), sprite3, PSET
NEXT: NEXT

PUT (guyX * 15 - 15, guyY * 13 - 13), guysh, AND
PUT (guyX * 15 - 15, guyY * 13 - 13), guy, OR

END IF

a% = 0
RANDOMIZE TIMER
a% = INT(RND * 10) + 1
IF a% = 1 THEN xe = xe + 1: IF xe >= 282 THEN xe = xe - 1
IF a% = 2 THEN xe = xe - 1: IF xe <= 14 THEN xe = xe + 1
IF a% = 3 THEN ye = ye + 1: IF ye >= 166 THEN ye = ye - 1
IF a% = 4 THEN ye = ye - 1: IF ye <= 12 THEN ye = ye + 1

PUT (xe, ye), enemy, PSET

a = RND * 200 + 1000
SOUND a, .1

IF xe > (guyX * 15) - 15 AND xe < (guyX * 15) + re AND ye > (guyY * 13) - 26 AND ye < (guyY * 13) + re THEN Battle

LOOP UNTIL press$ = CHR$(27)
errline:
RESUME NEXT

DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
DATA 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10


'This (considering its the north pole) will be the snow...

DATA 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
DATA 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
DATA 15,15,15,29,29,29,15,15,15,15,15,15,15,15,15
DATA 15,15,29,07,07,07,15,15,15,29,29,15,15,15,15
DATA 15,15,29,07,15,15,15,15,29,07,07,15,15,15,15
DATA 15,29,07,15,15,15,15,29,07,15,15,15,15,15,15
DATA 15,29,15,15,15,15,15,29,07,15,15,15,15,15,15
DATA 15,15,15,15,15,15,29,29,07,15,15,15,15,15,15
DATA 15,15,15,15,15,29,07,07,15,15,15,15,15,15,15
DATA 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
DATA 15,15,15,15,15,15,15,15,15,29,07,15,15,15,15
DATA 15,15,15,15,15,15,15,15,15,15,29,07,07,07,29
DATA 15,15,15,15,15,15,15,15,15,15,15,29,29,29,15

'For the third, floor tiles...

DATA 00,00,00,00,00,00,00,02,00,00,00,00,00,00,00
DATA 00,00,00,00,00,02,02,02,02,00,00,00,00,00,00
DATA 00,00,00,00,02,02,02,02,02,02,00,00,00,00,00
DATA 00,00,00,00,00,02,02,02,02,02,00,00,00,00,00
DATA 00,00,00,00,00,00,02,02,02,02,00,00,00,00,00
DATA 00,00,00,00,00,00,00,02,02,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,06,06,00,00,00,00,00,00
DATA 00,00,00,00,00,00,06,06,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,06,06,06,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,06,06,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,06,06,00,00,00,00,00,00
DATA 00,00,00,00,00,00,06,06,06,00,00,00,00,00,00
DATA 00,00,00,00,00,06,06,06,06,06,00,00,00,00,00

'the map
DATA 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
DATA 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3


'guy
DATA 00,00,00,00,00,00,00,06,06,06,00,00,00,00,00
DATA 00,00,00,00,00,00,06,06,06,06,06,00,00,00,00
DATA 00,00,00,00,00,02,06,06,06,06,06,02,00,00,00
DATA 00,00,00,00,00,02,02,02,02,02,02,02,00,00,00
DATA 00,00,00,00,00,00,66,00,66,00,66,00,00,00,00
DATA 00,00,00,00,00,00,66,66,66,66,66,00,00,00,00
DATA 00,00,00,00,00,00,00,66,00,66,00,00,00,00,00
DATA 00,00,00,00,00,00,01,01,01,01,01,00,00,00,00
DATA 00,00,00,00,00,01,00,01,01,01,00,01,00,00,00
DATA 00,00,00,00,00,01,00,01,01,01,00,01,00,00,00
DATA 00,00,00,00,00,66,00,01,01,01,00,66,00,00,00
DATA 00,00,00,00,10,00,00,07,00,07,00,00,10,00,00
DATA 00,00,00,00,00,06,06,06,00,06,06,06,00,00,00

'This is the mask for the sprite...

DATA 255,255,255,255,255,255,10,0,0,0,255,255,255,255,255
DATA 255,255,255,255,255,10,0,0,0,0,0,255,255,255,255
DATA 255,255,255,10,10,66,0,0,0,0,0,66,255,255,255
DATA 255,255,15,255,255,66,66,66,66,66,66,66,255,255,255
DATA 255,255,255,255,255,255,66,00,66,00,66,255,255,255,255
DATA 255,255,255,255,255,255,66,66,66,66,66,255,255,255,255
DATA 255,255,255,255,255,255,255,66,00,66,255,255,255,255,255
DATA 255,255,255,255,255,255,02,02,02,02,02,255,255,255,255
DATA 255,255,255,255,255,02,255,02,02,02,255,02,255,255,255
DATA 255,255,255,255,255,02,255,02,02,02,255,02,255,255,255
DATA 255,255,255,255,255,66,255,02,02,02,255,66,255,255,255
DATA 255,255,255,255,02,255,255,07,255,07,255,255,02,255,255
DATA 255,255,255,255,255,02,02,02,255,02,02,02,255,255,255


SUB Battle
CLS ' This battle mode is text-mode-only. For the graphical battle mode then
    ' download the full version off: [url]www.sonictomato.com[/url]. Thanks For Playing!

LOCATE 22, 2: PRINT "Attack"
LOCATE 24, 2: PRINT "Weaponry"
LOCATE 21, 20: PRINT "Special"
LOCATE 23, 20: PRINT "Run!"
attackmenuoption = 1
DO: Press2$ = INKEY$
IF attackmenuoption = 1 THEN LINE (1, 158)-(75, 168), 7, B: LINE (1, 174)-(75, 185), 0, B: LINE (151, 158)-(221, 168), 0, B: LINE (151, 174)-(221, 185), 0, B
IF attackmenuoption = 2 THEN LINE (1, 174)-(75, 185), 7, B: LINE (1, 158)-(75, 168), 0, B: LINE (151, 158)-(221, 168), 0, B: LINE (151, 174)-(221, 185), 0, B
IF attackmenuoption = 3 THEN LINE (151, 158)-(221, 168), 7, B: LINE (1, 158)-(75, 168), 0, B: LINE (1, 174)-(75, 185), 0, B: LINE (151, 174)-(221, 185), 0, B
IF attackmenuoption = 4 THEN LINE (151, 174)-(221, 185), 7, B: LINE (1, 158)-(75, 168), 0, B: LINE (1, 174)-(75, 185), 0, B: LINE (151, 158)-(221, 168), 0, B

IF Press2$ = "w" THEN attackmenuoption = attackmenuoption - 1
IF Press2$ = "s" THEN attackmenuoption = attackmenuoption + 1
IF Press2$ = "a" THEN attackmenuoption = attackmenuoption - 2
IF Press2$ = "d" THEN attackmenuoption = attackmenuoption + 2

IF attackmenuoption >= 5 THEN attackmenuoption = 1
IF attackmenuoption <= 0 THEN attackmenuoption = 4

LOOP UNTIL Press2$ = CHR$(27)
IF xe < 161 THEN xe = xe + 10
IF xe > 160 THEN xe = xe - 10
END SUB

:eek:

This all took me about a weekend of changing stuff. Also you may find it is similar to another guy's code - Vic Luce? Just getting used to sprites and all that lot. Can't think why :rolleyes:
TP
P.S. View my website with more QBasic stuff @ http://myweb.tiscali.co.uk/fastnet34
Please comment by email to it - thats if you want to.

to make it better you could try loading the data from a file, therefore removing the DATA statements... :)

Do you know how you do that? I hae tried but it doesn't seem to work - i don't know how to read each line of the file...any ideas?
Thanks
TP

dim tmpvar as string

open "c:\somefile.txt" for input as #1
do until eof(1)
line input #1, tmpvar
DATA tmpvar
loop
close #1

This is assuming you have a file called "c:\somefile.txt" with the numbers in them that will be used for the DATA statement.

This article has been dead for over six months. Start a new discussion instead.