Sie sind auf Seite 1von 21

A GMking.

org Publication

MarkUp April, 2007

Game Maker 7
is OUT! What you need to
know ((ppgg.. 66))
Plus…

IInntteeggrraattee w
wiitthh VViissttaa’’ss ggaam
mee eexxpplloorreerr PPllaayy ggaam
meess ooff yyeeaarrss ggoonnee bbyy
((ppgg.. 1177)) ((ppgg.. 22))
Markup is an open publication made possible by the contributions of people like you; please visit markup.gmking.org for information
on how to contribute. Thank you for your support!
©2007 Markup, a GMking.org project, and its contributors. This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105,
USA. Additionally, permission to use figures, tables and brief excerpts from this work in scientific and educational works is hereby granted, provided the source is acknowledged. As
well, any use of the material in this work that is determined to be "fair use" under Section 107 or that satisfies the conditions specified in Section 108 of the U.S. Copyright Law (17
USC, as revised by P.L. 94-553) does not require the author’s permission.
The names, trademarks, service marks, and logos appearing in this magazine are property of their respective owners, and are not to be used in any advertising or publicity, or
otherwise to indicate sponsorship of or affiliation with any product or service. While the information contained in thi s magazine has been compiled from sources believed to be
reliable, GMking.org makes no guarantee as to, and assumes no responsibility for, the correctness, sufficiency, or completeness of such information or recommendations.
Editorial
Editor’s Desk

Games of Years Gone By


