Page 1 of 2

Minesweeper clone, getting my feet wet with PureBasic

Posted: Tue Sep 18, 2007 4:56 am
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

Posted: Tue Sep 18, 2007 9:42 am
by milan1612
Looks nice, great game :)

Posted: Tue Sep 18, 2007 9:50 am
by Brice Manuel
Glad to see you here :D

Nice game!

Posted: Tue Sep 18, 2007 9:55 am
by dontmailme
Nice!

Now, how about a battleships game next ? :D

Posted: Fri Sep 28, 2007 3:30 am
by michaeled314
Could you please give us your source code. I want to study it, so make it neat.

Source Code

Posted: Fri Sep 28, 2007 5:33 am
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

Posted: Fri Sep 28, 2007 1:41 pm
by michaeled314
[Deleted Post because too long by user]

Posted: Fri Sep 28, 2007 1:43 pm
by michaeled314
I think I am losing my touch

Posted: Fri Sep 28, 2007 1:43 pm
by Fluid Byte
Was it really necessary to post the whole code (and without code tags)? :?

Posted: Fri Sep 28, 2007 1:44 pm
by michaeled314
All I saw when I did a control+c was

Procedure bla
Procedure bal
Procedure abl
...

Posted: Fri Sep 28, 2007 2:25 pm
by Fred
Your post is probably too big for the forum. You can edit it BTW.

Source Code

Posted: Fri Sep 28, 2007 7:37 pm
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

Posted: Fri Sep 28, 2007 9:00 pm
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!

Posted: Sat Sep 29, 2007 11:09 pm
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!

Insanity...Who Me?

Posted: Mon Oct 01, 2007 2:07 am
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