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 Discussion / how to use graphics from data arrays

Author
Message
Sargh
17
Years of Service
User Offline
Joined: 9th Feb 2008
Location:
Posted: 10th Jul 2008 05:25
Hey guys, I am trying to create a first person RPG (SIMPLE at that!)
I been theorizing of how to make a map from a black Win BMP and a brick texture Win BMP. THIS IS NOT A 3D PROJECT!!!
It is just an idea I had for an Ye Olde Wizardry game idea. take for instance (some codes will not show up, so go with the idea I have right now)

dim dungeon(5,5)
data 0,0,0,0,0
data 0,1,1,1,0
data 0,1,1,1,0
data 0,1,1,1,0
data 0,0,0,0,0

1 is a walkable scene
0 is a wall

now I wonder, how do I get the proceeder to allow me to move around that room? I don't want fancy graphics ***yet***

I appreciate any help from anyone

Jeremy Harden
Basement Interactive
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Jul 2008 10:07
You could write a couple for-next loops to read all the data into the array like so:

That should read all the data into the array, which you can then check easily with:

Obviously, do your own thing for DON'T MOVE.

Now, here is what I think the logic should be for the motion (don't feel like doing all the code, but it should get you started):

1. Take input from player
2. Check to see if motion in that direction is allowed (compare it with the array)
3. If you can move there, then move there. If you can't tell them they can't.

Rinse and repeat

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
sinisterstuf
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 12th Jul 2008 11:57
did you know:
ye (as in "ye Olde Wizardry game") doesn't mean you or your but the.
The y in the ye actualy originates from the letter thorn: þ ,which makes a 'th' sound which was common in written english. But when typewriters were invented they were produced mainly in places like Germany and Italy where they had no such letter. People then started typing þ as y because it is the closest homoglyph to it's handwritten form, which actually does look a bit like a y that is joined at the top. From there this word þe became confused with ye, the nominative case for you. So there you have it!

but concerning your question. BN2 productions is right

Well... No, my name IS actually 'sinisterstuf' not 'Sinister Stuff', a misspelling resulting from the former having too many characters with no spaces in between

thanks CattleRustler!

Login to post a reply

Server time is: 2025-06-07 06:35:26
Your offset time is: 2025-06-07 06:35:26