Remember the days of DOS? You’d get And for those of you with some old perfectly on WinXP, xrl.us/ddave) and In
a new game (on a floppy) from a friend game system cartridges around, you can Search of Dr. Riptide (also available as
and Ooo and Ahh over the simple download copies of the games you own Shareware xrl.us/driptide).
physics that could keep you occupied (it’s only legal if you already owned the
for hours? original cartridge) that will run in Which brings up another good point,
emulators like mame (mame.net) at there are lots of great shareware games
Fast forward around 15 years and we for DOS still floating around. Back then,
theoldcomputer.com.
have games that require two CDs or a the demos went just a movie of
DVD to install (over a thousand floppies) screenshots; they were hours-to-days of
and we still Ooo and Ahh, and enjoy fun games. You’ll find a lot of them
them just as much as we did when we available on DOS archive sites such as
first put in a copy of SimCity for DOS, or dosgamesonline.com.
Sharky’s 3D Pool.
Switching from the past of gaming, to
If you’re like me you have boxes full of the future; open source games are
old games and apps on floppies for DOS, becoming more popular, more advances
Balloon Challenge
along with some of those “800+ Games” and much better. Here are just some of
CDs that came out for Windows, slowly the great games I’ve run into recently
fading away. Why? Digging up some of those games can (all of these run in Windows, most will
bring back some of the fun gaming also run on Linux & Macs):
A lot of those games can still be run, possibilities of some of the great games
using emulation software like DOSBox of yesteryear. Some of my personal Scorched3D . sf.net/projects/scorched3d
(dosbox.sf.net; pictured below) for your favorites I’ve resurrected are Sharky’s Bacteria ...... bacteria.simondonkers.com
DOS and Win 3.1 (you remember 3.1 3D pool shark (which I picked up a copy Planet Penguin Racer ....... xrl.us/PPRacer
right?) games. If you still have a legal of a few years back in a dollar bin at the Enigma........... www.nongnu.org/enigma
copy of Windows 3.1 (or in my case, local geek shop), Balloon Challenge (got Frozen Bubble ............ frozen-bubble.org
3.11 for workgroups) you can get a copy that in a 500 game pack, it’s a
See you next month!
of the free VMWare Server shareware game, so you can still pick it
(vmware.com) and install the actual Win Robin Monks, mozillaman.uni.cc
up at xrl.us/bchallenge), Dangerous
3.1 in an emulator. Cool, eh? Dave (this freeware DOS game still runs
In This Issue…
Editorials ..............................................
Games of Year’s Gone By ................ Robs 2
Tuntis’ Rant .................................... 5
Reviews ...............................................
Bridging the Gap! ............................ 3
Game Maker 7.0 ............................. 6
Tutorials...............................................
Game Maker................................. 12
Drawing: Surfaces ......................... 13
Intergration with Vista’s Game
Explorer ........................................ 17
P age |2 C++ “Hello World” ........................ 20
http://markup.gmking.org
Reviews
Game Reviews

Bridging the Gap!


I haven’t been active on the Game
Maker Community for a while, I don’t
check topics and creations as much, and
I’m probably not as up-to-date as I used
to be. But I do check my PM daily, and
that’s when I knew a creation of mine
was in the cage match against this
wonderful game: Bridging the Gap!

The game was created by Erik Leppen


and so far: I’m loving it! There are some
very good points about this game that I
will surely discuss, and other bad points
which I’m also going to talk about.

Concept and Originality


If I just look at the game and isolate it, I
have to say it has an excellent concept –
and it is fun! But people like me who
used to spend a lot of time in choice but to give this game a 6/10 in
Download.com trying to find a nice the concept area. Yes, I know – this isn’t
particularly good, but keep in mind, it is do we see in this game: well, there’s the
game to play would find this game very
a great implementation of the game as bridge, there’s the ground, there’s the
familiar.
you will see soon. actual train, and some graphic effects
When you look at the screenshot of the (which we will cover later). If you ask a
actual game, and compare with the Music and Sounds graphic designer what s/he’d think of
screenshot of "bridge builder game" on So I kept saying how good the game them, you probably won’t hear much
the next page, you will notice the was, but I started out with a bad point praising – but from a game play and
resemblance -- its striking! about the game, and I decided to keep it design perspective: excellent.
that way: so here’s the next bad thing in
Now I would’ve liked to see a the game: Music! The graphics are what I like to call
“completely” original game that I could “effort effective”, which means that
review, but that doesn’t make the game We need music, we need sound effects, whoever made the graphics put in the
– overall – any worse, except for the and we need something to listen to amount of effort that would make the
fact that coming up with the idea itself while we’re playing the game! I don’t game good (in terms of game play), yet
wasn’t the author’s task. care how fun anyone thinks the game is, “worth the effort”. Now sure, more
because it won’t be as fun as it would’ve effort – and therefore better graphics –
For information about “Bridge Building been with good music. would’ve made the game even better,
Game”, see bridgebuilder-game.com, or but it simply gets to the point where it’s
for the version of the game I originally So, all I can do is give the game a 3 out
simply better to keep them the way
used to play, see download.com/3003- of 10 in the music section.
they are.
2111_4-5862232.html.
Graphics
For all of the reasons above, I have no The question is: what kind of graphics

April, 2007 3|P a ge


Reviews
Game Reviews

Bridging the Gap! Cont.


I give the graphics 8/10, they well suit
the game, but of course – there’s always
space for improvement.

Graphics Effects
So there are two types of graphics
effects that I have noticed: destruction,
and smoke – but I’m sure I might find
more if I play it a bit longer.

Graphics Effects are always a plus to


have, but not an essential element in
game play. When looking at the smoke
alone, I like it – the way it is realistic and
smooth, and when looking at the
destruction effects, I also like it: it fits
the rest of the game’s graphics and
provide this certain “feel” to the game
that enriches the experience of the
player.
But again, the thing is, these effects are Game Play (Controls)
almost exact opposites of each other – The controls are good, easy to use and
either make them all realistic and understand, and most importantly:
smooth, or all cartoonish and ‘weird’. simple in every way! I’ve only played it a
Both are good, just not together, and couple of times and learnt a few control
for that, the game gets another 8.5/10. tricks, such as clicking on a single point
and connect all possible bars to it, etc.

The controls themselves are excellent,


different controls are accessible from
the top bar as well as a quick right-click
for those who can’t wait, or are simply
pros in the game and like to do
everything quickly.

I have no other choice but to give the


game a full 10/10 in Game controls.

Game Play/Player Experience


This game is fun, fun, fun! Most people
would love, whether or not they are
interested in physics, building, bridges,
cars, trains, computers, whatever – it’s a
The original game (originally called "Bridge Builder", now "Bridge must-try!
Building Game")
P age |4 http://markup.gmking.org
Reviews
ACTION GAMES

Bridging the Gap! Cont.


There is one disadvantage in the game: atmosphere of the game, etc. Here Well, according to what I’ve seen: it
when testing the bridge by allowing a however, versatility counts in the should. The game is based on a realistic
train to cross it, the train moved too variety of levels the game has – and and awesome (in my point of view)
slowly, and I couldn’t find a way to here’s what I’ve heard: it has 50 levels! physics engine. It’s all done quite well,
speed the train up, or even skip the Now that should keep you free for a stress is analyzed, and according to that
whole part – I really think such feature while, eh? the bridge breaks or holds.
should be available.
I must give Erik’s game a 10 in Of course, don’t take my word as an
The game gets 9.5/10 for player versatility, because the effort itself was answer; in real life, there are many
experience. amazing – and in each new level: a new, variables and such things are much
different challenge! more difficult and complex to calculate,
Versatility so I’ll just say that the game physics is
“Versatility”, in each game, is measured Realism “sufficient”. And by saying sufficient, I
in different ways. Sometimes it’s in the So how realistic is this game? Will such mean 9/10.
level design, in other cases it is in the bridges hold that weight in real life?
Programming and Bugs
TUNTIS’ RANT Well, the programming is definitely
PHP amazing, I must say. I have personally
Hi, my name is "tuntis", and I've been a Much isn't needed to describe my found no bugs and I’ve enjoyed playing
regular user of the GMKing.org services. problem with them: they are just a "bit" it, but I’ve checked the topic and found
About 4 months ago from the moment too hard to use. Allocating colors to use, a single bug. I tried to track it and see
of writing, I decided to pick up learning etc can be difficult. whether or not was it resolved, but I
PHP as a programming language. didn’t find out much.
Otherwise, PHP has been quite a nice
I, currently, have created a lot with it, "adventure", with the exception of the So for programming, the game gets
and know all the basics, and even run lack of... 9/10 – because it is one good
an online game, which I decided to pick “replication” (or even enhancement) for
up after it's original creator went on to Proper Online Documentation the original Bridge Building Game.
another project of his own. I've
The PHP manual is a great resource, but Overall
extended it a bit, and continue to run it
its examples are usually too incomplete
to the current day. When adding up all the scores, I found
and/or undocumented.
that the game's total score is 7/10. I
However, there have been some things personally hoped the game would get a
There are not enough tutorial sites and
I haven't liked about PHP, namely the higher score, but there's nothing much
looking at some other application's
following: that could be done.
source code doesn't really help.
Error Reporting Again I must say the game is incredibly
tuntis - http://www.tuntis.net
Error reporting could use much more fun, and a must-try. Such a game tells us
beginner-friendly reports (although one one thing about game development: a
does get used to the most common game is never limited by its tool or
ones), but can really confuse new language; it is only limited by the skill,
programmers sometimes. effort, and creativity of its author, and
what a creative author he is. Bravo.
Image Functions
Eyas Sharaiha
April, 2007 5|P a ge
Reviews
GAME DEVELOPER IDES

Game Maker 7.0


at the general Game Maker interface is but at the end of the day, you’ll
a new item the left pane called probably end up having to rework some
Introduction “Extension Packages”, and two new of the transitions you have in your
Those interested about Game Maker toolbar items on the top: “Create a game, if it had lots of them.
have gone crazy in late July, when Mark stand-alone executable for your game”
announced that the next version of and “Publish your finished game on the
Game Maker will not be 6.2, as website”. This section will not go Major Features
previously announced, but instead 7.0. through any of these features in detail, Those who are disappointed by the
Well, with such a change in the version but will instead be concerned about version number are probably upset
numbering, you would have expected their integration with the Interface. about this section! Yes, it is true; Game
much more features and something Maker 7.0 has only a few “major”
“completely new”, some people say So, the Game Maker interface is the features and additions. But, this
that is exactly what Game Maker 7.0 is, same. Not much is changed; we’re still hopefully shouldn’t stop it from being a
while others remain unsatisfied by the used to it, just some extra icons and a good, solid addition to the Game Maker
lack of sufficient new features to give nice little YoYo Games image on the line.
the 7.0 number to this version of Game bottom of the left resource pane.
Maker. However, a point worth noting is that The Extension Mechanism
that small link could be removed from The Extension Mechanism has an
However, whether people are satisfied the interface from the options menu. excellent concept and implementation!
by the version numbering of Game The general of concept of the extension
Maker or not doesn’t change the The changes to the interface are mechanism is that any user could be
software within. I think it is silly that incredibly minor, and are done in such a capable of creating “Extension
some people wouldn’t like Game Maker way that wouldn’t affect those who are packages”, and integrate them at a
7.0 just because of its version number – used to previous versions of Game deeper level that before. Extension
it could be version 11 or 2.3 and still be Maker. Buttons are added to the same packages could be one of three: script
as good! So, whether this version of interface, the same way other buttons (GML), DLL, and a Library. Now, what
Game Maker lived up to its number or were added before. In terms of differentiates extension packages
came as a disappointment, the review consistency, it is incredibly consistent – between regular scripts, DLLs, or
won’t change – the only question that and that is the number one most Libraries is that Extension packages are
truly matter is: is Game Maker 7.0 a important thing in the UI of any integrated differently; they become
good addition over Game Maker 6.1, software. actual scripts which the user might use,
and is it worth to upgrade? and it would seem like they are part of
Game Maker itself. They have their own
This review will go through all of the Incompatibilities
help, accessible via Game Maker, they
new features of Game Maker 7.0 in Game Maker 7.0 has one incredibly
are mentioned in the function list, like
incredible detail, and cover every positive point: it has too few
all other Game Maker functions are,
change that has occurred in it, so that I incompatibilities. So what? The file
they could have their own constants,
could come up with a result to answer extension has changes, big deal.
etc. They are basically an actual
the question asked above. However, the real problem is that room
addition to Game Maker itself, except it
transitions are incompatible with
isn’t written by Mark, and it’s either a
previous versions. Mark Overmars
The General Interface describes this problem as a “minor
GML script, a DLL, or an Action Library.
The first thing we notice when looking incompatibility with room transitions”, What confuses me is the action library

P age |6 http://markup.gmking.org
Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


part; libraries are already being inclusion mechanism. The reason was there are many other smaller features in
integrated into Game Maker – at a that Mark wanted to keep Game Maker store, some of which are very nice, and
different level, true, but I think that was simpler and easier, and now, he’s others which are useless!
enough. Integrating them in this way as returning some of the features we saw
well would cause confusion: where is in the Data File resource to the inclusion Publishing Games
this library? Is it in an extension mechanism. On the Game Maker part, it is only a
package? Or maybe it is in the lib simple button that links to a web page,
folder? The thing is, they now have their This has resulted in a simple and no big deal. But it is a big feature, guess
own help – and that’s the positive thing. understandable file inclusion why? Mark is finally making it simpler
mechanism – Just like Mark wants, and for newbies to publish their games onto
What occurred to me was that Mark at the same time a fully capable way of the web via the Game Maker website!
could move all libraries to Extension storing and handling files – Just like Bravo!
Packages, but then another problem experienced members wanted. It’s a
arises: compatibility. I guess it is difficult win-win! Splash Screens
to figure something out, but for the Splash screen functionality has been
extension packages (or at least the Windows Vista Compatibility expanded? I doubt many people will be
library part) to be better and probably Previous versions of Game Maker have happy about it, but I for one am. I
less confusing, Mark should’ve thought had a problem running on the final haven’t seen many people use splash
of something. version of Windows Vista. So, in Game screens in Game Maker, even though
Maker 7.0, Mark fixes that problem! splash screens are considered an
Let’s examine the process of Yes, Game Maker now works on important part of the presentation of
adding/removing an installed extension Windows Vista! What’s the trick? the game, before it is actually played.
to the Game. We click on Extension There’s an additional 1 MB of runner Hopefully now with better splash screen
Packages, we click on the available data attached to every Game Maker 7.0 functions, we would see more splash
packages and choose the package we executable, nice. screens used in Game Maker in the
want, an arrow appears, we click it, future.
boom! Here it is! To remove an So, no big deal; most of us have
extension, we click on Used Packages, broadband and don’t care about an The Separate Close Event
click the package we want to remove, addition 1 MB of file size, true. But the So that’s a nice thing, you bet. Having a
we click on the arrow that appears, and other problem that Game Maker has is separate event for the close button is
it’s gone! To summarize, it’s easy, that when it runs on Windows Vista, a definitely a smart thing, and has already
smooth, and a very enjoyable process User Account Control (UAC) Dialog helped me working on a couple of
overall! I like it, there’s nothing wrong appears that asks if you want to run this projects that I quickly converter to
with it, and I personally don’t think it executable, not nice. But of course, you Game Maker 7 to test it in order to
could’ve been done in a better way – get that kind of dialog for every make this review. It’s useful, and it
this is what it needs to be. unsigned, unknown-authored doesn’t waste space or anything – it’s
executable, not just Game Maker just added to the other events list!
File Inclusion executables.
A rather controversial move Mark did in It’s the Pro Version!
Game Maker 6.0 was the removal of the Instead of having a “Registered” version
Data File resource type, in favor of a Smaller Features of Game Maker, now members with a
much simpler and more limited file Be afraid not, my faithful readers; for registered copy would notice that their

April, 2007 7|P a ge


Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


copy of Game Maker is labeled “Pro”. Functions Renamed script and code editors, you will be
Additionally, the unregistered version is The functions in all official Game Maker capable of seeing a print button that
now called the “Lite” version. There is action libraries have been changed to be prints the code. I understand how some
absolutely no underlying change: just compatible with the book. This isn’t people might find this function useful,
the name. really a new feature to Game Maker 7.0, but I am not too excited about it. But I
as it has been introduced in Game don’t mind having an extra button that I
Maker 6.1a, but the thing is: Mark don’t use.
hasn’t released that over the internet,
so it is a new feature for most users,
Save and Load Debug Info
So the debug info forms now have new
since they don’t have the book.
save and load buttons added to them. I
Game Maker now accepts personally have never found the whole
more File Formats debugging to be that useful, but I admit
That is truly good news! Functionality to have used it on multiple occasions –
for functions concerning splashes but save and load? I’m not sure how it
screens, sprites, and backgrounds used would be useful, but apparently Mark
Even Smaller Features does.
in GML to load a certain image or video
I’ve said before and I’ll say it again: I’m
from a file during run time have been
going to cover every single change View Events: Outside View
enhanced to accept more file formats.
made in Game Maker 7.0, and I mean it!
Yes! That should have been done since
and Intersect Boundary
If I forget about one, then tell me and I’ll I’m serious: I’ve needed those events
GM 3!
add it! Here’s the list of even smaller for my game! These are very useful
and more insignificant features: Select All in Image Editor events, especially for those games with
You are now capable of using the Ctrl+A huge rooms and enormous amounts of
Move Actions instances.
keyboard shortcut, or the “Select All”
The move actions in the “Move Action
command to select all of the contents of
Library” have had their buttons
the image. Game Maker has always
Showing Errors
updated, so when you click on the blue So that’s a nice little feature: errors are
needed that since Game Maker 6,
arrows for moving actions, they turn now shown in a text area, nice! I can
where selection was first introduced.
red. Very small change, but nice, and copy, that’s one thing, but also: huge
would probably help the user recognize Centering a Message errors (as in errors where the line of
which buttons are being pressed in an The function message_position() has code they are in has too much doe)
easier way. always existed, what’s new however is scroll over and do not result in a huge
that setting the X and/or Y arguments to window that blocks the entire screen!
Showing Loading Bar
-1 centers the message! I’ve always
Now this is a nice move, the loading bar
thought that ability had excited before!
Getting, Setting, and
of the game now appears “considerably
Well, apparently it did not, and at least Randomizing the Seed for
earlier” than before. This means that Random Functions
Mark added it now.
you don’t actually wait for a few What? I read the help section about
seconds wondering if the game started What’s that little extra that twice before I got it. Basically, it
running when you click run! Good job. button? allows you to set a seed used to
Oh yes! It’s a print button! Now, on the generate random numbers. Of course,

P age |8 http://markup.gmking.org
Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


random number generation doesn’t missed in Game Maker 6. The pen_size they are being run.
solely depend on this value. variable (or whatever it was called)
provided a very similar effect in Game
Navigating through a Sprite’s Maker 5, but had been removed from Bugs Corrected
Sub-Images Game Maker 6, since it used Direct3D. Mark has corrected a handful of bugs
So that’s nice: you can now navigate to Well, now Game Maker has a function and annoyances in Game Maker 7.0,
the next and previous sub-image of a that would mimic part of that old and no: I’m not talking about bugs in the
sprite. This will speed up editing a lot, function, yay! beta itself, I’m talking about bugs in the
won’t it? Nice feature, and bugs previous versions of Game Maker. We
reported in betas have been solved, so IS IT DAMN SUCCESSFUL? will now examine these corrected bugs
don’t expect seeing errors or having Now we can finally know! Functions for and the impact those fixes will have on
problems when using this feature. I starting and stopping d3d_ now finally the overall game making experience.
think it would be particularly useful return whether or not they are
when someone is working on manually successful. Thank you! Corrupt Files
animating a sprite. That way the spriter Here’s a cool new feature in Game
could move directly between the two
Setting the Cursor Sprite Maker 7.0: Game Maker is now more
Apparently we have a variable for that: capable of reading Game Maker Source
frames and manipulate each frame
accordingly. cursor_sprite. From what I’ve heard it files, it doesn’t tell you it’s corrupt if it
had been around for a while, but Mark still is readable for the most part. Mark
The ‘globalvar’ Declaration only documented it now. claims that most Game Maker files that
Many people use the “var” to declare GM labeled as corrupt will now be
variables, well guess what? You can now
We Need More Arguments! readable by Game Maker 7.0! Now
And we have more arguments! DLL that’s nice!
use “globalvar” to declare global
variables! What’s the use, you ask? Functions now support up to 16
Well, after declaring a global variable in arguments, cool indeed! Corrected Limited Real
such a way, you are not required to Precision Bug – I know the
write “global.” before the variable time now!
Major Fixes
name. Game Maker 7.0 has finally solved a bug
A major fix is the encryption of scripts
that existed at least from Game Maker
F9 Function Key Takes via runtime, and other protections to
6.0, where basically real numbers with a
the executable file of Game Maker
Screenshots certain precision weren’t handled
games. These fixes make it much harder
Pressing the F9 function key now takes a correctly. Since date and time in Game
for people to decompile a game and to
screenshot of the game. This mini- Maker are also expressed by real values,
view or use the code by accessing it via
feature could be disabled via the Global getting the date and time wasn’t always
the RAM on runtime. This is an excellent
Game Settings, so don’t worry if you correct; sometimes it’d tell you it is
security fix and should save great
don’t want people to use your sprites or January 24 when in fact it is January 25!
games’ sources for being viewed by
take screenshots of your game for any I’m glad this is over, because I had huge
unauthorized people.
other reason. date and time problems in one of my
Please note that I am not in any way projects
Draw a line with a width! here talking about the .gmk encryption,
That is a function that we have indeed
I am talking about encryption to the
Corrected Timeline Bug
A bug in timelines has finally been
executable and scripts themselves when

April, 2007 9|P a ge


Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


corrected! The bug occurred when people discovered is that they were and a border rectangle. Smart.
content is duplicated to an earlier capable of extracting information from
moment in the timeline. Games at run time. There were some Empty Window Shown Before
other flaws too, have lead to a Create Event
No more Syntax Errors for successful decompiling attempt. But: Were you ever annoyed that when
Bitwise Assignments Mark fixed that now, thankfully. So we showing messages on Create Event,
Assignments such as =, +=, etc. have shouldn’t be worrying about having our you’ll actually need to move them to a
always worked properly; because they creations subject to decompiling, for the later event (or use redraw functions)?
are the most used. But finally: now, also short term at least. It is in general Well now, the window is shown earlier,
bitwise assignments work properly! recommended, however, that we keep so from moment the create event is
What are bitwise assignments? They are things like passwords away from our executed, the window is there.
those assignments using bitwise Games’ executables.
operators, such as &, |, ^, <<, and >>. So I have my concerns on this “fix”, as
now, using &= |=, >>=, etc. should give Less Annoying Debug Forms probably many people were satisfied
Debug forms are now less annoying, that the window weren’t shown before.
out no errors, supposedly.
Mark says. Debug forms no longer keep There is no way to predict whether or
Show Message actions keep jumping to the top position. not will this fix backfire, except for
box centered waiting.
All show message actions keep the No More Multiple Fonts,
ALWAYS Color Coding! Median Now works properly
show_message function itself centered
I don’t know about the rest of the
in the screen (unless the position itself So, I bet most of you have had this
problem. Copying a piece of code from people, but I personally use the
is changed). This is important for
median() function a lot. For those who
providing users with a better experience somewhere like a webpage where it has
been formatted results in having it do not know, the median function
when playing your Game, even though
pasted in that same formatting, and no calculates the average of a number of
it’s probably not that big of a deal.
values entered, and is really useful in
color coding is applied. That has been a
Explosions work, Even at cold very annoying bug in Game Maker, and numerous games. Apparently, it had a
problem, but it has been fixed in this
weather! Mark has finally fixed it in the 7.0
release! version.
I’ve never knew that, but apparently
using explosions with the snow effects
at the same time caused problems! Backgrounds keep their Resizing Grid: No more
settings crashes
Good news: it is now fixed and they
A rather annoying bug was that I haven’t noticed that bug to be honest,
both work properly!
backgrounds would lose all of their but apparently, Game Maker crashes
Don’t Worry About settings when you change the
sometimes when grids are being
resized. Mark has finally solved that
Decompiling! background image. Luckily, it has been
fixed in GM7. issue now, but I’m still confused –
So in Game Maker 6, we’ve all heard
because I’ve never saw it.
about Mark’s huge efforts to stop
decompiling from occurring, and it Rectangles are now accurately
Grid Data Structures Now
worked for a while. Though decompiling drawn
So, now there is now no difference
Work Well With Strings
itself didn’t occur for a long time, what
The “grid” data structure previously had
between the size of a solid rectangle

P a g e | 10 http://markup.gmking.org
Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


problems with storing string values; this parents. That is incredibly good news, community, and many have strongly
has been fixed in Game Maker 7.0. from my point of view. opposed it, trying to let Mark change his
mind about it.
Sprite Preview Issues – Fixed Bounce Bounces Correctly!
The sprite preview pane sometimes So that’s good news: if you have About the .gmk encryption, it refers to
showed sprites as being transparent diagonal surfaces, and use the bounce the fact that Game Maker 7.0 source
even though they have been set to non- action on collision, the object will now files are now encrypted, and their
transparent. This issue has now been realistically bounce off it, and it content cannot be read. The encryption
fixed: all sprites preview correctly. wouldn’t treat it like horizontal and isn’t a security issue, since the file being
vertical surfaces. encrypted isn’t the executable, but
instead the source itself!

Collision Checking works with Is there something wrong Here’s the thing, Mark never lied: the
Scaled Instances with Game Maker 7.0? .gmk encryption is aimed to stop
If an instance of an object has a scaled projects that access Game Maker source
You might ask: is there something
sprite, it won’t stop you from having files like G-Java. It is Mark’s belief that
wrong with Game Maker 7.0? And the
proper collision checking in Game by stopping projects like G-Java, it is
answer would be: definitely. Game
Maker 7.0! That’s indeed good news. actually in Game Maker’s best interest,
Maker 7.0 is by far not perfect when we
and he means it.
Collision_ Functions with non- judge it a separate piece of software.
However, when looking at it at a simple Users were upset because they thought
integer Coordinates work
upgrade, it has no bad points compared what Mark was sort of a betrayal to the
properly to Game Maker 6.1 (except for the .gmk Game Maker members who have
All of the collision_ functions that check
encryption, we’re getting to that later). worked hard to provide such tools for
for collisions between lines, rectangles,
Game Maker. They also believe that
circles, etc. and objects now work as So, this means that if you want to use
Mark hasn’t gave much thought about
expected, even if their coordinates are Game Maker as a regular game
incorporating that “feature”, and have
non-integers. development tool, you definitely should
said that it would do more harm than
get Game Maker7.0 –it is that simple:
Opening a Non-Existent Game Maker 7.0 isn’t worse than Game
good to Game Maker, since those
Binary File Creates it making these tools could decide to
Maker 6.1, as a matter of fact: it’s
make their own Game Development
As with the rest of file handling better. The other question is: is it what
toolkits that rival against Game Maker.
functions, the open function for binary we had expected? And the answer to
files file_bin_open() now creates the file that could be different from person to In my point of view, however, Mark’s
to be opened if it doesn’t exist. It’s person; I’ll tell you my point of view probably more right. Converters would
surprising such function didn’t exist after a couple of sections. create lots of benefit for Game Maker,
before. true. But the important point is, they
would create much confusion to the
Setting Object Parent Via GML The .GMK Encryption beginner users, it might as well hurt
now has Checks The “.gmk encryption” is a new change
Game Maker’s reputation when
So, the object setting function of GML in Game Maker introduced by Mark
features in the converters themselves
now has addition checks to see if any Overmars. It has been highly
do not work – and that was what
cycles were made in the object’s controversial in the Game Maker
concerned Mark.

April, 2007 11 | P a g e
Reviews
GAME DEVELOPER IDES

Game Maker 7.0 Cont.


Still though, it is a shame to see such Game Maker simultaneously on your It has few “big features”, yes, but it isn’t
projects fade away, and I would truly machine, so you could both take a disappointment –at least for me;
hope to still see those years later (on advantage of Game Maker 7’s new because every one of those “small
Game Maker 6), to provide “ports” to features and the lack of source code features” would truly make a difference
Game Maker in other languages and encryption Game Maker 6.1 has, if to a Game developer. It would be a
systems. you’re considering converting to Java or disappointment however, if we
other languages. expected the changes to be as
significant as the 5.3A->6.0 differences.
Should I get Game Maker THEN, it would have been truly
7.0? Final Remarks disappointing.
Almost definitely yes! Game Maker 7.0 Game Maker 7 is definitely better than
provides more compatibility, more fixes, Game Maker 6.x, and is definitely worth Good job, Mark Overmars; this is truly a
to upgrade for a few reasons: it’s free great tool, and this is truly a great
and more functionality, the only reason
you might stick to using Game Maker and easy to upgrade, so why not get a release. Some of us would have
6.1 is to take advantage of the tools like better version. However, I must really expected more, but I’m pretty sure
G-Java, which are no longer allowed to look at Game Maker 7.0 from another we’re getting more in the future.
work on Game Maker 7.0. Even so, you perspective and ask myself: is it a
Eyas Sharaiha
might consider running both versions of disappointing release?

TUTORIAL
Game Maker Tutorial
Getting the number of blue pixels on The Example
the screen in Game Maker is an
excellent example of the return function width=room_width;
of Game Maker. height=room_height;
current_x=0;
This script makes a loop that checks the current_y=0;
color of each pixel on the room. To do blue_pixels=0;
repeat(height)
this, we check one row at a time, then {
move on to the next row. repeat(width)
{
It then returns the number of blue current_pixel_color=draw_getpixel(current_x,current_y);
pixels in the current room. Handy if you if current_pixel_color==c_blue
{
were making a game that required user
blue_pixels+=1;
interaction with colors, or for a drawing }
program. }
current_y+=1;
current_x=0;
}
return blue_pixels;

P a g e | 12 http://markup.gmking.org
Tutorial
DRAWING TUTORIAL

Surfaces
reset) the surface. enter in the “w” field in the
“surface_create(w, h)” function.
Introduction But this is not all what surfaces are
Surfaces is a new feature that was about! When you draw a surface, the surface_get_height(id)
added in Game Maker 6.1, it allows the surface uses the system temporary
Returns the height of the surface with
user to use the normal draw functions memory to save its contents, which
the given id. The height is what you
to draw on a canvas, or a “surface” means it acts as if it is a bitmap file (or
inter in the “h” field in the
once, and then, it can be saved to a file, something similar) in a file in the Main
“surface_create(w, h)” function.
drawn on the screen, go through some Memory! So that is why speed is saved
when using a surface.
manipulations and rotations, or get First Attempt
copied to another surface. Ok! So let’s try out these functions that
Since we now know what a surface is, I
we have just learnt in a piece of code,
Benefits think we can start learning about the
code these surfaces use in order to and see what happens! We will create
Surfaces usually are handy when
function. an object called “o_surfaces” and put
making a paint system, like MS Paint.
this code in its Create Event.
You draw a line to the screen, then the
line is saved on the surface, and the surface=surface_create(50,100);
Primary Code //Creates the surface
surface is drawn at the end of each
draw_text(5,5,“This text is drawn in
step, which means that even if you The Basics the create event.”);
draw thousands of lines on the surface, surface_create(w, h) /*The code above attempts to draw
then draw the surface on the screen, text in the create event!*/
the game will still run fast, as the Creates a new surface with the width
surface is drawn all at once, not each “w” and height “h.” It then returns the Explanation of First Attempt
line separately. surface “id” which is used in all the The code above creates a surface called
other functions. This means that when “surface” and attempts to use it to
Concept calling this function, you must set a draw text in the create event, and
To understand Surfaces more, we have variable’s value to this function, like therefore take advantage of the
to understand the regular drawing first. “_var=surface_create(5,5)” surfaces by using a drawing action once
To do that, imagine that the main room to draw on a surface on the screen.
in any game made with Game Maker is surface_exists(id)
Problem
just a simple piece of cardboard, that
Checks whether the surface with the But after you place the object in the
everything you draw on it is erased
given id exists. Returns true or false (1 room and run the game, you will notice
after one millisecond. Therefore, if you
or 0, respectively). that no text is drawn! “Why is that?”
draw a line once, it would be removed
you wonder!
after one millisecond, which means that surface_free(id)
you need to draw it once after each Reason
Frees the memory that the surface with
millisecond is over. The answer is simple! Game Maker
the given id is using. This must be called
doesn't understand automatically when
However, Surfaces are just a piece of when there is a surface you are no
to draw on a certain surface and when
paper that “flies” above the main room longer using in order to save memory.
you need to draw on the main room, so
(or the piece of cardboard) and lines
surface_get_width(id) you need to use certain functions that
drawn on it do not get removed after
will switch between drawing on
each millisecond, but they stay drawn Returns the width of the surface with surfaces and the main room, and switch
on the surface unless you empty (or the given id. The width is what you
April, 2007 13 | P a g e
Tutorial
DRAWING TUTORIAL

Surfaces Cont.
between making the drawings on Reason “height.”
certain surfaces between each other. It’s simple: the test is saved in the
surface, and it is in the memory, but it is draw_surface_ext(id, x, y,
Code Explanation will help: xscale, yscale, rot, color,
not drawn to the game’s main screen! It
alpha)
surface_set_target(id) is true that I said you don’t have to use
the draw functions constantly to draw Draws the surface with the given id in
This function is the function that tells all the drawings and lines, but however, the position (x, y) scaled by xscale and
Game Maker what is the target of the you do need to draw the surface. So yscale (1= no scaling) and rotated using
drawing. You need to enter the id of when you draw a 100 lines in the the value rot (0=no rotation), and with
which surface do you want the drawings surface, you only need to execute one blending color (use c_white for no
to be on. each step (the surface drawing blending) and the transparency alpha
function), not zero. Below is the code value from 0 to 1, whereas 0 is
surface_reset_target()
explanation for the surface drawing transparent completely.
Resets the drawing target to be on the functions. They have been copied from
the help field, and then edited to make draw_surface_stretched_ext(id, x,
normal screen again. It is important to
y, w, h, color, alpha)
use this code immediately when you the functions clearer.
finish drawing what you need on the Draws the surface with the given id
draw_surface(id, x, y)
surface, as it may mess up the whole stretched to the size of (w, h) in the
game; objects, backgrounds, and other Draws the surface with the given id in position (x, y). Color is the blending
things are drawn on the main screen, the position (x, y) without any colors or color (c_white=no color blending) and
making the game draw these things on a alpha blending. alpha indicates the transparency setting
surface may corrupt the game. from 0 to 1 whereas 0=transparent.
draw_surface_stretched(id, x,
Second Attempt y, w, h) draw_surface_tiled_ext(id, x,
surface=surface_create(50,100); y, xscale, yscale, color,
//Creates the surface Draws the surface with the given id alpha)
surface_set_target(surface); stretched to the width of w and h, in the
//Sets drawing surface target position (x, y). Draws the surface with the given id tiled
draw_text(5,5,“This text is drawn in
so that it fills the entire room and starts
the create event.”); draw_surface_tiled(id, x, y)
/*The code above attempts to draw in the position (x, y), but now with scale
text in the create event!*/
Draws the surface with the given id tiled factors (xscale, yscale) and a color
surface_reset_target();/*Resets the blending (color) and transparency
drawing target. The drawing target so that it fills the entire room. It starts
is not set as the main screen in the tile in the position (x, y). setting (alpha) from 0 to 1 whereas 0 is
order for the game to continue transparent.
functioning properly without draw_surface_part(id, left,
corruption.*/ top, width, height, x, y) draw_surface_part_ext(id,
left, top, width, height, x,
Problem Draws the indicated part of the surface y, xscale, yscale, color,
Go ahead and test this code, you may with the given id that is drawn at the alpha)
think it will work. But it still wouldn't! position (x, y). The part of the surface
Do you have any idea why? Draws the indicated part of the surface
starts and the position (left, top) with
with the given id that starts on the
the width “width” and the height
position (left, top) of the surface, with

P a g e | 14 http://markup.gmking.org
Tutorial
DRAWING TUTORIAL

Surfaces Cont.
the width and height (width, height), you may see that a part of the text is (source) to the new surface
with its origin at position (x, y) but now not drawn, that is because your surface (destination). The (source) copied will
with scale factors (xscale, yscale) and a width is “50,” and there might not be be pasted in the position (x, y) of the
color blending (color) and transparency room for all the text! This, ladies and new surface (destination). The copying
setting (alpha) from 0 to 1 whereas 0 is gentlemen is the magic of surfaces! occurs without doing any blending.
transparent.
Now let’s move to the more-complex surface_copy_part(destination,
draw_surface_general(id, left, part of the surfaces, which is the once x, y, source, xs, ys, ws, hs)
top, width, height, x, y, dealing with files and saving.
xscale, yscale, rot, c1, c2, This function copies a part of the
c3, c4, alpha) surface (source) to the new surface
Secondary Code (destination). The (source) copied will
The most general drawing function. It be pasted in the position (x, y) of the
draws the indicated part of the surface Files and Saving new surface (destination). The part of
with the given id, that starts on the surface_save(id, fname) the (source) to be copied will start on
position (left, top) in the surface, with position (xs, ys) of the source and have
the width and height of (width, height), This function saves the whole surface
the width (ws) and height (hs). The
with its origin at position (x, y) but now with the given id to a bitmap file. The
copying occurs without doing any
with scale factors (xscale, yscale), a filename must be a string (fname). The
blending.
rotation angle (rot), a color for each of “fname” could be just the name of the
the four vertices (top-left, top-right, file or its complete target.
bottom-right, and bottom-left) Cleaner Surface Drawing
surface_save_part(id, fname,
(c1,c2,c2,c4 respectively), and an alpha To draw to a cleaner surface, all add this
x, y, w, h)
transparency value (alpha) from 0 to 1 piece of code after
whereas 0 is transparent. This function saves a part of the surface surface_set_target(id):
with the given id to a bitmap file. The
Third Attempt draw_clear_alpha(c_white,0);
filename must be a string (fname). The
So in order to make the drawing on “fname” could be just the name of the This will make the surface completely
surfaces function work properly, you file or its complete target. The part of transparent.
need to draw the surface in the draw the surface begins at the position (x, y)
event, all the other code that you have on the surface, and has the width (w)
made in the create event is correct and and height (h). Special thanks & Closing
must stay the same. Add the following Remarks
code to the Draw Event. More Functions
Thank you for reading this tutorial. The
surface_getpixel(id, x, y)
draw_surface(surface,0,0); //Draws tutorial has been originally written by
the surface This function gets the color of the pixel Eyas Sharaiha and published in the
in the position (x, y) in the surface with Game Maker community. It is now part
Result the given id. of our wiki (GMking.org’s Wiki), you can
Now you can clearly see that the text is visit the wiki here:
drawn, even though only the surface surface_copy(destination, x,
drawing function is called! Depending y, source) http://wiki.gmking.org/
on your system and font-size settings,
This function copies the whole surface Eyas Sharaiha

April, 2007 15 | P a g e
Tutorial

PROGRAMMING TUTORIAL

Integration with Vista’s Game Explorer


A fabulous new feature in Microsoft’s system requirements about your game. In order for your
latest version of Microsoft Windows – 4- Game content rating and information to be shown, you must
Windows Vista – is the Game Explorer, description create at least one of these GDF
and it is of particular interests to us Other advantages the Game Explorer documents. If you want your game
game developers, and the gamers out provides are: information to differ for each different
there as well. This article will describe – Ability of parental world region, then you must create
in detail – how to integrate controls to control multiple GDFs, one for each region.
your own game with the which game
A Game Definition File has a certain
Game Explorer. ratings could be
format which you might abide by:
played
Throughout the article, I Unique settings for The Game Definition File Schema
will try to be as IDE-
multiple
independent and There are certain data types allowed in
installations on the
language-independent as possible. This Game Definition File (a table of which is
article will go through the whole same systems at the bottom of the next page).
process in great detail, so it’ll be easy to Customizable context menus
understand both for novice developers First of all, as with any XML document,
displaying actions to be
and the “gurus”. you must define it:
performed when right clicking a
game <?xml version="1.0"
The second section of this article,
encoding="utf-16"?>
specifically integrating with the installer,
is based off portions from the MSDN Adding your game!
This defines the XML file as an XML 1.0
site at Microsoft. A more complete file, with a UTF-16 encoding. IF you do
In order to successfully create a game
article will be released in the next issue not know much about XML documents,
which could be added to the Game
of markup, showing how to integrate then you can use the line above as it is,
Explorer in Windows Vista, you must do
these objects with InstallShield itself. as UTF-16 is the most common
two things:
encoding, and version 1.0 is the proper
1- Create certain settings and files version to use.
Introduction of the Game that the system will read
Explorer 2- Add these files and settings to Second, there’s the GameDefinitionFile
the Installer of the game element. Now I’ve searched a lot about
The Game Explorer is a new feature in this element, but found very little
Windows Vista that provides gamers explaining its syntax. I’ve seen the
Creating Data Files
with an excellent way to view syntax of how a couple of games were
information about the games they have, There are specific types of data which written, and it seems to be the same, so
this includes: will be read by the Game Explorer, you it’d probably be okay to include this
must create them in order to take element as it is:
1- The game title, description,
advantage of the Game Explorer’s
version, release date, publisher, <GameDefinitionFile
capabilities.
and developer information xmlns="urn:schemas-microsoft-
com:GameDescription.v1"
2- Box-art image Step 1: Create GDFs xmlns:baseTypes="urn:schemas-
3- Minimum and recommended microsoft-
A GDF is short for “Game Definition File”
and it is an XML-based file carrying data
P a g e | 16 http://markup.gmking.org
Tutorial

PROGRAMMING TUTORIAL

Vista’s Game Explorer Cont. GameDefination Element Attributes


com:GamesExplorerBaseTypes.v1"> Name Data Description
Type
Note that the GameDefinitionFile gameID guid The game's ID. This uniquely identifies your game title to
element will be wrapped around the the Game Explorer. This is generated by you, or, in the
rest of the XML document (the structure case of certain titles, has already been provided.
of the whole document will later be WMID guid The game's ID for Windows Metadata Services. This
presented). should only be used for legacy games.

Inside the GameDefinitionFile, there’s Game</Description>


is their data type. For each element,
an element called the GameDefinition
check its data type and make sure to Another optional element is the
element. This contains two important
write it in the proper criteria. ReleaseDate element; its data type is
attributes which need to be defined
(see table at right). “date” and is written as “yyyy-mm-dd”:
Please note that the GameDefinition
element will also wrap around the rest <ReleaseDate>2004-06-
An example is as follows:
of the document, so all later elements 30</ReleaseDate>
<GameDefinition will be included in this element itself.
The version element is a choice type
gameID="GAMEID" which contains one of the two ways of
An important element is the Name
WMID="WMID"> element. Its data type is a specifying the version number of your
boundedString, and it represents the game one method is an explicit version
An example includes:
name of the game. number embedded in the XML. The
<GameDefinition other method is a path to an
<Name>Super Game 2005</Name> executable or DLL where the version
gameID="{5C08D2FF-A48E-43ca-846C-
number can be extracted.
08924563E5A7}" There is an element called description
WMID="{5C08D2FF-A48E-43ca-846C- with its data type as boundedString, If it was to be written as a number, an
08924563E5A7}"> which is an optional element to include. element inside the main Version
Notice that both gameID and WMID are element will be added, called
<Description>The Penultimate
written in the format of a “guid” which VersionNumber with fourPartVersion
Game Defination File Date Types
Name Schema Component Type Description
fourPartVersion simpleType String (with facets) A simple type that contains a regular
expression for 4-part versions
guid simpleType String (with facets) A simple type that contains a regular
expression for guids. Guids must be of
standard type, enclosed in braces.
boundedString simpleType String (with facets) A string which preserves whitespace and is
limited to 32768 characters.
filePathAttributeGroup attributeGroup N/A Two frequently used attributes for file paths
combined into an AttributeGroup.
filePathAttributeGroup: attribute guid A guid that represents a KnownFolder as the
baseKnownFolderID base path for folders. The path passed along is
relative to this known folder. If this folder isn't
specified then the path attribute below is
relative to the game's installation directory.
filePathAttributeGroup: path attribute boundedString A bounded string for the file path represented
by this group. This file path is relative to the
April, 2007 17 | P a g e
baseKnownFolderID above.
WindowsSystemPerformanceRating attributes
as its data type. Name Data Description
Type
<Version> minimum int The minimum WSPR rating that a computer should have
<VersionNumber in order to play this game.
versionNumber="1.2.3.4"/>
recommended int The recommended WSPR rating that a computer should
have in order to play this game.
</Version>

