<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Digital Worlds - Interactive Media and Game Design &#187; mazegame</title>
	<atom:link href="http://digitalworlds.wordpress.com/tag/mazegame/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitalworlds.wordpress.com</link>
	<description>A blogged course production experiment...</description>
	<lastBuildDate>Tue, 05 May 2009 17:04:48 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/5d1337ec59d87821e9538254dc8683e8?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Digital Worlds - Interactive Media and Game Design &#187; mazegame</title>
		<link>http://digitalworlds.wordpress.com</link>
	</image>
			<item>
		<title>Finishing the Maze &#8211; Adding Background Music</title>
		<link>http://digitalworlds.wordpress.com/2008/03/25/finishing-the-maze-adding-background-music/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/25/finishing-the-maze-adding-background-music/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 12:55:23 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[background music]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[sound design]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=47</guid>
		<description><![CDATA[To round off the  tidying up of the maze game, it&#8217;s probably worth revisiting the aural dimension. Sound design is a major factor in the early success or otherwise of many computer games (none more so than audiosurf &#8211; fancy riding Song 2? Woo hoo&#8230;;-)  and one that we have only paid passing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=47&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To round off the  tidying up of the maze game, it&#8217;s probably worth revisiting the aural dimension. Sound design is a major factor in the early success or otherwise of many computer games (none more so than <a href="http://www.audio-surf.com/">audiosurf</a> &#8211; fancy riding <a href="http://audiosurfvideos.com/videos/view/8/">Song 2</a>? Woo hoo&#8230;;-)  and one that we have only paid passing reference to in the design of the maze game so far.</p>
<p>There are three main components to the sound design of a game.</p>
<p>Firstly, there is the <em>background musical soundtrack</em>. In many driving games, this may be contextualised by an in-car radio player (the Grand Theft Auto series has a <a href="http://radio.about.com/library/weekly/aa010503a.htm">prime example</a> of this), but often the soundtrack has more in common with the background music of a film. The way that the background music can be used to set the emotional tone of a scene and its potential effect on setting the mood of the player should not be underestimated.</p>
<p>The second component relates to <em>sound corresponding to foreground events</em>. The player character saying &#8220;ouch&#8221; if attacked by a monster, or an audible reward to complement the collection of a treasure item.</p>
<p>These sounds are typically triggered by actions performed in response to a particular event being raised by object interactions within the game, in contrast to the background music which plays &#8216;just anyway&#8217;.</p>
<p>The third component is <em>incidental background noise</em>. This corresponds to the everyday background noise that &#8216;thickens&#8217; a scene and adds depth and character to it.</p>
<p>Hopefully, you have already added some sounds to your game, for example to reinforce the collection of a diamond, the capture of the player character by a monster, the unlocking of a door, or the completion of a room by reaching the door.</p>
<p>(As well as the sound files in the game Maker maze tutorial folder, you can find additional sounds on the Game Maker site: <a href="http://www.yoyogames.com/resources/browse/4">Game Maker resources: sounds</a>.)</p>
<h3>Adding background music</h3>
<p>To complete the game, we are going to add some background music.</p>
<p>There are two ways of doing this: use a MIDI file, or use an audio file.</p>
<ul>
<li><em>MIDI  background track</em>: MIDI (&#8221;Musical Instrument Digital Interface&#8221;) is a protocol (that is, a conventional language) that was originally used to connect physical music synthesizers (that is, digital music keyboards!) together. MIDI is increasingly used to &#8216;program&#8217; music that is played by an audio synthesiser to create a musical background track. A MIDI file essentially instructs a synthesizer (sound generator) what sound to play, when, and for how long. Most computers today have a sound card that is capable of generating sounds from a MIDI file.</li>
<li><em>audio background track</em>: an audio file is just a recording of a sound. Game maker can play two different sorts of audio file: WAV files (simple digital recordings of of sound); and MP3 files (compressed audio files; that is, audio files that have been digitally manipulated so as to take up less memory space in a computer.)</li>
</ul>
<p>Audio files are best used for foreground sounds &#8211; sounds used to denote a collision event within the game for example. WAV files, whilst being larger than MP3 files, can be played directly. In comparison, MP3 files must be uncompressed before they are played, which takes up computer processor time (time which may be better spent actually managing the computer game, looking for collision events and keyboard button presses, for example).</p>
<p>The smaller MIDI files are better suited to ongoing background music. Often, a computer&#8217;s audio card will manage the playback of the sound from the MIDI file.</p>
<p>To load music in to the game, select <em>Create Sound</em> from the Resources menu.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2361225014/"><img src="http://farm3.static.flickr.com/2372/2361225014_2336924b08.jpg" /></a></p>
<p>To use a MIDI file for the background music, select  &#8216;Background music&#8217;; to play an MP3 or WAV music file, select the &#8216;Use multimedia player&#8217; option.</p>
<p>The background music should be started from the Create event of a spriteless controller object added to the room, and set to loop.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2360413263/"><img src="http://farm3.static.flickr.com/2016/2360413263_c746b95c2f.jpg" /></a></p>
<p>If you do use a music file that his played via a multimedia player, you should preload it so that loading it does not slow the game down as once it is being played. However, for large audio files, the memory requirements of preloading the audio file may affect the performance of the game.</p>
<p>When using audio files you should take care that copyright licenses are not being infringed, particularly if you intend to distribute the game or even share it with other people.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/47/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/47/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=47&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/25/finishing-the-maze-adding-background-music/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2372/2361225014_2336924b08.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2016/2360413263_c746b95c2f.jpg" medium="image" />
	</item>
		<item>
		<title>Improving the Visual Design of a Room &#8211; Tilesets</title>
		<link>http://digitalworlds.wordpress.com/2008/03/22/improving-the-visual-design-of-a-room-tilesets/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/22/improving-the-visual-design-of-a-room-tilesets/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 13:55:48 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[tilesets]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=43</guid>
		<description><![CDATA[Visually, our simple maze game leaves a lot to be desired. The design of the walls is not particularly appealing, for example, or realistic in anything but the most stylised of senses.
In this post, I&#8217;ll look at how to add a bit of visual flair to the maze, giving the walls a mock 3D look [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=43&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Visually, our simple maze game leaves a lot to be desired. The design of the walls is not particularly appealing, for example, or realistic in anything but the most stylised of senses.</p>
<p>In this post, I&#8217;ll look at how to add a bit of visual flair to the maze, giving the walls a mock 3D look (actually, an <em>isometric</em> view).</p>
<p>To do this, we&#8217;re going to use a <em>tileset</em>. <em>Tiles</em> are small, regularly sized images, such as we have used in our sprites so far; (each image in a sprite might be considered a tile, for example).</p>
<p>A tileset is a single bitmap image that contains a mosaic of several separate, similarly sized tiles, each designed in accordance with a particular theme and with the intention that they are used in association with each other. Tiles are organised in rows within the single bitmap image.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351967330/"><img src="http://farm4.static.flickr.com/3176/2351967330_12efc515a1.jpg" /></a></p>
<p>The tileset thus provides a convenient way of packaging several images in a single file and reusing them within an environment such as Game Maker.</p>
<p>To create the (hopefully) good looking version of the maze, you will make all the walls invisible, and add in a background image layer to the game. The background image is drawn in such a way that things that <em>look like</em> walls are placed on the background image underneath the <em>actual</em>, invisible (and &#8217;solid&#8217;) wall objects.</p>
<p>It may feel as if there is some trickery going on here &#8211; and indeed there is! The background image, which will depict the walls, plays no tangible part on the execution of the game. When the player character &#8216;collides&#8217; with the background drawn wall image, no event will be raised. Instead, solid, invisible wall objects placed &#8216;on top of&#8217; the background drawn walls will provide an obstacle to the player character, will raise an appropriate event and may execute appropriate actions.</p>
<p>Save a copy of your game as it currently stands, for reference purposes, and then save it again using a new name &#8211; this will be your new working copy of the game. In the wall object, change the sprite to . You should still be able to see where the wall objects are in your room(s) because they will be depicted by question marks.</p>
<p>Now you need to draw in the walls using tiles from an appropriate tile set shown &#8211; like this:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351985342/"><img src="http://farm4.static.flickr.com/3119/2351985342_442813a901.jpg" /></a></p>
<p>Save the tileset file to your desktop or Game Maker folder from the following link: <a href="http://blogs.open.ac.uk/Maths/ajh59/walls1.bmp">Walls Tileset</a> (right click, Save As&#8230;)</p>
<p>To load the tileset in to Game Maker, select <em>Create background</em> from the <em>Resources</em> menu, select <em>Load Background</em> and load in the tileset image file that you saved to your computer.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351158853/"><img src="http://farm4.static.flickr.com/3062/2351158853_815c4d0a7e.jpg" /></a></p>
<p>In order to actually use the image as a tileset select &#8216;Use as Tileset&#8217; in the Background properties dialogue. The tile width and<br />
the tile height should both be set to 32. The image should also be set to Transparent.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351989190/"><img src="http://farm4.static.flickr.com/3174/2351989190_6116b05115.jpg" /></a></p>
<p>Using Game Maker in Advanced Mode (set via the File menu &#8211; remember to save your game and reload it if you need to change to<br />
Advanced mode from Simple Mode), open up a room and select the Tiles tab from within the Room Properties window. You can<br />
now select any of the tiles and add them to the room.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351207231/"><img src="http://farm3.static.flickr.com/2207/2351207231_c8b4cfcf66.jpg" /></a></p>
<p>Using the &#8216;invisible&#8217; wall objects as a guide, add appropriate wall-image blocks from the tileset (just select the image you want from the Tiles tab and then click in the room where you want that image to appear. Only add wall images at this point (don&#8217;t bother with any grass!)</p>
<p>By carefully changing the view properties of the room, you can toggle between the background view and the view of the room containing the wall objects:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351165951/"><img src="http://farm4.static.flickr.com/3075/2351165951_4783f425d5.jpg" /></a> <a href="http://www.flickr.com/photos/25451952@N00/2351997438/"><img src="http://farm3.static.flickr.com/2222/2351997438_15b39ddb53.jpg" /></a></p>
<p>From the images shown above, you will see that as well as the walls, I have added a grass background to the room. This part ofd the background actually sits on a lower &#8216;layer&#8217; than the wall images. (Think back to how traditional cel animation works &#8211; frames are built up by drawing a background image and  detail that increasingly lies in the foreground is drawn on to transparent acetate sheets that are placed on top of the background and each other).</p>
<p>If you &#8220;deselect&#8221; the view of the Tiles, you can look at each layer separately:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351176221/"><img src="http://farm3.static.flickr.com/2018/2351176221_6eb971b754.jpg" /></a></p>
<p>Add additional layers by clicking on the <em>Add</em> button. You can change the layer number by clicking <em>Change</em>. The <em>higher</em> the layer number, the <em>further into the background</em> it is. (If you find that you have your layers the wrong way round, just change the layer number).</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2351175413/"><img src="http://farm3.static.flickr.com/2038/2351175413_803a27d336.jpg" /></a> <a href="http://www.flickr.com/photos/25451952@N00/2351178289/"><img src="http://farm4.static.flickr.com/3244/2351178289_cdef911c77.jpg" /></a></p>
<p>For the grass layer, you can cover the whole room &#8211; the wall images will sit above the grass. If the background/tile set is set to transparent, then the grass will show through at the ends and corners of the wall.</p>
<p>Even though we no longer want to see the wall sprite when we are playing the game, we still need to use that sprite within the wall object, albeit making it invisible (untick the <em>Visible</em> checkbox).</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2352018662/"><img src="http://farm3.static.flickr.com/2244/2352018662_5d2df009f2.jpg" /></a></p>
<p>There are two reasons for this: firstly, the boundary of the sprite identifies the collision area that is used to detect a collision and raise a collision event; secondly, it means we can see where we&#8217;ve drawn the wall when we are editing the room!</p>
<p>So &#8211; get to it ;-) See much better room looks once it has real walls?!</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2352033120/"><img src="http://farm3.static.flickr.com/2299/2352033120_7ee89d8269.jpg" /></a></p>
<p>You can find more information about using tiles from the Game Maker Help file (hint: search for &#8216;adding tiles&#8217;). Being able to locate and learn from sources of instruction  &#8211; such as Help files &#8211; is an important skill, and one that will enable you to get started with a wide variety of content generation tools that are available on the web.</p>
<p>If you want to explore the world of tilesets more fully, you can find more example tilesets on the Game Maker website: <a href="http://www.yoyogames.com/resources/browse/3">Tileset downloads</a>.</p>
<p>If you want to create and manage your own tilesets, download and install this <a href="http://www.yoyogames.com/downloads/resources/tilesetmaker.zip">Tileset Maker for Game Maker</a> (that&#8217;s where the tileset image I used in this post actually came from&#8230;)</p>
<p>To recap: a tileset is a single image that contains a mosaic of regular, smaller images that have been designed to complement each other. When a tileset is loaded as such, the single tileset image is essentially &#8216;cut&#8217; into a multitude of separate images that can each be used separately.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=43&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/22/improving-the-visual-design-of-a-room-tilesets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3176/2351967330_12efc515a1.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3119/2351985342_442813a901.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3062/2351158853_815c4d0a7e.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3174/2351989190_6116b05115.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2207/2351207231_c8b4cfcf66.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3075/2351165951_4783f425d5.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2222/2351997438_15b39ddb53.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2018/2351176221_6eb971b754.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2038/2351175413_803a27d336.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3244/2351178289_cdef911c77.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2244/2352018662_5d2df009f2.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2299/2352033120_7ee89d8269.jpg" medium="image" />
	</item>
		<item>
		<title>Improving the Visual Design of a Game &#8211; Better Sprite Design</title>
		<link>http://digitalworlds.wordpress.com/2008/03/21/improving-the-visual-design-of-a-game-better-sprite-design/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/21/improving-the-visual-design-of-a-game-better-sprite-design/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 19:54:11 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=41</guid>
		<description><![CDATA[So far, we have been using single image sprites in our games. However, sprites offer much more potential than this. In particular, sprites typically contain several images that can be used to animate the motion of a character. Each &#8216;frame&#8217; in the sprite animation is displayed in turn to give the appearance of motion (similar [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=41&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So far, we have been using single image sprites in our games. However, sprites offer much more potential than this. In particular, sprites typically contain several images that can be used to animate the motion of a character. Each &#8216;frame&#8217; in the sprite animation is displayed in turn to give the appearance of motion (similar to the way an animated gif actually &#8216;contains&#8217; several images that are displayed in sequence). However, it is also possible to select and display just a <em>single</em> frame image from within the sprite at any particular time, as you will discover&#8230;</p>
<p>In particular, you are going to animate your player character so that as it moves, it appears to be looking in the direction it is traveling.</p>
<p>Save your game, and then save it again with a new name to create a new version of it. Click on the player sprite and load in the new sprite <em>playerNice.gif</em> from the maze game resources folder.</p>
<p>In the Sprite Properties window, you should see that the sprite contains several image frames that you can click through.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2349810221/"><img src="http://farm3.static.flickr.com/2364/2349810221_0f8d6ec9ae.jpg" /></a></p>
<p>Opening the Image Editor makes the compound, packaging nature of the sprite even more evident.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2350645344/"><img src="http://farm3.static.flickr.com/2364/2350645344_526bf2996c.jpg" /></a></p>
<p>The separate frames may be used to animate a character so that it appears to move (for example, animating a character&#8217;s legs so that it appears to be walking or running, or animating a fire so that it appears to be burning) or simply be used as separate, static images to change the (fixed) view of a character depending on what it is doing at any particular time. </p>
<p>The player sprite you have just loaded will be used to animate the player character in this second sense. That is, rather than animating the character so that it appears to move, we shall animate it so that the view we have of it is depnedent on what it is doing.</p>
<p>As the game originally stood, even though the player character could move in one of four different directions, it always looked the same. that is, it never &#8216;really&#8217; looked where it was going. If you clicked through the sprite images, you should have seen that the sprite depicts four faces of the player character &#8211; left facing , forward facing, right facing and backward facing.</p>
<p>To set the subimage that is displayed when the player character changes direction, you will need to add and a Change Sprite action from the Sprite panel on the <em>main1</em> actions tab to each of the keyboard events associated with the player object.</p>
<p>By way of example, for the left arrow, add the Change Sprite action and configure it as follows: select the player sprite, select the appropriate subimage (click through the subimages with the Sprite Editor menu to identify the correct one) and set the speed to 0. (The speed here corresponds to the speed at which each of the images contained within the sprite are cycled through; because we are not using the sprite images as &#8216;free running&#8217; animation frames, we don&#8217;t want Game Maker to cycle through them for us each time the character is redrawn, so we set the speed to zero.) </p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2350645344/"><img src="http://farm3.static.flickr.com/2364/2350645344_526bf2996c.jpg" /></a></p>
<p>Run your game. <em>How much more &#8216;realistic&#8217; is the behaviour of the player character now?</em></p>
<p>If you are feeling particularly creative, have a go at editing the player sprite, for example by changing the colour &#8211; or &#8220;cut&#8221; &#8211; of its clothes. <em>Sprite design is just one of the many tasks required of graphic artists in the games industry. Would you have what it takes to become a sprite designer? What skills do you think are required?</em>.</p>
<p><em>If you are using the movement scheme in which the player character only moves whilst a key is being pressed, which sprite subimage works best when no key is pressed? What happens if you do not use the Set Sprite action at all in this case?</em></p>
<p>If you did not set the sprite subimage for the  event, you may have found that the sprite appears to spin round when you are not pressing any keys. To keep the sprite facing the direction it was facing in previously in this case, you should set the sprite within the person create event to an appropriate subimage of the person sprite and with speed zero. The speed setting here is crucial. Setting the sprite&#8217;s image changing speed to zero here means that the sprite image will be essentially fixed, unless the speed is set to a non-zero positive value elsewhere.</p>
<p>With a little imagination, sprites can be used to provide a &#8216;context sensitive&#8217; view of a character. If you think back to the original Pacman game, the view of the player character depending on which direction it was facing, and the colour of the ghosts changed depending on whether they were in &#8220;fight&#8221; mode &#8211; when they could kill the player character &#8211; or &#8220;flight&#8221; mode &#8211; when, after eating a particular piece of fruit, the player character had a period of grace in which it could attack the ghosts and send them back to the pen in the centre of the room.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=41&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/21/improving-the-visual-design-of-a-game-better-sprite-design/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2364/2349810221_0f8d6ec9ae.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2364/2350645344_526bf2996c.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2364/2350645344_526bf2996c.jpg" medium="image" />
	</item>
		<item>
		<title>Just Rewards: Collecting Diamonds, Unlocking Doors</title>
		<link>http://digitalworlds.wordpress.com/2008/03/21/just-rewards-collecting-diamonds-unlocking-doors/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/21/just-rewards-collecting-diamonds-unlocking-doors/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 01:02:00 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[obstacles]]></category>
		<category><![CDATA[points]]></category>
		<category><![CDATA[treasure]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=37</guid>
		<description><![CDATA[Many maze games involve the collection of point scoring treasure. In our maze, we shall require the player character to collect diamonds, and receive points in exchange for them.
Create a diamond sprite (use the diamond.gif image in the Resources folder) and use it to depict a diamond object (obj_diamond).

Now think about what you want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=37&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Many maze games involve the collection of point scoring treasure. In our maze, we shall require the player character to collect diamonds, and receive points in exchange for them.</p>
<p>Create a diamond sprite (use the diamond.gif image in the Resources folder) and use it to depict a diamond object (<code>obj_diamond</code>).</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348065139/"><img src="http://farm4.static.flickr.com/3248/2348065139_a67f85fb79.jpg" /></a></p>
<p>Now think about what you want to happen when the player collides with the diamond. I can think of two <em>essential</em> actions and at least one <em>nice-to-have</em>.</p>
<p><em>What actions do you think are required?</em> [Think about it... ;-)]</p>
<p>When the player character collides with a diamond, we need to increment the player&#8217;s score, and make the diamond disappear. I think it would also be nice to provide an audible reward when a diamond is collected, by playing a sound.</p>
<p>The simplest way of adding these actions is to create a collision event for the diamond object that detects a collision by the player object, and then:</p>
<ul>
<li>increments the score;</li>
<li>plays a sound (remember &#8211; you&#8217;ll need to add one to the library first!)</li>
<li>and then destroys the current (self) diamond object instance (so we can&#8217;t keep collecting the same diamond again and again, <em>ad infinitum</em>, and racking up a very high, if tediously achieved, high score!).</li>
</ul>
<p>Alternatively, you could set a single action for the collision event that destroys the diamond object instance, and then use a Destroy event <em>within the diamond object</em> to trigger the score and sound actions.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348900136/"><img src="http://farm4.static.flickr.com/3106/2348900136_c6447ed003.jpg" /></a></p>
<p>Try adding some instances of diamonds to at least one of the rooms. <em>Does the opportunity to collect treasure affect the way that you guide your player character through the room?</em></p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348919664/"><img src="http://farm3.static.flickr.com/2374/2348919664_78714b5e9b.jpg" /></a></p>
<p>If you have any monsters in the room, try to arrange the position of some of them so that they guard a particular diamond. Is it possible to position the monsters in such a way that it makes it impossible for the player character to acquire a particular diamond? If so, <em>how do you think this will make the player feel?</em></p>
<p><em>Can you position the monsters so that some diamonds are more difficult to reach than others?</em></p>
<p>If some diamonds are guarded by monsters in such a way that the player character feels that there are quite likely to risk losing a life collecting a particular diamond, they may decide to forgo it and not even attempt to collect it. <em>How could you motivate &#8211; or even compel &#8211; the player to try to collect all the treasure items in the room, or at least a certain minimum number of them?</em></p>
<h3>Blocking progress to the next level until a challenge is completed</h3>
<p>A common theme in many early maze games was to block the player from exiting the room and moving onto the next one until <em>all</em> the treasure items had been collected. One widely used metaphor was to provide a &#8220;locked door&#8221; that barred the way to the next level and that could only be opened by the player collecting all the treasure items. (Alternatively, the player might have to collect a single magic key from somewhere within the level in order to open the door.)</p>
<p><em>Write down a brief specification of what objects, sprites, events and actions actions you think you need in order to implement a locked door that blocks access to the way out of a room, and that can only be opened (destroyed?) once you have collected all the diamonds in the room.</em></p>
<p>Here&#8217;s one way of approaching the problem: &#8220;every time the player collides with a diamond, <em>after</em> destroying the diamond object (an action that is executed when the &#8216;Collide with player&#8217; event is within the diamond object) test to see whether the count the of the number of instances of the diamond object is zero; if it is, destroy the door&#8221;.</p>
<ul>
<li>create a new door sprite (<code>spr_door</code>) by copying the wall sprite, and changing the colour (refer back to <a href="http://digitalworlds.wordpress.com/2008/03/08/editing-a-sprite/">Editing a Sprite</a> if you can&#8217;t remember how to do this); add the door to the maze so that it blocks access to the exit;</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348916844/"><img src="http://farm4.static.flickr.com/3056/2348916844_378fd69128.jpg" /></a></li>
<li>copy the wall object to create a new door object (<code>obj_door</code>) and use the door sprite to represent it;
<p><a href="http://www.flickr.com/photos/25451952@N00/2348891048/"><img src="http://farm3.static.flickr.com/2315/2348891048_615ce029c2.jpg" /></a></li>
<li>add a Test Instance Count action from the Questions panel of the control tab, and configure its properties so that it will test whether the number of instances of the diamond object is equal to zero; as the very next action (the action that will be performed if the diamond instance count <em>is</em> zero) use a Destroy event from the Objects panel of the main1 tab configured to destroy instances of the object <code>obj_door</code>.
<p><a href="http://www.flickr.com/photos/25451952@N00/2348062245/"><img src="http://farm3.static.flickr.com/2276/2348062245_fb41c1a667.jpg" /></a></li>
</ul>
<p>The first Destroy action should destroy the &#8220;self&#8221; diamond object instance. The second Destroy action &#8211; which is executed if the previous conditional statement evaluates as true (that is, if there are zero instances of the diamond object) should apply to the door object:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348077395/"><img src="http://farm3.static.flickr.com/2264/2348077395_986f1eab92.jpg" /></a></p>
<p>You might also find that the experience of the game is improved if you give an audible signal to the player when the goal of unlocking the door has been achieved.</p>
<p>Try running your program. <em>Does the door disappear when you have collected all the diamond objects? What would happen if you had several door instances in the room?</em> </p>
<p><em>How do you think you might extend the game further so that a locked iron door barring the way out of the room can only be unlocked by collecting a rare &#8216;red diamond&#8217; placed somewhere within the room? Suppose further that access to the red diamond is blocked by a different sort of door that can only be opened by collecting at least three &#8216;ordinary&#8217; diamonds.</em></p>
<h3>Achieving the same thing, but differently&#8230;</h3>
<p>One of the attractive features of Game Maker (depending on your point of view!) is that there are often several ways of achieving the same thing. In the previous section, we used the player collision event within the diamond object to open the door when the diamond count in the room hit zero. Alternatively, we could have used an action within the door object to achieve the same thing. In this case however, we would apply the destroy action to the self object if the diamond  count equalled zero. In order to test the diamond count regularly, we would need to place it within a Step event in the door object.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2348070445/"><img src="http://farm3.static.flickr.com/2118/2348070445_043a032fd6.jpg" /></a></p>
<p>To understand how the Step event works, you need to understand a little about how Game Maker operates when a game is played. Essentially,  many times a second, Game Maker looks in turn at each instance of each object within the current room, testing each event as it does so. If the event is true, then the actions for that event are performed.</p>
<p>The Step event is simply an event that says &#8216;each time you test me, then perform the actions associated with me&#8217;. In this way, every time Game Maker &#8216;looks&#8217; at the state of the door object, it will run the actions performed with the step event, and test how many instances there are of the diamiond object in the room&#8230;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=37&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/21/just-rewards-collecting-diamonds-unlocking-doors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3248/2348065139_a67f85fb79.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3106/2348900136_c6447ed003.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2374/2348919664_78714b5e9b.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3056/2348916844_378fd69128.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2315/2348891048_615ce029c2.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2276/2348062245_fb41c1a667.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2264/2348077395_986f1eab92.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2118/2348070445_043a032fd6.jpg" medium="image" />
	</item>
		<item>
		<title>Three Lives, Then You&#8217;re Out&#8230;</title>
		<link>http://digitalworlds.wordpress.com/2008/03/19/three-lives-then-youre-out/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/19/three-lives-then-youre-out/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 15:28:20 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[lives]]></category>
		<category><![CDATA[mazegame]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=35</guid>
		<description><![CDATA[If you were unfortunate enough to be caught by one of the monsters in the game, you may have found it rather unsatisfying to have the game immediately end &#8211; you may have had the feeling that a slip of the keys was to game, or a miscalculation about the speed of the monster that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=35&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you were unfortunate enough to be caught by one of the monsters in the game, you may have found it rather unsatisfying to have the game immediately end &#8211; you may have had the feeling that a slip of the keys was to game, or a miscalculation about the speed of the monster that you won&#8217;t fall for again.</p>
<p>The majority of arcade style games in which the player character can be &#8220;killed&#8221; offer the player the chance to play again. So common is the idea of &#8220;three lives <em>then</em> you&#8217;re out&#8221; that it could almost be described as a convention &#8211; and something that players will expect the game to offer.</p>
<p>So how can we introduce the notion of lives into our maze game?</p>
<p>As in <a href="http://digitalworlds.wordpress.com/2008/03/11/whos-best-keeping-track-of-high-scores/">Who’s Best? Keeping Track of High Scores</a> and <a href="http://digitalworlds.wordpress.com/2008/03/12/upping-the-stakes-bonus-points/">Upping the Stakes &#8211; Bonus Points</a>, we will call on a controller object to manage the lives of our player character. Create a new controller object (<code>controller_lives</code>, for example; no sprite required) and add the following events:</p>
<p>- from the Event Selector, choose Other and then Draw Lives. You will need to add two actions to this event: Display a message (&#8221;You lost *all* your lives!&#8221;,maybe?!), which can be found in the Info panel of the main2 actions tab; and an End Game action, from the Game panel of the same tab;</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2346776142/"><img src="http://farm3.static.flickr.com/2028/2346776142_40ae012ec9.jpg" /></a></p>
<p>- again from the Event Selector, choose Draw, and add the Draw the lives as image action from the score actions tab. Double click on the Draw the lives as image action to raise it properties dialogue, and put in the co-ordinates of where you would like the lives counter to appear on the screen. Select an appropriate image for the life counter (for 3 lives, 3 images will show&#8230;)</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2346777832/"><img src="http://farm3.static.flickr.com/2411/2346777832_e50e5e697b.jpg" /></a></p>
<p>Now add the controller object to the room (it doesn&#8217;t really matter where). The controller object will manage what happens when you lose a life, or when your lives run out. But how do we get our lives in the first place? And how do we lose them?</p>
<p>In the player object (<code>obj_player</code>), add a Create event, containing the Set lives action from the score tab; set the number of lives to 3. When an instance of the player object is created, it will now be initialised with three lives.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2345951647/"><img src="http://farm4.static.flickr.com/3103/2345951647_4ff7bfe0fb.jpg" /></a></p>
<p>To lose a life, we need to revise what happens when a monster collides with the player character. Still referring to the player object, select the appropriate Collision Event, remove the End Game action (this is now being managed by the controller object), and add the following actions: Set Lives (from the score tab, and with the properties &#8220;relative to -1&#8243;); and Jump to Start (from the move tab).</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2346782160/"><img src="http://farm3.static.flickr.com/2409/2346782160_c5879e6694.jpg" /></a></p>
<p>Run your game. Hopefully, you should find that you now get three chances to cross the room. If a monster catches you, your player character is returned to the point at which it entered the room.</p>
<p>Does the addition of multiple lives improve the playability of the game. I certainly found it less frustrating when I got caught, knowing that I&#8217;d be able to have another go (having possibly worked out how to get round a particularly trickily placed monster!)</p>
<p><em>How important is the number of lives that a player is given? Why do you think the game might be less satisfying if the player had four or five lives, for example?</em></p>
<p>As well as losing something &#8211; lives in this case! &#8211; we also want our player character to be rewarded in some way as they progress through a room, so that the player can gain some sort of points scoring reward even if they don&#8217;t manage to cross the room completely.</p>
<p>In the next post, I&#8217;ll show how to add some &#8216;treasure&#8217; to the room that will reward the player with points as they collect the treasure items.</p>
<p>In the meantime, <em>what do you think should happen when a player collects (i.e. collides with) a treasure object? What objects, sprites, events and actions will we need to add to the game in order to implement &#8220;treasure&#8221;? ;-)</em></p>
<p><s>[Screenshots missing - I will add them by first thing tomorrow morning...]</s></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=35&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/19/three-lives-then-youre-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2028/2346776142_40ae012ec9.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2411/2346777832_e50e5e697b.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3103/2345951647_4ff7bfe0fb.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2409/2346782160_c5879e6694.jpg" medium="image" />
	</item>
		<item>
		<title>Managing Monsters &#8211; Like Parent, Like, err, Child&#8230;</title>
		<link>http://digitalworlds.wordpress.com/2008/03/18/managing-monsters-like-parent-like-err-child/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/18/managing-monsters-like-parent-like-err-child/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 17:00:08 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[monsters]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=34</guid>
		<description><![CDATA[When you created added several monsters to the maze game that moved in different directions (Adding Monsters to the Maze Game), you may have found that you forgot to add an event to the player object that checked for a collision with am instance of a &#8220;vertical monster&#8221; object as well as an instance of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=34&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you created added several monsters to the maze game that moved in different directions (<a href="http://digitalworlds.wordpress.com/2008/03/16/adding-monsters-to-the-maze-game/">Adding Monsters to the Maze Game</a>), you may have found that you forgot to add an event to the player object that checked for a collision with am instance of a &#8220;vertical monster&#8221; object as well as an instance of the &#8220;horizontal monster&#8221; object. (If that is the case, the player would not have suffered any ill consequence of colliding with a vertically moving monster; to remedy this oversight (?!), you need to check for a collision with an <code>obj_verMonster</code> in the player object, and add a similar set of actions as used in the collision with an <code>obj_horMonster</code> event.)</p>
<p>If you have lots of objects that  are &#8216;variations on a theme&#8217; &#8211; such as the monster objects &#8211; it can become quite confusing trying to maintain separate collision detection events for each of them.</p>
<p>However, there is a technique we can use whereby objects can &#8216;inherit&#8217; certain properties from other &#8216;parent&#8217; objects, in such a way that allows them to be treated as those parent objects in certain respects.</p>
<p>(Objects, instances and inheritance are all ideas taken from computing/software engineering &#8211; in particular, the object oriented programming model. I&#8217;ll cover some of the basic nitty gritty in another post, but if you&#8217;re already familiar with the basic idea, and are feeling up to a challenge, you can maybe learn a bit more from this OpenLearn unit on <a href="http://openlearnigg.corank.com/tech/story/modelling-object-oriented-software-an-">Modelling object-oriented software – an introduction </a>.)</p>
<p>To make use of these &#8216;object inheritance&#8217; properties, you will need to run Gamemaker in Advanced mode. If you are not already in Advanced Mode (?!), save your current game, go to the File menu and select &#8216;Advanced Mode&#8217;. Gamemaker will close and open again with a new game, so you will need to open the game you just saved back in.</p>
<p>Delete the vertical monster object and the corresponding collision event from the player object and create a new &#8216;vertical monster&#8217; object. Give it an appropriate sprite. You should see that there are now several more options in the object editor now that we are in advanced mode. The one we are interested in at the moment is the <em>parent</em> property.</p>
<p>Set the parent of the vertical monster to be the horizontal monster.</p>
<p><a href="http://www.flickr.com/photos/psychemedia/2343662248/" title="Photo Sharing"><img src="http://farm3.static.flickr.com/2020/2343662248_7f07594f42.jpg" width="173" height="303"></a></p>
<p>If you were now to add the vertical monster to the game, it would behave in <em>exactly</em> the same way as the horizontal monster &#8211; it has inherited all its behavioural properties.</p>
<p><em>However</em>, we can override some of those properties by explicitly defining them within the vertical monster object. In this case, the property we want to override the direction the monster moves in, so add a Create event that sets the movement direction to be up or down, with a speed greater than that of the player object.</p>
<p><a href="http://www.flickr.com/photos/psychemedia/2343651552/" title="Photo Sharing"><img src="http://farm3.static.flickr.com/2187/2343651552_22b430857d.jpg" width="500" height="327"></a></p>
<p>We do not need to explicitly define the collision event between either the vertical monster and the wall, or the player object and the monster because the player essentially sees the vertical monster as a horizontal monster type and reacts to it as such.</p>
<p><em>With multiple monsters in your game, it is possible to set up many situations that may prove increasingly challenging for your player to negotiate. For example, see if you can set up a couple of rooms that are empty except for  five or six monsters that just move up or down, either all in a line, or maybe out of sequence with each other (start some of them at the top of the screen, others at the bottom, and so on). The challenge here is simply to cross the room&#8230; Are there any particular configurations of monsters that make this especially difficult to achieve? To what extent does increasing the speed of the monsters make it a more or less difficult task to cross the room?</em></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=34&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/18/managing-monsters-like-parent-like-err-child/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2020/2343662248_7f07594f42.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2187/2343651552_22b430857d.jpg" medium="image" />
	</item>
		<item>
		<title>Adding Monsters to the Maze Game</title>
		<link>http://digitalworlds.wordpress.com/2008/03/16/adding-monsters-to-the-maze-game/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/16/adding-monsters-to-the-maze-game/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 12:03:19 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[monsters]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=31</guid>
		<description><![CDATA[Finding your way through a maze is a simple form of puzzle. In the previous post (&#8221;A Two Room Maze Game&#8220;) we looked at adding extra rooms to a maze game to provide a variety of different challenges to the player. In this post, we shall see how the introduction of an element of danger [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=31&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Finding your way through a maze is a simple form of puzzle. In the previous post (&#8221;<a href="http://digitalworlds.wordpress.com/2008/03/15/a-two-room-maze-game/">A Two Room Maze Game</a>&#8220;) we looked at adding extra rooms to a maze game to provide a variety of different challenges to the player. In this post, we shall see how the introduction of an element of danger &#8211; in the form of &#8220;monsters&#8221; that can kill your player character &#8211; can spice up your game.</p>
<p>To begin with, we shall create a monster that just moves horizontally, from side to side, so that it can patrol a particular area of the the maze.</p>
<p>Create a new sprite &#8211; <code>spr_horMonster</code> for example &#8211; and load it with an appropriate image. Use this sprite with a new object &#8211; <code>obj_horMonster</code>, for example.</p>
<p>Configure the object as follows:</p>
<ul>
<li>Add a Create event to the monster object that triggers a <em>Move</em> action, choosing either left or right directions (or both!) and setting the speed slightly faster than that of the player character.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2337425216/"><img src="http://farm3.static.flickr.com/2352/2337425216_d088a167fb.jpg" /></a></li>
<li>Add a Collision event to the monster object that will cause the monster to bounce when it collides with a wall object.
<p><a href="http://www.flickr.com/photos/25451952@N00/2336592801/"><img src="http://farm4.static.flickr.com/3126/2336592801_6f0542d3f1.jpg" /></a></li>
<li>When the player bumps into the monster, the player character should scream out loud, the game will display a message, and the game should come to an end.<br />
<a href="http://www.flickr.com/photos/25451952@N00/2336595325/"><img src="http://farm3.static.flickr.com/2001/2336595325_74ae7e43be.jpg" /></a></li>
<li>For the scream, create a new sound, name it appropriately, and load in an appropriate sound file. In the player object, add an event that detects a collision with the monster object. For the first action, play the scream. The second action should display a message &#8211; such as &#8220;The monster caught you!&#8221;.<br />
<a href="http://www.flickr.com/photos/25451952@N00/2337438696/"><img src="http://farm3.static.flickr.com/2239/2337438696_8300e2d424.jpg" /></a></li>
<li>Finally, add the End Game action to stop the game.</li>
</ul>
<p>Place one or more monsters in the room and try out your game.</p>
<p><em>Is it a little bit more exciting now? More challenging, maybe? If necessary, modify the layout of walls within the room to provide runs for your monsters.</em></p>
<p><em>Experiment with the placement and speed of the monster(s) and see how it affects the difficulty of the game and your enjoyment of it. Do any particular configurations work particularly well? If you have a blog, why not take a screenshot or two to show the initial set up, and post them to your blog explaining why the configuration is effective.</em></p>
<p>[I use Jing to capture the screenshots used in this blog - <a href="http://jingproject.com">Jing</a>]</p>
<h3>Different monsters</h3>
<p>Duplicate the monster <em>object</em> and modify it so that it implements a monster type that moves vertically instead of horizontally (so you could maybe call this monster object <code>obj_verMonster</code>. (You will need to modify the start action so the monster starts to move in a vertical, rather than horizontal direction.)</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2336625169/"><img src="http://farm4.static.flickr.com/3223/2336625169_1190f615ac.jpg" /></a></p>
<p>Add one or more of these monsters to your room and try out the game now. <em>How do you need to modify the player object so that the vertically moving monsters (as well as the horizontally moving monsters) are capable of &#8220;attacking&#8221; the player character? Are there any particular ways of placing the wall objects and monsters to provide challenging situations for your player character to negotiate?</em></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=31&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/16/adding-monsters-to-the-maze-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2352/2337425216_d088a167fb.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3126/2336592801_6f0542d3f1.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2001/2336595325_74ae7e43be.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2239/2337438696_8300e2d424.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3223/2336625169_1190f615ac.jpg" medium="image" />
	</item>
		<item>
		<title>A Two Room Maze Game</title>
		<link>http://digitalworlds.wordpress.com/2008/03/15/a-two-room-maze-game/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/15/a-two-room-maze-game/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 14:51:23 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[maze]]></category>
		<category><![CDATA[mazegame]]></category>
		<category><![CDATA[multiple rooms]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=30</guid>
		<description><![CDATA[In Moving on With Game Maker &#8211; A Maze Game, we looked at a couple of ways of how to get a player character to move under keyboard control. 
Now it&#8217;s time to actually put a maze game together.
Defining Your Maze
If you played (or watched) the Pacman game, you&#8217;ll be familiar with the sort of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=30&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In <a href="http://digitalworlds.wordpress.com/2008/03/14/moving-on-with-game-maker-a-maze-game/">Moving on With Game Maker &#8211; A Maze Game</a>, we looked at a couple of ways of how to get a player character to move under keyboard control. </p>
<p>Now it&#8217;s time to actually put a maze game together.</p>
<h3>Defining Your Maze</h3>
<p>If you played (or watched) the Pacman game, you&#8217;ll be familiar with the sort of maze I&#8217;m thinking of when I talk of a maze game &#8211; a walled area, populated by treasure and monsters; the player character has to get to get the chequered flag, avoiding the monstaers and collecting as much treasure as possible.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2334340545/"><img src="http://farm3.static.flickr.com/2395/2334340545_38522ee329.jpg" /></a></p>
<p>We&#8217;ll also cover how to improve the aesthetics of the maze, to produce something like this, for example:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2335177806/"><img src="http://farm4.static.flickr.com/3223/2335177806_7c9a24f0d8.jpg" /></a></p>
<p>(The study of maze and labyrinth design is actually quite involved. For an introduction, see <a href="http://www.labyrinthos.net/typology.htm">An Introduction to the Typology of Labyrinths and Mazes</a> (<em>5 points for the first person to comment about what distinguishes a <strong>maze</strong> from a <strong>labyrinth</strong></em>;-))</p>
<p>With the room selected, add wall blocks to the room to create your maze. Place an instance of the player object at a start position within the maze and a goal object at the required end point within the maze.</p>
<p>In some games, there is the convention of leaving gaps in the the wall of the maze that correspond to that start and goal squares (that is, the entry to, and exit from points of the maze). We shall see later how a door can be added to the exit that bars further progress until it has been opened by completing a particular task.</p>
<p>Play the game. with the movement style and player speed you have selected, how easy is it to navigaet through the maze and get to the goal?</p>
<p>If you find you can&#8217;t get the player character to line up with the grid and get through narrow gaps in the wall, or it keeps getting stuck against the ends of the walls, add a <em>Check Grid Alignment</em> action to the player object before changing direction.</p>
<h3>Adding a second room</h3>
<p>It is possible to add a large number of rooms to your game and move from one to the next as you complete the challenge offered by each room. To create a second room for your maze game, simply select the Create Room option for a second time from the Game Maker Resources menu. Draw a maze using wall objects, and add the player object where you want it to enter the room, and a goal object where you want the player to leave the room.</p>
<p>One of the simplest ways of implementing the move from one room to another is to specify a particular goal within the first room, such that when the player character reaches it (that is, collides with it), the action moves to the next room.</p>
<p>In the goal object, inspect the collision event that tests for a collision with the player character. In the Main1 actions tab, you should see a set of actions relating to Rooms. Select the <em>Check Next</em> action.</p>
<p>This is a particular sort of action known as a conditional action. The action will test the state of the game world (in this case, to see if there is another room after the current room) and if the test succeeds then the next action will be executed. If the conditional test fails (there are no further rooms, for example, as may be the case when play is in the final room) then the next but one action (if any) will be executed next.</p>
<p>Configure the goal so that if there is another room the player moves to it, otherwise, end the game.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2334396197/"><img src="http://farm3.static.flickr.com/2165/2334396197_cebdbe4d6a.jpg" /></a></p>
<p>Add an instance of the goal object to the first room. When the player reaches the goal, play should move on to the next room.</p>
<p>Play the game &#8211; when you complete the first room, does the the player move to the second room? Does the game end when the goal in the second room is reached?</p>
<p>Without changing any of the objects, you can add as many rooms as you like, each describing a different maze (remember to add the player character where you want it to enter the room and the goal object at the exit). You can reorder the rooms by dragging and dropping them to rearrange them within the Rooms folder in the Game Maker sidebar.</p>
<p>Can you make one room more difficult than another, just by the way the walls are positioned?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=30&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/15/a-two-room-maze-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2395/2334340545_38522ee329.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3223/2335177806_7c9a24f0d8.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2165/2334396197_cebdbe4d6a.jpg" medium="image" />
	</item>
		<item>
		<title>Moving on With Game Maker &#8211; A Maze Game</title>
		<link>http://digitalworlds.wordpress.com/2008/03/14/moving-on-with-game-maker-a-maze-game/</link>
		<comments>http://digitalworlds.wordpress.com/2008/03/14/moving-on-with-game-maker-a-maze-game/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 23:31:11 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Game Maker]]></category>
		<category><![CDATA[mazegame]]></category>

		<guid isPermaLink="false">http://digitalworlds.wordpress.com/?p=28</guid>
		<description><![CDATA[The first game we looked at using Game Maker (&#8221;Catch a Clown&#8221;) was based very strongly on the First Game tutorial that can be found on the YoYo Games/Game Maker website.
The second game we shall look at is also inspired by an &#8220;official&#8221; Game Maker tutorial, although we&#8217;ll work through it in a slightly different [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=28&subd=digitalworlds&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <a href="http://digitalworlds.wordpress.com/2008/03/07/getting-started-with-game-maker/">first game we looked at using Game Maker</a> (&#8221;Catch a Clown&#8221;) was based very strongly on the First Game tutorial that can be found on the YoYo Games/Game Maker website.</p>
<p>The second game we shall look at is also inspired by an &#8220;official&#8221; Game Maker tutorial, although we&#8217;ll work through it in a slightly different way.</p>
<p>The original maze game tutorial assumes that there will be multiple rooms. I&#8217;ll start with a single room game and then show how to add additional rooms, as well as several other gameplay features that you may be familiar with if you have ever played classic arcade maze games such as Pacman.</p>
<p>To set the scene, you may wish to to relive old memories (if you&#8217;re as old as I am) <em>or</em> find out what the heck I&#8217;m talking about if you&#8217;re a member of the Google generation!</p>
<p>Play a quick game of <a href="http://www.freepacman.org/">Pacman</a> (try the arrow keys!) <em>Can you work out how the controls affect the direction of the player character? How are points scored in the game? What about bonus points and penalties? How many &#8216;modes of behaviour&#8217; do the ghost characters have, and what happens in each mode?</em></p>
<p>If you aren&#8217;t into arcade games, at least watch a quick run through of the game:</p>
<p><span style="text-align:center; display: block;"><a href="http://digitalworlds.wordpress.com/2008/03/14/moving-on-with-game-maker-a-maze-game/"><img src="http://img.youtube.com/vi/kGy8evJsK0s/2.jpg" alt="" /></a></span></p>
<p>In the <em>Catch a Clown</em> game, the clown sprites moved around the room of their own accord, changing direction whenever they bumped into a wall. In many games, the real player will control the movement of a player character within the game, either using keyboard commands or another physical input device such as a joystick or gamepad controller, (or if you have a bluetooth computer, maybe even a wiimote&#8230; but <em>that</em>&#8217;s for another day ;-)</p>
<h3>Danger Maze</h3>
<p>In this bundle of Game Maker activities, I&#8217;ll show you how to build a maze type game that is spread over several rooms, each of which may be populated by angry monsters or prizweworthy jewels! By taking control of the player character, the real player will have to find their way through each of the rooms, avoiding any monsters that may cross their path and collecting treasure wherever they can.</p>
<p>The audio and image assets used in the game can be found in the Maze Games Tutorial which can be found on the <a href="http://www.yoyogames.com/make/tutorials">Yoyo Games tutorial page</a>. (<a href="http://www.yoyogames.com/downloads/tutorials/maze.zip">Download the tutorial directly from here</a>).</p>
<p>To start with, we will construct a single room game, where the object is for the player to reach a special goal square, at which point a congratulatory message will pop up and the game will end.</p>
<p>Create three sprites (<code>spr_player</code>, <code>spr_wall</code> and <code>spr_goal</code>), and three objects corresponding to those sprites (<code>obj_player</code>, <code>obj_wall</code> and <code>obj_goal</code>) and configure them as follows:</p>
<ul>
<li>The wall object is empty of actions.</li>
<li>The goal object has collision event with player that raises a display message action: &#8220;Game Over&#8221; before ending the game after a short delay.</li>
</ul>
<p><a href="http://www.flickr.com/photos/25451952@N00/2333230805/"><img src="http://farm4.static.flickr.com/3195/2333230805_d2eecab275.jpg" /></a></p>
<p>In this first pass at our maze game, the player object is &#8211; if you will forgive the pun &#8211; where all the action is.</p>
<p>Let us think first of all what we want our player character to do. In response to particular key presses, we want the player character to move. But <em>how</em>?</p>
<p>There are two main ways of controlling the movement of the player character:</p>
<ol>
<li>the character can move while an appropriate key is pressed, <em>or</em></li>
<li>a key press may change the direction of a continuously moving player character.</li>
</ol>
<p>In the latter case, you may also want to specify the original moving direction of the player character when it is created, so that is starts moving as soon as you enter the room. To prevent the character from moving too far before the player gets a chance to decide for themself which direction they want the character to move in, you may wish to &#8216;trap&#8217; it so that it bounces between two wall blocks that are one or two squares apart.</p>
<p>You will also need to check the alignment of the player sprite with the grid before changing direction.</p>
<p>The original Game Maker tutorial describes the situation as follows:</p>
<blockquote><p>[The player character] must react to input from the user and it should not collide with a wall. We will use the arrow keys for movement. (This is natural, so easy for the player.) There are different ways in which we can make a person move. The easiest way is to move the player one cell in the indicated direction when the player pushed the arrow key. A second way &#8230; is that the person moves in a direction as long as the key is pressed. Another approach is to keep the player moving until another key is pressed (like in PacMan).</p>
<p>[First of all, let's consider the second way - the player character moves in an appropriate direction whilst a key is pressed, unless blocked by a wall.]</p>
<p>We need actions for all for arrow keys. The actions are rather trivial. They simply set the right direction of motion. (As speed we use 4.)</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2333246191/"><img src="http://farm4.static.flickr.com/3114/2333246191_a017ed75a1.jpg" /></a></p>
<p>To stop when the player releases the key we use the keyboard event for. Here we stop the motion. There is one complication though. We really want to keep the person aligned with the cells of the grid that forms the maze. Otherwise motion becomes rather difficult. E.g. you would have to stop at exactly the right position to move into a corridor.</p>
<p>This can be achieved as follows. In the control tab there is an action to test whether the object instance is aligned with a grid. Only if this is the case the next action is executed. We add it to each arrow key event and set the parameters to 32 because that is the grid size in our maze.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2334067952/"><img src="http://farm3.static.flickr.com/2063/2334067952_1321ce3fff.jpg" /></a></p>
<p>Moving the player critter &#8211; if you want to align the player critter with the grid, you will need to add the check grid action to each keyboard event before you change direction.</p>
<p>Clearly we also need to stop the motion when we hit a wall. So in the collision event for the person with the wall we put an action that stops the motion.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2333238803/"><img src="http://farm4.static.flickr.com/3131/2333238803_07750bd5fd.jpg" /></a></p>
<p>There is one thing you have to be careful about here. If your person&#8217;s sprite does not completely fill the cell, which is normally the case, it might happen that your character is not aligned with a grid cell when it collides with the wall. (To be precise, this happens when there is a border of size larger than the speed around the sprite image.) In this case the person will get stuck because it won&#8217;t react to the keys (because it is not aligned with the grid) but it can also not move further (because the wall is there). The solution is to either make the sprite larger, or to switch off precise collision checking and as bounding box indicate the full image.</p></blockquote>
<p><em>Describing the required key controls in a textual way is not necessarily the clearest way of presenting the information. Can you create a tabular layout that states the actions for each key for both the &#8220;move on press&#8221; and &#8220;Pacman&#8221; types of player character motion?</em></p>
<p>Select one of the movement types and use it to configure your player character. If you want to use the Pacman style of motion, you will need to define the player object as follows (without the &#8216;no key&#8217; object):</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2333258153/"><img src="http://farm3.static.flickr.com/2290/2333258153_01dced3089.jpg" /></a></p>
<h3>Reporting the Configuration of an object.</h3>
<p>The above screenshots showed how the various maze game objects should be configured for this game. If you wanted to document your game by listing the settings of the events and actions associated with each object, it could take a significant amount of time to create that sort of view. Fortunately, the Advanced Mode within Game Maker provides an option to display information about an object in this sort of form:</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2333272021/"><img src="http://farm3.static.flickr.com/2324/2333272021_ac7abd773a.jpg" /></a></p>
<p>From the Game maker File menu, see whether the &#8216;Advanced Mode&#8217; is set. If it isn&#8217;t, save you game, then select the Advanced Mode. You will need to close Game Maker and restart it for the change to take effect.</p>
<p>To display the Object information panel, from the Edit menu, select <em>Show Object Information</em>.</p>
<p>Henceforth, I shall try to use this sort of report to summarise the settings of an object so that you can check your<br />
settings against them, rather than providing pages of screenshots showing how to configure a particular object.</p>
<h4>Movement Directions in the Show Information Report</h4>
<p>Although it may be obvious to some, just how to read statements like:</p>
<p><code>Keyboard Event for  Key:<br />
start moving in directions 000100000 with speed set to 4</code></p>
<p>may not be obvious to all, so here&#8217;s the trick to reading the long string of 1s and 0s.</p>
<p>The movement setting allows you to specify which directions the object might move in, organised on a 3 x 3 grid, giving nine possible grid locations. The string of 1s and 0s is 9 items long (count them!). The <em>top row</em> of the direction setting grid, read from left to right, corresponds to the first three locations, the <em>second row</em>, again read from left to right, the fourth, fifth, and sixth locations; and the <em>bottom row</em> the last three locations.</p>
<p>A &#8216;1&#8242; in the &#8220;string&#8221; of digits specifies the corresponding directional element has been selected, and a &#8216;0&#8242; that is has not.</p>
<h3>Creating the Room</h3>
<p>Create a new room, and set the grid size to 32 x 32. Select the wall object in object area of the Room Properties dialogue. Draw a wall around the edge of the room to mark out the borders of the maze. Remember that you can &#8216;paint&#8217; a wall by pressing the Shift key as you click and drag the cursor round the room, rather than just clicking to press each wall brick separately. Right click on a wall brick to delete it.</p>
<p>You may find it convenient to get into the practice of leaving a one or two row border of empty grid squares at the bottom of the room for displaying a running score, and other game related information, although we shall not be calling on this requirement for the moment. For now, do not put any inner walls in the maze &#8211; just leave the inner area empty, as it was in the Catch the Clown Game.</p>
<p>In the centre of the room, place a wall block at the corners of a 3 x 3 grid square grid to define a simple crossroads, with an instance of the goal object somewhere else within the room.</p>
<p><a href="http://www.flickr.com/photos/25451952@N00/2334107126/"><img src="http://farm3.static.flickr.com/2100/2334107126_7df8169589.jpg" /></a></p>
<p>Now use this simple room to check the controllability of the player character, by seeing how easily you can navigate through it and turn a corner in the centre of it.</p>
<p>Place an instance of the player character in the centre of the room and run the &#8216;game&#8217;.</p>
<p>Check that the player character behaves as required in response to your key presses, then exit from the &#8216;game&#8217; by pressing <em>Esc</em>. If the player character did not work as required, check the settings of the player object.</p>
<h4>Different Game Mechanics</h4>
<p>Duplicate the player object to create a second player object, and configure it so that it uses the other type of movement to the movement type you originally selected. Replace the instance of the first type of player object with one of the second player object type.</p>
<p>Run the game again and see how this second movement type compares to the first.</p>
<p>If you do not enforce grid alignment using the continuous movement mode, it can be rather tricky to control the player accurately.</p>
<p>By using the grid alignment control at the start of each key press action, the controllability of the player character can be improved.</p>
<p><em>How easy is it to control the movement of the player accurately with and without grid alignment in the continuous movement and &#8216;move-on-click movement modes?</em><br />
<em><br />
How does the ease or difficulty of controlling the player character&#8217;s movement accurately change with different player movement speeds? What speed provides the best balance of controllability and &#8216;excitement&#8217;?</em></p>
<p>In the next post, we&#8217;ll put together a proper maze and find out how to create a 2 room game, before moving on to add treasure and monsters in later posts&#8230;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/digitalworlds.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/digitalworlds.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/digitalworlds.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/digitalworlds.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/digitalworlds.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/digitalworlds.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/digitalworlds.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/digitalworlds.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/digitalworlds.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/digitalworlds.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/digitalworlds.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/digitalworlds.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=digitalworlds.wordpress.com&blog=3013057&post=28&subd=digitalworlds&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://digitalworlds.wordpress.com/2008/03/14/moving-on-with-game-maker-a-maze-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/kGy8evJsK0s/2.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3195/2333230805_d2eecab275.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3114/2333246191_a017ed75a1.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2063/2334067952_1321ce3fff.jpg" medium="image" />

		<media:content url="http://farm4.static.flickr.com/3131/2333238803_07750bd5fd.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2290/2333258153_01dced3089.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2324/2333272021_ac7abd773a.jpg" medium="image" />

		<media:content url="http://farm3.static.flickr.com/2100/2334107126_7df8169589.jpg" medium="image" />
	</item>
	</channel>
</rss>