Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating my own text world Help
#11
Quote:Well since it is my first time creating this world of mine it's basically all of the above.

Hmm, that was the one I least hoped you'd pick, heh heh,.. Maybe I could write a source of a bare'bones one heavly commented.. :wink: .. to look over or something.. hmm...
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#12
Next issue of QB Express will feature the last chapter of my tuts. I'll be coding the whole thing step to step. Meanwhile, read the two first chapters to know how everything works.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
Quote:That's the wrong way to do it. You get sucky, limited games. Zork, etc. are Interactive Fiction, something way more advanced that a simple bunch of IFs.

Hmmm...I am thinking I like you na_th_an... Big Grin

Ya, GOSUBs are the definent WRONG way, they are ok, but still really crappy like GOTO. If I want to do a SUB I just do a SUB the normal way.

And yes I only had a half a year course too (not even two years ago, and before that I had no knowlege of QB), but you can learn so much on your own (I am already doing my first good game in pure QB, and another in 3D!) or with help here like you are doing now (making mistakes), but mistakes are how you learn so, keep up the good work Liquid Snake. :wink:
i]"But...it was so beautifully done"[/i]
Reply
#14
Smile Okay, a example to look over and learn from... Heh, its my very first time I wrote one, yea! Sorry if it looks like half a raycaster, it works partly like one, just w/o the ray casting... Big Grin

[syntax="qbasic"]SCREEN 13
CLS 'Clear the screen
DIM map(10, 10) 'Create Map Array

' Load Map DATA into array..
' When over given points like map(1, 1) = 4, and map(2, 2) = 3.. esc
FOR y = 1 TO 10
FOR x = 1 TO 10
READ z
IF z = -1 THEN x1 = x: y1 = y: z = 0 ' Find players position.
map(x, y) = z 'Pack all our Map info into array.
NEXT
NEXT

DO ' Start main LOOP
press$ = INKEY$ ' Promt keys
' Display Map on screen..
FOR y = 1 TO 10
FOR x = 1 TO 10
' Diff numers equal diff tiles, and there location is strored in
' Map(x, y).. Just remember LOCATE is backward Y, X..
' We assign color acording to how we want it displayed
' CHR$(219) equals a "Û".. You can just hold Alt and type in 219
' When you there-after release Alt it gives you that character
IF map(x, y) = 0 THEN COLOR 6: LOCATE y, x: PRINT CHR$(219) 'Dirt
IF map(x, y) = 2 THEN COLOR 2: LOCATE y, x: PRINT CHR$(219) 'Grass
IF map(x, y) = 3 THEN COLOR 9: LOCATE y, x: PRINT CHR$(219) 'Water
IF map(x, y) = 4 THEN COLOR 7: LOCATE y, x: PRINT CHR$(219) 'Wall
NEXT
NEXT

IF press$ = CHR$(0) + "H" THEN ' On Keypress Up Arrow...
y1 = y1 - 1 ' Move player Up screen..

' Check for walls or water, both are 3 or greater..
IF map(x1, y1) >= 3 THEN y1 = y1 + 1
ELSEIF press$ = CHR$(0) + "P" THEN
' Move player down, also check, we have a door at the bottom
' We need to stall player sence there is no map info
' You can use this to call a new Map
y1 = y1 + 1: IF y1 > 10 THEN y1 = 10: LOCATE 12, 1: PRINT "Can't Pass! No Map down there!"

' Check for walls or water, both are 3 or greater..
IF map(x1, y1) >= 3 THEN y1 = y1 - 1
ELSEIF press$ = CHR$(0) + "M" THEN
' Move player right, also check, we have a door at the right
' We need to stall player sence there is no map info
' You can use this to call a new Map
x1 = x1 + 1: IF x1 > 10 THEN x1 = 10: LOCATE 12, 1: PRINT "Can't Pass! No Map over there!"

' Check for walls or water, both are 3 or greater..
IF map(x1, y1) >= 3 THEN x1 = x1 - 1
ELSEIF press$ = CHR$(0) + "K" THEN
x1 = x1 - 1 ' Move player left