If it was to be written as a path to a file


which contains the version number
inside it, an element inside the main
Version element should be added,
called VersionFile with
filePathAttributeGroup as its data type.

<Version>
element is an important but optional Another element I really like is the
<VersionFile ratings element which gives you
attribute that allows you to choose the
path="bin\MyGame.exe"/> recommended and required “Windows multiple rating attributes for the game,
</Version> Experience Index” values for running so that parents or anyone else could
your game. know if the games suit themselves,
The developers element specifies the
their children, or any other person.
developers of this particular game, a <WindowsSystemPerformanceRating
link to their website can also be minimum="4" recommended="5"/> I’m not going to talk much about that
included: element, but you can read more info at
The table below lists the attributes for their MSDN article. Use the links at the
<Developers>
WindowsSystemPerformanceRating. end of the article.
<Developer
URI="http://www.microsoft.com">Mi There’s also an element called the The Game Executables element is the
genres element, which could contain last one I’ll talk about. It is very simple
crosoft</Developer>
multiple genre elements, it looks as to use and understand:
</Developers>
follows:
<GameExecutables>
Note: A total of five different developer
<Genres> <GameExecutable
links could be added inside the
path="bin\game.exe"/>
developers element <Genre>Action</Genre> </GameExecutables>
<Genre>Adventure</Genre>
The publishers element specifies the An example of the complete code of
</Genres>
publishers of this particular game, a link the document is below:
to their website can alos be included: Complete document code
<?xml version="1.0" encoding="utf-16"?>
<Publishers> <GameDefinitionFile xmlns="urn:schemas-microsoft-
com:GameDescription.v1"
<Publisher xmlns:baseTypes="urn:schemas-microsoft-com:GamesExplorerBaseTypes.v1">
URI="http://www.microsoft.com">Mi <GameDefinition gameID="{dc90fdca-aa28-4d13-8401-ad149e4bccae}"
WMID="{9e6c8124-5159-4aed-a175-a2dd292dfe86}">
crosoft</Publisher> <Name>Boggle"!</Name>
</Publishers> <Ratings>
<Rating ratingID="{7a53b0be-b92d-4e8a-a11f-8e6f9f3c575b}"
ratingSystemID="{768bd93d-63be-46a9-8994-0b53c4b5248f}" />
Note: A total of five different developer
</Ratings>
links could be added inside the <Version>
developers element <VersionNumber versionNumber="1.0.0.0" />
</Version>
The </GameDefinition>
</GameDefinitionFile>
WindowsSystemPerformanceRating

