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 / Running games in windows (like how Minesweeper is run)

Author
Message
Brk_oth
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location: Australia
Posted: 8th Aug 2005 12:20
I want to know if there is a command for DarkBasic classic to run your game in a seperate window like Minesweeper, FreeCell, Pinball, etc.

It would be good for when your playing your game and need to check emails or something to just minimize the game.


Could someone please tell me!!!
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 8th Aug 2005 14:48
Yes, check the help files in DarkBasic. It's under system.

Immunity and Annihalation makes Immunihalation...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 8th Aug 2005 23:17
Yeah, that 'Set Window On' can be so elusive sometimes.

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
Brk_oth
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location: Australia
Posted: 9th Aug 2005 07:08
Quote: "Yeah, that 'Set Window On' can be so elusive sometimes."


When i typed 'Set Window On' it said that the command was unknown.
Do I have to add any numbers after that or what?
Drew Cameron
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 17th Aug 2005 00:01
You need a more recent version of DBC, you can upgrade for free from this website.

Katie Holmes says, check the Program Announcements board for the new Dumbo & Cool demo.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 17th Aug 2005 23:09
Ahh, so you aren't quite as stupid as I thought.

I'd like to take the chance to welcome you to the forum, because yes.

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 19th Aug 2005 01:57
I can't get it to work. I have the updated version but when I run it, Windows XP says it became unresponsive and had to close.

Wait something just occured to me, do you have to have win98 or something to use that command?

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 19th Aug 2005 10:42
works fine for me with windows xp

The happenings of tommorow are behind us now
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 19th Aug 2005 10:56
dbpro have that as options in a side menu which dbc doesn't have

Love games go to http://www.freewebs.com/halorc
or
http://www.freewebs.com/gamersmad
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 19th Aug 2005 11:07
Well, you could always make a game not in Windows, just use a command that minimzes the window, or that "alt-tab" key combination. The set window on is your best bet, but, I don't know why it isn't working for you-----sorry.

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 21st Aug 2005 01:47
Well, what command sets do you use to get it working? I actually would really like to know!

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Aug 2005 01:56
Try running this...



TDK_Man

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 21st Aug 2005 04:49 Edited at: 21st Aug 2005 04:59
Wow!, thats cool! Thanks TDK! I see why my window wasn't working! I didn't have the show window command! Thank you!

Anyway, is there anything special I have to do to keep the code working? Or Can I just put the set window thing anywhere I want to activate it and all is good to go? I tried to make a circle move around the screen but it wouldn't work.

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Aug 2005 05:00
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Aug 2005 10:33
Darkbasic works in his windows ONLY.
So you'll not be able to move a circle on your desktop...
(You can't even take a screenshot of your desktop)

Well, without DLL's that is.

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Aug 2005 21:18
Here's a circle demo in a window if it's any help...



TDK_Man

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 22nd Aug 2005 21:21
Thanks! Why do you have to put the code outside the do loop? Or did you do that just because?

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Aug 2005 09:19 Edited at: 23rd Aug 2005 09:23
It's always better to have a single Do Loop at the heart of your program.

Everything your program does should be done in a procedure or function which branches out from the main loop and returns when it's done what it needs to.

Gosub MouseInput
Gosub KeybInput
Gosub MoveEnemies
Gosub FireWeapon

and so on...

This makes it easier to debug as you can have specific tasks in separate blocks of code. So, if theres a problem with say your weapon firing, you can go straight to the 'FireWeapon' procedure knowing the problem is in that block of code somewhere.

The only reason ever to drop out of the main Do Loop is when the program ends, so you usually place the End statement immediately after the Loop line. When the player quits the game, you exit the main loop and drop through to the End which quits the program.

It's not so important to have the End in a small example snippet like this as you will use the Esc key to quit. If your game has a menu with exit as an option, the End is needed.

The alternative to this is 'spaghetti code' where it's jumping all over the place and very difficult to follow - making bugs very hard to track down.

You can use either method - your programs will still run, albeit a bit slower and probably with lots of bugs you can't track down!

It's all a matter of programming style. It's better to get into the habit of writing structured code earlier rather than later.

TDK_Man

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 30th Aug 2005 00:13
Wouldn't functions work as well? Or is that for a complete different use?

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 30th Aug 2005 11:43
Ive never used the show window command and it works well
hmmm..

[href][/href]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Aug 2005 16:39
Quote: "Wouldn't functions work as well?"


Yes sure they would. There's very little difference between a function and a procedure (that you Gosub).

The main difference is that with procedures, you still have access to all your variables and any changes you make are global. Eg if A=10 before you Gosub a procedure and you say A=20 inside the procedure, A will equal 20 when you get back.

Inside a function, the variable A would be local which means it is an entirely separate entity to the variable A outside the function. If it was 10 before calling the function, it will not exist on entering the function and will still be 10 on return from the function - regardless of what it is set to inside the function*.

For this reason, you have to pass variables you need to use in a function in the function's calling parameters. For the same reason, functions can also return a parameter.

Function Tutorial: http://www.computechtenerife.com/DB/tutorials.htm

So, I tend to use procedures all the time, and Functions when I want to create extra commands or need something that calculates a specific result.

There are no hard and fast rules on which you use though!

TDK_Man

* Ignoring the non-destructive bug in DB Classic.

Login to post a reply

Server time is: 2025-05-22 12:42:38
Your offset time is: 2025-05-22 12:42:38