newGame project

The Partridge Family were neither partridges nor a family. Discuss.
Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

newGame project

Post by Natories » December 18th, 2013, 9:28 pm

Hello everyone,

While Chili was away for a bit, I started reading the book "Sam's Teach Yourself Game Programming in 24 Hours by Michael Morrison." The book focuses on the GDI for it's graphic components. The book was really easy to follow, but its framework lacks in comparison to any DirectX framework. Anyways...

I created this Battleship clone using the framework from the book. I stayed as close as possible to the framework, even though I had to make some modifications to it to get the game to work like I wanted. (Pretty sure most people would!)

I was in the process of converting it to Chili's framework and realized "Why reinvent the wheel?" So, instead, I present the game using what I call the samProject framework! I hope everyone enjoys it...

** EDIT: newGame - Space Battleship Update is the updated fix for Release mode. Thanks to theToddfather for discovering this... [11]

Natories
Attachments
newGame.zip
newGame - Space Battleship Update
(846.03 KiB) Downloaded 317 times
Last edited by Natories on December 20th, 2013, 5:00 am, edited 2 times in total.

User avatar
GreatJake
Posts: 169
Joined: January 6th, 2013, 5:13 pm
Location: USA

Re: newGame project

Post by GreatJake » December 18th, 2013, 9:35 pm

Nice! The artwork is nice! but i must ask... why use 'BOOL' and not 'bool'? for some reason that really seems to bother me :P

Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

Re: newGame project

Post by Natories » December 18th, 2013, 9:44 pm

Well, it bothers me too, GreatJake, but I was remaining true to the framework from the book. If you notice inside some of my functions, I do end up using the bool instead of BOOL.

I understand the purpose of it, to ensure that a FALSE is 0 and that TRUE is 1, but I like the 'little' bool too! LOL

Thanks for the comment on the artwork, took me a bit to draw those up!

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: newGame project

Post by LuX » December 18th, 2013, 10:55 pm

From what I remember the BOOL type is just to ensure it will compile on all platforms/computers, however seeing as our games use Dx -> focus on Windows this should never really become a problem.

Pretty cool game. Everything is well build, tho the keyboard ( typing ) might need a new revision...
Yes, I guess GDI is nowadays considered outdated, but if you make oldschool games and want to be sure they work for everyone then GDI is a probably the best way to go.
ʕ •ᴥ•ʔ

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: newGame project

Post by LuisR14 » December 19th, 2013, 1:49 am

the BOOL type is actually just a winapi type, which means it will only be for pcs that use the winapi (basically windows pcs :P), and it was created just because in C there's no bool type (and well, cuz it's Microsoft, they have their own uppercase form for all the integral data types lol)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

Re: newGame project

Post by Natories » December 19th, 2013, 5:38 am

Wow, I had no idea that there was so many ways to describe BOOL vs bool!
Thanks for the info Lux, I had to do that from scratch because the book didnt want to deal with text input! I can see why. LOL. I will continue looking for a better way.

Thanks for the kutos too, I appreciate it! :-)

Natories

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: newGame project

Post by thetoddfather » December 19th, 2013, 4:59 pm

Anyone else getting a linker error trying to compile this?

Code: Select all

1>Bitmap.obj : error LNK2001: unresolved external symbol __imp__TransparentBlt@44
1>C:\Users\Todd\Desktop\newGame\Release\DxProject.exe : fatal error LNK1120: 1 unresolved externals

Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

Re: newGame project

Post by Natories » December 19th, 2013, 6:59 pm

Good catch, theToddfather, I just tried to compile in Release mode too and it gave me the same error. Run this in Debug mode until I can figure out why it is not recognizing the TransparentBlt command in release...

Natories

Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

Re: newGame project

Post by Natories » December 19th, 2013, 7:06 pm

I figured it out ...

The msimg32.lib needs to be added to the Linker->Input->Additional Dependencies. I somehow missed putting in there. So, I'll update the project with the dependency added in a few minutes.

Natories

Natories
Posts: 107
Joined: June 21st, 2012, 7:06 am
Location: USA
Contact:

Re: newGame project

Post by Natories » December 19th, 2013, 7:18 pm

Hello Everyone,

Update to newGame for Release mode issues can be found in the initial post...

Thanks,
Natories

Post Reply