P a g e | 18 http://markup.gmking.org
Tutorial

PROGRAMMING TUTORIAL

Vista’s Game Explorer Cont.


Step 2: Create Bitmaps The first step in adding your game to For more information, see ref. (6).
the Game Explorer is to have your game
The Game Explorer displays artwork for
files installed on the hard drive. It is Step 5: Persist Game InstanceID
every game that provides it. The
important that all game files be installed You must persist the InstanceID that is
artwork provided is shown in a small
by this step; once the game is added to returned from the AddGame function.
format in the list of games, and in a
the Game Explorer in step 4, Parental This is needed in order to be able to
large format when a game is selected by
Controls may prevent your install properly uninstall the game.
the user. Create an image file that will
process from accessing the game's base
represent your game in the Game Step 6: Create Game Task Folders
install directory to add or change files.
Explorer. As seen in reference (9), you must use
Step 2: Create an IGameExplorer the InstanceID to create a subdirectory
The image should be in PNG format, as COM Object in the Installation of that ID either in the common task
this allows for transparency features to
directory used for all files or in the
give your artwork a clean look in the Your next step would be creating an
IGameExplorer COM object. As seen in user-specific task directory. In that
Game Explorer.
reference (4). folder, you should create the tasks that
Step 3: Embed Bitmaps and GDFs could be done with the game.
Step 3: Call function “VerifyAccess”
After creating the GDF and Bitmap files, in the IGameExplorer Eyas Sharaiha
you can now embed them all together.
The GDF files and bitmap files used by The function VerifyAccess must be
Game Explorer cannot be independent called from the IGameExplorer COM References
object. It will check if the game has 1. Main Page,
files that are simply installed into your
http://msdn2.microsoft.com/en-
game directory along with the rest of permission to run on the current user us/library/ms687240.aspx
the game files. They must be embedded account. As seen in reference (5). 2. Defined constants of GameUx.h,
as resources, either into an executable http://msdn2.microsoft.com/en-
Step 4: Call function “AddGame” in us/library/ms687210.aspx
file, or a DLL.
the IGameExplorer 3. GDF file schema,
The Game Explorer header (GameUx.h) http://msdn2.microsoft.com/en-
The function AddGame must be called us/library/ms687239.aspx
contains defined constants that you 4. IGameExplorer COM,
from the IGameExplorer COM object.
must use in the resource script to http://msdn2.microsoft.com/en-
You must call AddGame with the path to
identify your GDF file and bitmap file so us/library/ms687221.aspx
your GDF resource, base install path, 5. Verify Access,
that the Game Explorer can find them.
and install scope, and optionally an http://msdn2.microsoft.com/en-
By separating the resource script into
InstanceID GUID. us/library/ms687229.aspx
#ifdef sections for multiple languages, 6. AddGame,
you can instruct Game Explorer to The add game function has the http://msdn2.microsoft.com/en-
search for localized versions of GDF files following syntax: us/library/ms687225.aspx
and bitmaps. 7. Game Explorer Tasks,
HRESULT AddGame( http://msdn2.microsoft.com/en-
us/library/ms687246.aspx
Adding the Game from the const BSTR bstrGDFBinaryPath,
const BSTR 8. Registry information (XP),
Installer bstrGameInstallDirectory, http://msdn2.microsoft.com/en-
GAME_INSTALL_SCOPE us/library/ms687245.aspx
Step 1: Install the game files installScope, 9. Create Game Task Folders,
GUID* pguidInstanceID http://msdn2.microsoft.com/en-
); us/library/ms687246.aspx

