Minesweeper clone, getting my feet wet with PureBasic

Advanced game related topics
SMartin
User
User
Posts: 19
Joined: Thu Aug 16, 2007 6:08 am
Location: Las Vegas

Minesweeper clone, getting my feet wet with PureBasic

Post by SMartin »

Here's a link to a minesweeper clone that I originally wrote in Emergence Basic and ported (with a few extras) to PureBasic.

They're both versions of Basic so the translation was fairly easy, and it gave me a chance to take a quick look at PureBasic.

I've got to say, I like PureBasic a lot.

http://members.cox.net/smartin1803/PureBasic/TT.zip

Image

edit: I discovered that GetCurrentDirectory() doesn't mean that you get the application's start path, so I added some gak to check for the directory that contains the graphics.
Also, I found a better way to do the the Alpha Blending shading for the Draw Glass option that doesn't slow the program way down.
The zip file at the end of the link has been updated.

Steve Martin
Last edited by SMartin on Wed Sep 19, 2007 4:04 am, edited 1 time in total.
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Looks nice, great game :)
Windows 7 & PureBasic 4.4
Brice Manuel

Post by Brice Manuel »

Glad to see you here :D

Nice game!
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

Nice!

Now, how about a battleships game next ? :D
Paid up PB User !
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

Could you please give us your source code. I want to study it, so make it neat.
SMartin
User
User
Posts: 19
Joined: Thu Aug 16, 2007 6:08 am
Location: Las Vegas

Source Code

Post by SMartin »

It should be in the zip file.
File name 'TT.pb' ... or were you asking for the Emergence code...that's not in there, but I'll add it if you like.

Steve
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

[Deleted Post because too long by user]
Last edited by michaeled314 on Sat Sep 29, 2007 12:42 am, edited 1 time in total.
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

I think I am losing my touch
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Was it really necessary to post the whole code (and without code tags)? :?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

All I saw when I did a control+c was

Procedure bla
Procedure bal
Procedure abl
...
Fred
Administrator
Administrator
Posts: 18178
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Your post is probably too big for the forum. You can edit it BTW.
SMartin
User
User
Posts: 19
Joined: Thu Aug 16, 2007 6:08 am
Location: Las Vegas

Source Code

Post by SMartin »

Hmmm. I'm new to Pure so maybe there's something going on that I haven't figured out yet.

I noticed that the code you posted from the file TT.pb stopped at the D's. The procedures are alphabetical so there should have been a lot more of them up to U or so.

I downloaded the zip and pulled the source file out and it was all there.

I'm honestly a little confused about why you're not able to see all of it.

Steve
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

*barn* he should remove that posting, it's annoying.
no connection with the topic, bloody desperate code, puked into the forums...

hey, spoiling the thread, nothin' more!
oh... and have a nice day.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

:wink:
That is a very interesting style of programming...

I have no idea what to call it...

Spagetti/Insanity??? Procedure/Insanity???

Hey I always say, however you code... as long as it works! And it works!!!! :D

My suggestion is a recode and arrange multiple windows for each size.

That said, I do not knw how you would arrange for "custom style windows"

Great start though!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
SMartin
User
User
Posts: 19
Joined: Thu Aug 16, 2007 6:08 am
Location: Las Vegas

Insanity...Who Me?

Post by SMartin »

I'm not really sure what to make of all that 'Insanity' stuff, as it all makes prefect sense to me.

There's a head section were variables, data structures, and procedures are defined.
A section to start up the the program, and....
An alphabetical section of procedures that divide up the process into distinct tasks.

All of it formated, indented, and folded.

Which, of course, means that I must be insane because I no idea why someone else would think that that's a crazy way to approach it.

Oh well, it probably just means that I haven't caught on to the 'Pure' way of doing things yet.

Is there a set of style guidelines around, or perhaps some examples of what is considered to be good common practice?

In the meantime, I think I'll google for some essays on procedural programming an see if I can catch up a little.

Steve
Post Reply