<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel rdf:about="http://feeds.garagegames.com/rss/blogs/developer/72779/">
		<title>Blog for Manjit Bedi at GarageGames.com</title>
		<description>Blog feeds for Gamers and Developers in the GarageGames community.</description>
		<link>http://www.garagegames.com/</link>
		<image rdf:resource="http://www.garagegames.com/images/GarageGames_logo_small_w.gif" />
		<dc:date>2008-11-21T14:08:53+00:00</dc:date>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/72779/13056"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/72779/12935"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/72779/12762"/>
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.garagegames.com/blogs/72779/13056">
		<dc:format>text/html</dc:format>
		<dc:date>2007-06-13T14:54:37+00:00</dc:date>
		<dc:creator>Manjit Bedi</dc:creator>
		<title>Making an arcade style high score name entry screen</title>
		<link>http://www.garagegames.com/blogs/72779/13056</link>
		<description>The game I am working on will ultimately be in an arcade cabinet and using a joystick and buttons.&lt;br&gt;&lt;br&gt;I have spent the last day and then some tinkering with making a name entry screen.  The idea is something very classic in design.   I thought it was about time that I gave something back to the TGB community.  :-)&lt;br&gt;&lt;br&gt;Here is what I mocked up some far:&lt;br&gt;&lt;br&gt;&lt;img src='http://www.manjitbedi.co.uk/LaiussFolly/high_score_name_entry_v0.8.png'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;This is really just something functional, it is bound to get some graphical flourishes later.&lt;br&gt;&lt;br&gt;Basically, what I did was create a series of text objects and then when the level is loaded; I stored the objects in an array.  I keep a position for the 'cursor' which is x, y pair which I use to get the text objects from the array.  I have move maps set up for the direcitonal arrow key and when the space bar is pressed.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;	%this.letters[0, 0] = letter11;&lt;br&gt;	%this.letters[1, 0] = letter12;	&lt;br&gt;	%this.letters[2, 0] = letter13;&lt;br&gt;	%this.letters[3, 0] = letter14;	&lt;br&gt;&lt;br&gt;       etc....&lt;br&gt;&lt;br&gt;	// update position of cursor&lt;br&gt;	%letterObj = %this.letters[%this.cursorPosX, %this.cursorPosY];	&lt;br&gt;	echo(&amp;quot;move cursor to&amp;quot; SPC %letterObj.getName() SPC &amp;quot;with position&amp;quot; SPC %letterObj.getPosition() SPC &amp;quot;letter&amp;quot; SPC %letterObj.text);&lt;br&gt;	%pos = %letterObj.getPosition();&lt;br&gt;	$cursor.setPosition(%pos);&lt;br&gt;	&lt;br&gt;	// Now for some fun, display the letter in the name text object.&lt;br&gt;	if(%letterObj.getName() !$= &amp;quot;delLetter&amp;quot; &amp;amp;&amp;amp; %letterObj.getName() !$= &amp;quot;endName&amp;quot; )&lt;br&gt;	{&lt;br&gt;		%character = %letterObj.text;&lt;br&gt;		%this.nameLetters[%this.lettersUsed] = %character;&lt;br&gt;		HighScoreName.text = %this.nameLetters[0] @ %this.nameLetters[1] @ %this.nameLetters[2] @ %this.nameLetters[3] @ %this.nameLetters[4] @ %this.nameLetters[5];&lt;br&gt;	}&lt;br&gt;&lt;br&gt;      etc...&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;There are two special text objects: one for deleting the last letter and the other for ending the high score entry.  I check the name of the text object to see it is one of them.  &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;/*&lt;br&gt;	Given the current cursor position use the letter.&lt;br&gt;*/&lt;br&gt;function  nameEntryClass::selectLetter(%this)&lt;br&gt;{&lt;br&gt;	%letterObj = %this.letters[%this.cursorPosX, %this.cursorPosY];&lt;br&gt;&lt;br&gt;	if(%letterObj.getName() $= &amp;quot;endName&amp;quot;)&lt;br&gt;	{&lt;br&gt;		// store the name in a global and switch to the high score table &lt;br&gt;	}&lt;br&gt;	else if(%letterObj.getName() $= &amp;quot;delLetter&amp;quot;) &lt;br&gt;	{&lt;br&gt;		if(%this.lettersUsed &amp;gt; 0)&lt;br&gt;		{&lt;br&gt;			%this.nameLetters[%this.lettersUsed] = &amp;quot;-&amp;quot;;&lt;br&gt;			%this.lettersUsed--;&lt;br&gt;			HighScoreName.text = %this.nameLetters[0] @ %this.nameLetters[1] @ %this.nameLetters[2] @ %this.nameLetters[3] @ %this.nameLetters[4] @ %this.nameLetters[5];						&lt;br&gt;		}&lt;br&gt;	}&lt;br&gt;	else if(%this.lettersUsed &amp;lt; 6)&lt;br&gt;	{&lt;br&gt;		%this.lettersUsed++;&lt;br&gt;&lt;br&gt;		%character = %letterObj.text;&lt;br&gt;		%this.nameLetters[%this.lettersUsed] = %character;&lt;br&gt;		HighScoreName.text = %this.nameLetters[0] @ %this.nameLetters[1] @ %this.nameLetters[2] @ %this.nameLetters[3] @ %this.nameLetters[4] @ %this.nameLetters[5];			&lt;br&gt;	}&lt;br&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;And here is the code:&lt;br&gt;&lt;br&gt;&lt;a href='http://www.manjitbedi.co.uk/LaiussFolly/high_score.cs' target=_blank&gt;TGB high score script&lt;/a&gt;&lt;br&gt;&lt;a href='http://www.manjitbedi.co.uk/LaiussFolly/enter_name.t2d' target=_blank&gt;Level file download&lt;/a&gt;&lt;br&gt;&lt;br&gt;Note: I make reference to an image map for the cursor and background shapes.  Everything else are just text&lt;br&gt;objects.</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/72779/12935">
		<dc:format>text/html</dc:format>
		<dc:date>2007-05-23T13:08:43+00:00</dc:date>
		<dc:creator>Manjit Bedi</dc:creator>
		<title>Next steps - getting TGB into an arcade cabinet</title>
		<link>http://www.garagegames.com/blogs/72779/12935</link>
		<description>Sometime, I need to progress one of the key requirements for this project.&lt;br&gt;&lt;br&gt;The game is to go into an arcade cabinet.  The game is going to be an art piece for a contemporary artist.&lt;br&gt;&lt;br&gt;I am currently doing my development work using TGB 1.1.3 on a Mac Powerbook.  So far so good.&lt;br&gt;&lt;br&gt;But when I need to start doing some testing with the USB controls I do wonder if I will need to get the game working on Windows based system.&lt;br&gt;&lt;br&gt;It seems there are few other people out there who have been using arcade cabinets and running Torque based games.  Any caveats?&lt;br&gt;&lt;br&gt;M.</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/72779/12762">
		<dc:format>text/html</dc:format>
		<dc:date>2007-04-21T09:46:37+00:00</dc:date>
		<dc:creator>Manjit Bedi</dc:creator>
		<title>Experimenting with weapon collision and using mounted objects</title>
		<link>http://www.garagegames.com/blogs/72779/12762</link>
		<description>I have finally got something work after pondering it for some time over the last few days.&lt;br&gt;&lt;br&gt;The main character uses a weapon to 'swat' the bad guys in the game.  In this particular scenario, the player is armed with a shovel.  I was trying to think of how to imeplement it.&lt;br&gt;&lt;br&gt;What I did was:&lt;br&gt;&lt;br&gt;1) create a weapon object that is just using a transparent bitmap and mounted the object to the player&lt;br&gt;on a link point.&lt;br&gt;2) the weapon object script sets the collision states to false when the level is loaded    &lt;br&gt;3) set the frame callback to true for the animation of the player when he is swinging the shovel down&lt;br&gt;4) the frame callback rountine turns on the weapon collision on a frame and then a few frames later&lt;br&gt;turns the collision off.  The result the collision only is happening when the player is in the middle of the animation wih the frame down.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;function player::onFrameChange(%this, %frameIndex)&lt;br&gt;{&lt;br&gt;	if(%frameIndex == 2)&lt;br&gt;	{&lt;br&gt;		echo (&amp;quot;shovel blade collision on&amp;quot;);&lt;br&gt;		$weapon.setCollisionActive(true, true);&lt;br&gt;	}&lt;br&gt;	else if(%frameIndex == 4)&lt;br&gt;	{&lt;br&gt;		echo (&amp;quot;shovel blade collision off&amp;quot;);	&lt;br&gt;		$weapon.setCollisionActive(false, false);	&lt;br&gt;	}&lt;br&gt;}&lt;/pre&gt;&lt;/div&gt;</description>
	</item>
</rdf:RDF>
