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.

Newcomers DBPro Corner / quick display question.

Author
Message
Neon Knight
18
Years of Service
User Offline
Joined: 28th Oct 2006
Location:
Posted: 16th Nov 2006 18:47
Right, yeah I'm beginning to get the hang of this spangly-programming language, I just want to know,

How do you locate coordinates on the screen? And any other help on array coordianted would also be helpful.

Say, for example, I was making an ASCII maze game:

################ ##########
####### @ #####
####### ######## ### #####
####### # ### #
################ ### ### #

ETC

For example, where the character is the @ symbol.

so I want to print "@" to the screen, but how do I make darkbasic make it print at a certain coordinate?

in Qbasic, it would be:



I think you can see what i'm trying to do here.

Any help would be GREATLY appreciated.

Thanks.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 16th Nov 2006 19:12
instead of the locate command, I think dbp uses
Set Cursor x,y

Or you could use the text command:
Text x,y, "@"

to make a 2D array of integers:
dim arrayname(x,y) as integer

CHESS ENCOUNTER
Demo
WIP
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Nov 2006 19:13
The following should help. This is written for DarkBASIC Professional, but should work in DB Classic with a few small changes (not sure which version you are using)



It should be pretty self-explanatory, but feel free to ask questions.

Cheers,

Rich

"Bite my shiny metal ass" (Futurama)
"Don't ping my cheese with your bandwidth" (Dilbert)
Neon Knight
18
Years of Service
User Offline
Joined: 28th Oct 2006
Location:
Posted: 16th Nov 2006 19:22
aha.

Thanks.

@ Rich:

Okay, I pretty much understand that, (I'm using DBPro), I copied and pasted, and the first line created the following error: "parameter set for display mode do not match height, width, length at line 1"

I assume that's not supposed to happen....
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Nov 2006 19:39 Edited at: 16th Nov 2006 19:40
You must be using the trial version (or a non-upgraded version of DBPro) as the vsync parameter is quite new.

Remove the ,1 from the set display mode command and set the Project to run in an 800x600 window instead (or window full screen / desktop if you prefer)

"Bite my shiny metal ass" (Futurama)
"Don't ping my cheese with your bandwidth" (Dilbert)
Neon Knight
18
Years of Service
User Offline
Joined: 28th Oct 2006
Location:
Posted: 16th Nov 2006 19:55
It isn't a trial,

How do I upgrade it?

And thanks for the help, much appreciated.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Nov 2006 20:10
You go to the DBPro site, and you click 'Downloads' 'Upgrades'

"Bite my shiny metal ass" (Futurama)
"Don't ping my cheese with your bandwidth" (Dilbert)
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Nov 2006 20:11
Either go to the shop page for DBPro and select the downloads->upgrades from the menu at the top left, or you can go to the thread I maintain in the Bug Forum and download using the links in the first post.

Neon Knight
18
Years of Service
User Offline
Joined: 28th Oct 2006
Location:
Posted: 16th Nov 2006 20:13
Aha!

heh, obvious I know.
Neon Knight
18
Years of Service
User Offline
Joined: 28th Oct 2006
Location:
Posted: 18th Nov 2006 15:30 Edited at: 18th Nov 2006 17:53
okay, another question:

I am trying to convert the above 2d example into an ASCII 3d maze game. (moving in squares, of coursE)

I need to find a way to locate a part of the screen to how many character blocks fit in the screen, as opposed to how many pixels:

1 2 3 4 5
1#####
2#####
3#####

for example. Does set cursor allow this? Because I have tried it, and they all seem to clump together at the top left, so I assume not.

Login to post a reply

Server time is: 2024-11-27 04:42:59
Your offset time is: 2024-11-27 04:42:59