' Check for walls or water, both are 3 or greater..
IF map(x1, y1) >= 3 THEN x1 = x1 + 1
END IF

' Display player on screen. Make sure you do this after you've
' checked for movement and barriers.. Like above ^^ ^^
LOCATE y1, x1: PRINT CHR$(1)

' Video Buffer
WAIT &H3DA, 8
' Helps Video Buffer
FOR I = 1 TO 1000: NEXT

LOOP UNTIL press$ = CHR$(27)' Loop until KeyPress = Esc

'------------Map!-------------
'[[ Notes ]]
'Notice I put the unpassible DATA ander numbers all higher than 2
'This way I can check for barriers in one line of code for each
'way your alowed to move.. Up, Down, Left, & Right.. so four times.. Big Grin
'Compare to about 8 times if they were random... Look up there where
'I checked for barriers to see what I'm on..

' This can be any number, if you have 8 passible objects, then make every
' thing higher than 8 the unpassible ones.. See where I'm at..

' IF map(x, y) >= 9 THEN ... block player for that direction..

'[[ Map ]]
'[[ Key ]]
'-1 = Player's position
'0 = Dirt
'2 = Grass
'3 = Water
'4 = Wall

DATA 4,4,4,4,4,4,4,4,4,4
DATA 4,3,3,3,3,3,2,4,0,4
DATA 4,2,3,3,3,2,2,4,0,4
DATA 4,2,2,2,2,2,2,4,0,4
DATA 4,0,2,2,2,2,0,4,0,0
DATA 4,0,0,0,0,0,0,0,0,0
DATA 4,0,0,0,-1,0,0,4,0,4
DATA 4,0,4,4,4,4,4,4,0,4
DATA 4,0,0,0,0,0,0,4,0,4
DATA 4,4,4,4,4,0,0,4,4,4[/syntax]

Enjoy!!! :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#15
Nice however I don't like that Can't pass thing, because it doesn't clear when I don't try to do it again, so it PRINTs it once then it will show forever.
i]"But...it was so beautifully done"[/i]
Reply
#16
Rattrapmax, you haven't got it. This guy doesn't want to make a tile game in text mode, but a text adventure game or interactive fiction, which is something quite different.

Get the freakin' game Big Grin

http://www.apeshell.net/downloads/

(seriously, and you'll know what we are talking about Smile)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#17
Quote:Nice however I don't like that Can't pass thing, because it doesn't clear when I don't try to do it again, so it PRINTs it once then it will show forever.

Its a example...

What, you mean, Na_th_an, just a story, no Maps n stuff? I'll look at the game. :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#18
A text game!!! Ahhh!!! You don't know what a text game is?! kidding.... Tongue

lol :lol: I knew it was an example....just joking.
i]"But...it was so beautifully done"[/i]
Reply
#19
Quote:A text game!!! Ahhh!!! You don't know what a text game is?! kidding.... Tongue

lol :lol: I knew it was an example....just joking.

Smile I go by x.t.r.GRAPHICS!!! I never look at any text based game layouts.. so I must no idea between the two. oh well, what was the one I did called, those are the ones I see the most of.. :???:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#20
Quote:Ya, GOSUBs are the definent WRONG way, they are ok, but still really crappy like GOTO. If I want to do a SUB I just do a SUB the normal way.

And yes I only had a half a year course too (not even two years ago, and before that I had no knowlege of QB), but you can learn so much on your own (I am already doing my first good game in pure QB, and another in 3D!) or with help here like you are doing now (making mistakes), but mistakes are how you learn so, keep up the good work Liquid Snake. :wink:

I try. However, not having a computer of my own is a bit of a problem. It's hard to learn if you can't reach the "help" option in qbasic. All these posts I've been sending are on other people's computers...sometimes school computers. Just saying...

Those games you mentioned sound interesting, hope you show us.
There is no easy way of making a 3d game is there?
Not yet Snake! It's not over yet!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)