IonicWind Software

IWBasic => Games and Graphics => Topic started by: billhsln on March 15, 2008, 12:54:48 AM

Title: 100 Game Poker
Post by: billhsln on March 15, 2008, 12:54:48 AM
I am writing a 100 game Poker program.  The problem I am running into is that I can create the default 99 Games (they will only show Suit and Card).  The problem is putting in the graphic for the main deck (00).  I have JPG files of each card that is 71x100x24 in size.  I can reconfigure these to BMP's or any other format that may be required.  See lines 48-69.  I want to put the pictures of the cards into control ID's 1001-1005.  It will default to back, then I will load the correct picture when the cards are dealt.

Note:  This is a starting shell program.  I need to learn how to load the pictures into the 00 Group.  I will put the code up to share after I get it done, but right now there is not a whole lot of logic in the program.  No point in doing all the main coding, if I can't display the cards like I want to.

This is version 1.1, I have tried using Sprites, it crashes majorly.  Any help will be appreciated.

Thanks for any help,
Bill

PS, I am trying to model this after a video Poker machine in the Casinos.

I have added the Cards to the archive
Title: Re: 100 Game Poker
Post by: pistol350 on March 18, 2008, 03:36:51 AM
Hi bill!

Your code needs many changes to work properly.
First you defined your card and cards[53] variables as UINT, that is fine when you load images, but in your case you load sprites so define them as POINTER.That is the main problem that causes the program to crash even before it runs.

By the way, as you want to have a main dialog plus a screen to display your sprites,
In addition of the main dialog, it would be better to create a window that would be the child of the parent dialog and attach your screen to that window.

For instance :

DIALOG d1
Window w1

CREATEDIALOG d1,0,0,desW,desH,0x80C80080,0,"100 Draw Poker",&d1_handler

OPENWINDOW w1,0,0,640,480,@NOCAPTION|@NOAUTODRAW,d1,"",&w1_handler
   
IF(ATTACHSCREEN(w1,640,480) < 0)
    MESSAGEBOX w1,"Couldn't create DirectX window","Error"
    CLOSEWINDOW w1
    END
ENDIF

Title: Re: 100 Game Poker
Post by: billhsln on March 18, 2008, 01:29:52 PM
Late last night, I finally tried something totally different and I finally got the result I was looking for.  I did not really need to use sprites (was just trying to get a graphic loaded). Turned out I had multiple problems.  Switched from a Dialog to a Window, had a space in the graphic files name that should not have been there and a few other things like trying to put the graphic in a Group, which did not work.

Thanks for trying to help, pistol350.  I am uploading my revised version, to show what I ended up doing.  Note:  this is not complete in any way.  In fact, I am still working on the screen.  Need to change a few fields from an Edit box to 3 buttons (1 cent, 5 cents, 25 cents).  Will also need buttons for Cash Out/Quit, Hold/Deal and Draw.  Probably a few others also.

If I ever get this completed, will upload full version.

Thanks again,
Bill
Title: Re: 100 Game Poker
Post by: J B Wood (Zumwalt) on March 18, 2008, 09:59:37 PM
http://www.ionicwind.com/forums/index.php/topic,1207.0.html (http://www.ionicwind.com/forums/index.php/topic,1207.0.html)

Look at that thread.
Should help, plus I included a deck of cards to use.
Title: Re: 100 Game Poker
Post by: billhsln on March 18, 2008, 11:10:04 PM
I actually tried using your program as an example.  However since I messed up some of the basics I could not get the sprites to display.  It is an excellent example.  Too bad I am not proficient enough to use it correctly.

Thanks,
Bill
Title: Re: 100 Game Poker
Post by: pistol350 on March 19, 2008, 05:02:42 AM
Hi Bill!
I wonder if you ever tried the Ibgolf game that uses the Qcard32.DLL into which all the cards are.
It was written in Ibasic Std by Richard Clark and then converted to Pro by a Codingmonkeys member, see this link :
http://www.codingmonkeys.com/index.php?topic=134.0

I included the converted Ibasic Pro version in the zip.

Hope it helps