April, 2007 19 | P a g e
Tutorial

PROGRAMMING TUTORIAL

C++ “Hello World” tutorial normal. The important thing is knowing now, but most functions return values
C++ is one of the most popular
that the line of code "int main()" of some sort, so the return itself is used
programming languages out there, but
initializes the code. It is in this function to mark the end of a function.
learning can be a tedious process.
that all the actions occur.
Since we really do not need to return
One of the first things anyone learning
Many also like to use: any value, let’s just choose to return
C++ should know is outputting text.
“0”:
Unlike more recent software, no void main()
function exists in C++ “as is” that could return 0;
display text; instead, you need include But I personally – for some weird reason
“libraries” that would introduce such – prefer using int, so that’s how we’re Final Code Form
functions and capabilities. going to continue. #include <iostream>
int main() {
To start the tutorial, open a new C++ The curled brackets you saw earlier std::cout << "Hello World!!\n";
project, and start working on the main define the beginning and ending of a return 0;
}
.cpp file. (Need a development tool? block of code. All the code that we will
Try Microsoft Visual C++ 2005 Express perform in this tutorial must be in the
Edition SP1, you can get it from int main() block of code. Running the code
http://msdn.microsoft.com/vstudio/express
The actual code to output the “Hello You can build the C++ project or you
and, it’s totally free!)
world!” text is: can use the Debug function to run it.
Note: in Visual C++ 2005 Express
The Code std::cout << "Hello World!!\n"; Edition, you will not get a "Press Any
The very first thing you should include is Key to Continue . . ." message, and the
The “std::cout<<” is the command that program ends instantly if it is run in
Input/output stream that would allow
tells the computer to output text. The debug mode, therefore you will see no
you to output text. In older versions of
text written later must be a “string” – so result. To fix that, click on the Debug
C++, you could include a header file (.h
text and numbers should be surrounded menu on top, and then click on the
file) that would give you these
by quotation marks. menu item "Start Without Debugging".
functions, but now it is done differently:
The final “\n” you see at the end defines
#include <iostream>
a new line, similar to the Enter Key we
End Result
use when typing text in notepad or
To start giving out instructions to output When running the program, you should
word. If this wasn’t use, the “Insert any
the text, you should first initialize the see the following:
key to continue” text that is normally
main function that would execute the
automatically outputted by C++ would Hello World!!
actual code. You could do so by typing:
be right next to the “!!” in the text you Press any key to continue . . .
int main() { outputted.
… However, if you have omitted the “\n”
} Another important thing is that all (newline) at the end of the code, as
instructions must end with a semicolon stated earlier, you would see:
The "int" stands for integer. That means (;), otherwise an error is outputted.
"int" initializes the function main()’s Hello World!!Press any key to
Finally, to conclude the function “main”, continue . . .
returned value as an integer. This might
be hard to understand when you first we need to write a return instruction,
Eyas Sharaiha
start programming C++, but that's this might seem pretty meaningless

P a g e | 20 http://markup.gmking.org
gmpedia.org
forums.gmking.org
openload.info
ircbloopers.com
gmking.org
irc://irc.gamemaking.org/#gmking

April, 2007 21 | P a g e

Das könnte Ihnen auch gefallen