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.

Code Snippets / [DBC] Display MS Cards from DLL

Author
Message
waffle
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 23rd Jun 2007 19:51 Edited at: 23rd Jun 2007 19:56
Its my new entry.
Its been a few years since I made an entry.
This just loads 2 DLLs and then renders all cards to the screen.

Its slow because ....

1 - its DBC, code should also work with DBPro
With DBC, switching between DLLs creates a bit of a headacke
because of how DBC handle the virtual table.

2 - The backbuffer needs to be locked and unlocked or
the cards will be overwritten by DirectX because I'm using
windows calls.

To speed things up you should render each card one at a time,
then take a screen shot of that card and use it to texture
a sprite (slow) or a 3D Plain (fastest) then you only need hide
or show each object and let DBC/DBPro handle the details.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Jun 2007 23:09
http://forum.thegamecreators.com/?m=forum_view&t=59409&b=6

We are editing topics for a little while, but it's not going to be too long before we just lock threads which don't identify the version of DB in the post's topic/subject line as per the above sticky (which incidentally has been there since October 2005).

This one isn't so bad as you at least stated that it was for DBC in the post itself - which many don't do - hence the edit rather than a lock!

Be prepared for one or two very unhappy bunnies in the coming days - especially those who don't seem to think it's worth bothering with rules they don't see the point in...

TDK_Man

waffle
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 24th Jun 2007 00:06 Edited at: 4th Jul 2007 07:01
But, the DLL concept should work too.

Off Topic:
Why cant we MOD our own topics? I know its been asked before,
But can't remember the reason.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Jun 2007 20:24
Should or does?

If it can be confirmed, I'll edit the topic line - rather than have to edit it yet again if it's found that there's a problem with DBP.

TDK_Man

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 25th Jun 2007 04:56
I get an illegal operation error in DBP unfortunately.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
waffle
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 28th Jun 2007 16:15 Edited at: 5th Jul 2007 08:31
OK. here is a game based on my card lib code

first, the Include File
save this as cards.bas


then, the actual game


and that's it
It does require DBC113 Enhanced for the DLL access,
but no other files required.

As is common with my games,
Its not pretty and the docs are lacking
Basically, the game is a solitair game called picture frame.
Its a game my dad taught me 30+ years ago.
I modified the rules to suit me (don't cheat, just changes the rules)

At program launch you will see some cards flashing ...
This is normal. You are not imagining things
That's my card lib capturing the cards from MS cards.dll.

Then, you will see a bunch of "green O's".
That's the game you wish to play.
the column on the far left are the cards you pick up.
the 4x4 grid in the center is where you place them.
Most cards can go anywhere ....

Kings can only go on the TOP row
Queens on the Bottom row
Jacks on the sides

When you have filled in the 4x4 grid you can
begin removing cards (not the King,Queen, or Jacks).
Cards are removed by making a pair that equal 10.
So, pick up an Ace and drop it on a 9 card and both go away.

When done removing cards, just click on the left colomn,
anywhere, and you can begin collecting new cards.

To redeal at any time,
press Escape and then 'Y'

to exit the game
press Escape and then 'N'

and for those that just want the full .exe ....
waffle

EDIT: just revised the code a bit to correct a few errors.
EDIT: just updated the EXE to reflect code changes
EDIT: just update the .ZIP to improve the Escape sequence.
The source in the ZIP is updated, just not the source here.
If you use the .EXE, press escape and you can answer the dialog
using the mouse now.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-25 02:04:16
Your offset time is: 2024-04-25 02:04:16