<?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/"
	>

<channel>
	<title>Pixel Squid Blog</title>
	<atom:link href="http://blog.pixelsquidgames.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pixelsquidgames.net</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 19:40:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Level Generation</title>
		<link>http://blog.pixelsquidgames.net/2013/04/level-generation/</link>
		<comments>http://blog.pixelsquidgames.net/2013/04/level-generation/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 06:39:38 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Devlog]]></category>
		<category><![CDATA[Game Talk]]></category>
		<category><![CDATA[autohotkey]]></category>
		<category><![CDATA[caved in 2]]></category>
		<category><![CDATA[level generation]]></category>
		<category><![CDATA[ogmo]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=229</guid>
		<description><![CDATA[I love procedural content, especially when it comes to randomly generated levels. Not only are such systems fun to set up, but it provides almost endless experiences without having to tediously design a butt-load of levels (don&#8217;t get me wrong though, handcrafted levels made with love and care are also as fun to play). Of course there [...]]]></description>
				<content:encoded><![CDATA[<p>I love procedural content, especially when it comes to randomly generated levels. Not only are such systems fun to set up, but it provides almost endless experiences without having to tediously design a butt-load of levels (don&#8217;t get me wrong though, handcrafted levels made with love and care are also as fun to play). Of course there is a fine line between how much should be randomly generated and how much should be predefined. There&#8217;s a certain point where randomness becomes a little <em>too random </em>and detracts from the fun of the game. For example, in the first Caved In I took a rather easy route with level generation:</p>
<ul>
<li>Fill the level with dirt.</li>
<li>Based on weights for each block type choose one. Then find a random square shaped-area in the level. This varies the tiles in the level creating deposits of coal, gold, water, and etc. Do this a few times.
<ul>
<li><span style="font-size: 1rem; line-height: 1.714285714;">For each tile in the square area, change the dirt tile to the chosen block based on a specified chance (if I remember correctly, blocks had a 30% chance to dirt). This ensures we don&#8217;t have square areas of tiles.</span></li>
</ul>
</li>
<li>Find a random square-shaped area and change all the tiles to floor tiles, which creates (boring) caves. Do this a few times.</li>
</ul>
<p>Resulting levels were &#8220;unique&#8221; each time but not very interesting because they lacked defining features or fun caves to explore. In Caved In 2 I&#8217;ve decided to take a different route. Instead of randomly generating the level, I broke it into four 12&#215;12 tile &#8220;rooms&#8221;. The rooms are designed by hand in <a href="http://www.ogmoeditor.com/">Ogmo</a> by laying out dirt tiles to define caves and placing object spawns (such as loot, power ups, and etc).</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2013/04/cavedin2_editor_room.png"><img class="alignnone size-medium wp-image-239" alt="cavedin2_editor_room" src="http://blog.pixelsquidgames.net/wp-content/uploads/2013/04/cavedin2_editor_room-300x300.png" width="300" height="300" /></a><br />
<i>A bare room designed in Ogmo.</i></p>
<p>The rooms are then compiled into a XML &#8220;room database&#8221; using a script I wrote in <a href="www.autohotkey.com/">AutoHotKey</a>. When the level is generated, it randomly chooses rooms and stitches them together to form the entire level. The dirt tiles in the rooms are then replaced with other tiles using a similar algorithm found in the original Caved In, although it&#8217;s been refined to provide a better spread of block types.</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2013/04/cavedin2_game_room.png"><img alt="cavedin2_game_room" src="http://blog.pixelsquidgames.net/wp-content/uploads/2013/04/cavedin2_game_room-300x198.png" width="300" height="198" /></a><br />
<i>Same room from above in-game&#8230;although some gravel caved in above where I dug in.</i></p>
<p>In the end, levels are still randomly generated but provides me with a bit more control to help give the levels a more personal touch. In the coming weeks I&#8217;m going to be churning out loads of more rooms as I get closer to release along with more props and decorations. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2013/04/level-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shroom The Way</title>
		<link>http://blog.pixelsquidgames.net/2013/03/shroom-the-way/</link>
		<comments>http://blog.pixelsquidgames.net/2013/03/shroom-the-way/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 05:31:53 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Devlog]]></category>
		<category><![CDATA[caved in 2]]></category>
		<category><![CDATA[game design]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=220</guid>
		<description><![CDATA[One of the biggest design issues with the original game was guiding the player to the ladder that would take them to the next level. &#8220;I think I&#8217;m lost&#8221; The player starts out in pitch black with only a small diamond of the level visible. As the player explores, they uncover the level although areas not within [...]]]></description>
				<content:encoded><![CDATA[<p>One of the biggest design issues with the original game was guiding the player to the ladder that would take them to the next level.</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2013/03/2013-03-30-21_56_41-Play-Caved-In-a-free-online-game-on-Kongregate.png"><img alt="2013-03-30 21_56_41-Play Caved In, a free online game on Kongregate" src="http://blog.pixelsquidgames.net/wp-content/uploads/2013/03/2013-03-30-21_56_41-Play-Caved-In-a-free-online-game-on-Kongregate.png" width="248" height="212" /></a><br />
<em>&#8220;I think I&#8217;m lost&#8221;</em></p>
<p>The player starts out in pitch black with only a small diamond of the level visible. As the player explores, they uncover the level although areas not within the diamond radius are slightly obscured again. While it was my goal to not hold the player&#8217;s hand and let them explore, it proved difficult to determine where the ladder would be each level. It was simply a matter of randomly digging around until the ladder was found. I later added a compass that (sort of) pointed towards the general direction of the ladder, but it was a lousy remedy. Yet it did produce a pretty awesome comment from a player: &#8220;Good thing this cave has highly magnetic ladders built into it.&#8221;</p>
<p>One of the major goals in the sequel was to find a better solution to this problem and make exploration more rewarding. I tried a handful of different methods, but I eventually came up with the brilliant idea of glowing mushrooms.</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2013/03/2013-03-30-21_57_41-CavedIn2-FlashDevelop.png"><img class="alignnone size-medium wp-image-222" alt="cavedin2_shroom" src="http://blog.pixelsquidgames.net/wp-content/uploads/2013/03/2013-03-30-21_57_41-CavedIn2-FlashDevelop-300x184.png" width="300" height="184" /></a><br />
&#8220;DIAMOND!&#8221;</p>
<p>Mushrooms are placed in caves and there are usually two or three visible on screen at any given time. They give off a dim light that illuminates the tiles around it, even when the player is not in the immediate vicinity and act as landmarks. Since they only spawn in open spaces, the player begins to realize that digging towards mushrooms means they&#8217;ll find a cave once they get there and caves contain loot, damsels, and most importantly &#8211; the ladder.</p>
<p>Up next: rescuing damsels while trying not to have the cave come crumbling down on top of your head.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2013/03/shroom-the-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GDC 2013</title>
		<link>http://blog.pixelsquidgames.net/2013/03/gdc-2013/</link>
		<comments>http://blog.pixelsquidgames.net/2013/03/gdc-2013/#comments</comments>
		<pubDate>Sat, 30 Mar 2013 01:41:29 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[caved in 2]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[GDC]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=217</guid>
		<description><![CDATA[This year I came more prepared by printing out some business cards and planning out my day (since I still could only afford the $75 dollar student pass). I spent most of my day sitting in on talks and taking notes about various topics. Long story short, a few speakers mentioned how important it was that developers [...]]]></description>
				<content:encoded><![CDATA[<p>This year I came more prepared by printing out some business cards and planning out my day (since I still could only afford the $75 dollar student pass). I spent most of my day sitting in on talks and taking notes about various topics. Long story short, a few speakers mentioned how important it was that developers (that were applying for their companies) wrote about their thoughts and talked about things they work on. I&#8217;ve actually been meaning trying to do this for awhile but I never found myself to be that great of a writer nor been able to make time to write. However, you don&#8217;t get better at something be avoiding it so I&#8217;m going to try and write more here about my work and general thoughts about things happening in the industry.</p>
<p>I&#8217;d also like to mention that I haven&#8217;t put much work into Caved In 2 since the last post, mostly just been on and off work on the medal system. However I&#8217;m planning on getting at a good solid chunk of work done tomorrow. My current plan is to work on the game during my spring break, which happens to fall during the last week of April.</p>
<p>I&#8217;ve also been thinking about the rogue-like that I was planning on doing next, but I don&#8217;t think I&#8217;m going to go through with it. Such a big project is likely to keep me hung up for quite a long time and I&#8217;d much rather work on smaller, more manageable projects. I&#8217;m currently working on a space-dog-fighting-arcade game for one of my classes that I think I&#8217;ll continue with after Caved In.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2013/03/gdc-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caved In 2 Update</title>
		<link>http://blog.pixelsquidgames.net/2013/02/caved-in-update/</link>
		<comments>http://blog.pixelsquidgames.net/2013/02/caved-in-update/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 05:34:23 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Devlog]]></category>
		<category><![CDATA[caved in 2]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=207</guid>
		<description><![CDATA[&#160; So apparently I first mentioned Caved In 2 back in November and now its almost the end of March, which makes this almost a five month project. Oops&#8230;I meant to get this out the door in under a month! Oh well, at least the game is coming along nicely. Here, take a look at the new [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>So apparently I <a href="http://blog.pixelsquidgames.net/2012/11/happy-holidays/">first mentioned Caved In 2 back in November</a> and now its almost the end of March, which makes this almost a <em>five month</em> project. Oops&#8230;I meant to get this out the door in under a month! Oh well, at least the game is coming along nicely. Here, take a look at the new font and one of the four tile sets:</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2013/02/2013-02-19-21_10_09-Adobe-Flash-Player-11.png"><img alt="2013-02-19 21_10_09-Adobe Flash Player 11" src="http://blog.pixelsquidgames.net/wp-content/uploads/2013/02/2013-02-19-21_10_09-Adobe-Flash-Player-11-300x198.png" width="300" height="198" /></a></p>
<p>I&#8217;m currently working the game over screen that awards you medals based on statistics from your last session. I&#8217;d post a screenie, but the UI is a mess at the moment. Basically, if you mine X blocks or do something X times you get an award with a cool name. Nothing too special but many people often like looking at stats to gauge how well they did and what they accomplished.</p>
<p>After stats and awards, I&#8217;ve been thinking about adding traps and a few new powerups but have been having trouble thinking of things that would actually <em>add</em> to the gameplay rather than just being <em>there</em>.</p>
<p>Anyway, almost complete! <img src='http://blog.pixelsquidgames.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Hopefully I&#8217;ll get it out before the end of March, but I&#8217;m not entirely sure with my current workload from school and contracts.</p>
<p>Fun Fact: Planning on doing an ASCII rogue-like next!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2013/02/caved-in-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy (Almost) New Year!</title>
		<link>http://blog.pixelsquidgames.net/2012/12/happy-almost-new-year/</link>
		<comments>http://blog.pixelsquidgames.net/2012/12/happy-almost-new-year/#comments</comments>
		<pubDate>Mon, 31 Dec 2012 02:18:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[#OneGameAMonth]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[apocalypse]]></category>
		<category><![CDATA[caved in]]></category>
		<category><![CDATA[GDC]]></category>
		<category><![CDATA[infested space]]></category>
		<category><![CDATA[internship]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[new years]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[statsystem]]></category>
		<category><![CDATA[tilelighting]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=201</guid>
		<description><![CDATA[Thought I&#8217;d write this post now seeing that I&#8217;ll likely be MIA for the festivities tomorrow, heh. I took a look back at my new year&#8217;s resolutions from last year, which were: Not die during the apocalypse Finish GRIDNET and many other games Move out Get serious enough with TF2 to reach competitive level Socialize more and meet new people [...]]]></description>
				<content:encoded><![CDATA[<p>Thought I&#8217;d write this post now seeing that I&#8217;ll likely be MIA for the festivities tomorrow, heh. I took a look back at my new year&#8217;s resolutions from last year, which were:</p>
<ul>
<li>Not die during the apocalypse</li>
<li>Finish GRIDNET and many other games</li>
<li>Move out</li>
<li>Get serious enough with TF2 to reach competitive level</li>
<li>Socialize more and meet new people</li>
<li>Excel in classes</li>
<li>Get a part-time job</li>
</ul>
<p>I (and many others) survived the apocalypse so my first bullet point was a success (yay!). However, I didn&#8217;t really hit the other ones so much. Early last year, I dropped development of Gridnet because I was spending far too long on such a behemoth idea. It got to the point where I was stressing about it and actually not looking forward to working on it each day. On the bright side after I shelved Gridnet, I released  two games <a href="http://pixelsquidgames.net/gamepages/infestedspace.html">Infested Space</a> and soon-to-be-released Caved In 2 as well as two open-source projects <a href="http://pixelsquidgames.net/projects/statsystem/statsystem.html">StatSystem</a> and  <a href="http://pixelsquidgames.net/projects/tilelighting/tilelighting.html">TileLighting</a>! So while it wasn&#8217;t &#8220;many&#8221; games, I did at least do a few! As far as a job, I got quite a few interviews for game development positions, although many of them didn&#8217;t pan out. However, I did land a contract gig with <a href="http://www.bulletproofarcade.com/">BulletProofArcade</a> as a game play programmer which has been pretty neat so far. The other bullets on that list were never met, to say the least.</p>
<p>Looking forward, I would like to go through with the <a href="http://www.onegameamonth.com/">#OneGameAMonth</a> challenge for 2013. However I&#8217;m not quite sure how it will pan out because this is my final year in college and I&#8217;ll likely get quite busy. Nonetheless I&#8217;m still going to try because I really would like to have some more games under my belt. I already have an idea for my first game and a few vague plans for later months. I&#8217;m hoping to touch on genres that I haven&#8217;t before (like puzzle and strategy) and maybe even utilize Unity.</p>
<p>I&#8217;m also hoping to walk away from GDC this year with an internship or job. Last year, many of the employers wanted students who were graduating soon so I didn&#8217;t quite fit the bill with two years to go. This year however, I&#8217;m going to have my fingers crossed and my business cards ready!</p>
<p>Anyway, here&#8217;s the New Year&#8217;s resolutions list:</p>
<ul>
<li>Get a job or internship in the industry</li>
<li>Finish more games (honestly, when will this ever <em>not</em> be on the list)</li>
<li>Go through with #OneGameAMonth</li>
<li>Meet some devs at GDC this year</li>
<li>Finish school</li>
</ul>
<p>Fun Fact: I finally got around to getting my driver&#8217;s license the day the world was supposed to end.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/12/happy-almost-new-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Holidays!</title>
		<link>http://blog.pixelsquidgames.net/2012/11/happy-holidays/</link>
		<comments>http://blog.pixelsquidgames.net/2012/11/happy-holidays/#comments</comments>
		<pubDate>Thu, 29 Nov 2012 05:16:05 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[bullet proof arcade]]></category>
		<category><![CDATA[caved in]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[sequel]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=196</guid>
		<description><![CDATA[I was just thinking about how I hardly post here anymore and that I should at least give updates to my current projects. About two months ago I landed a contract gig with BulletProofArcade and I&#8217;ve been happily coding away. Coupled with school work, I&#8217;ve been quite busy especially since I&#8217;m now reaching the final year. [...]]]></description>
				<content:encoded><![CDATA[<p>I was just thinking about how I hardly post here anymore and that I should at least give updates to my current projects.</p>
<p>About two months ago I landed a contract gig with <a href="http://www.bulletproofarcade.com/">BulletProofArcade</a> and I&#8217;ve been happily coding away. Coupled with school work, I&#8217;ve been quite busy especially since I&#8217;m now reaching the final year. However with the holidays here, I&#8217;ve been finding more and more free time (yay!) so I&#8217;ve picked up on my own projects once again.</p>
<p>I had been working on a Borderlands-inspired hunting game, but I put the project on hold to work on something smaller since I couldn&#8217;t find much time. So I&#8217;m currently working on a sequel to <a href="http://pixelsquidgames.net/gamepages/caved_in.html">Caved In</a> as I had been wanting to revisit the game for quite awhile now and it fit the bill in terms of my time budget. I don&#8217;t have anything worth screen shotting just yet, but hopefully I&#8217;ll get something ready for this #ScreenShotSaturday! I&#8217;m in the process of wrapping up world generation, so I should have something cool by then.</p>
<p>I&#8217;m also trying to get around to making some mods for the various games I own as well as some more open-source libraries. As a matter of fact, I have a few potentially useful libraries should be committed to github after some house keeping&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/11/happy-holidays/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Loading Ogmo2 Levels in FlashPunk</title>
		<link>http://blog.pixelsquidgames.net/2012/08/loading-ogmo2-levels-in-flashpunk/</link>
		<comments>http://blog.pixelsquidgames.net/2012/08/loading-ogmo2-levels-in-flashpunk/#comments</comments>
		<pubDate>Thu, 23 Aug 2012 21:29:30 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[flashpunk]]></category>
		<category><![CDATA[grids]]></category>
		<category><![CDATA[level]]></category>
		<category><![CDATA[ogmo]]></category>
		<category><![CDATA[tiles]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=185</guid>
		<description><![CDATA[This is a quick tutorial on loading Ogmo2 levels in FlashPunk. As an added bonus, I&#8217;ll cover how simple it is to layer tile sets in your game world. NOTE: I used Oryx&#8217;s free tile set for the tutorial. Okay let&#8217;s get started! You&#8217;ll need to download the tutorial project zip as a starting point for this tutorial. The [...]]]></description>
				<content:encoded><![CDATA[<p>This is a quick tutorial on loading <a href="http://www.ogmoeditor.com/">Ogmo2</a> levels in FlashPunk. As an added bonus, I&#8217;ll cover how simple it is to layer tile sets in your game world.</p>
<p>NOTE: I used <a href="http://forums.tigsource.com/index.php?topic=8970.0">Oryx&#8217;s free tile set</a> for the tutorial.</p>
<p>Okay let&#8217;s get started! You&#8217;ll need to download the <a href="http://pixelsquidgames.net/files/ogmotut.zip">tutorial project</a> zip as a starting point for this tutorial. The archive contains everything, but at this point you just want to turn your attention to the Ogmo project and level files found in the assets folder.</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2012/08/screen000034.png"><img class="alignnone size-medium wp-image-186" title="screen000034" src="http://blog.pixelsquidgames.net/wp-content/uploads/2012/08/screen000034-300x225.png" alt="" width="300" height="225" /></a></p>
<p><strong>PRO TIP: </strong>As of this moment in time, there is a bug in Ogmo 2 where if you resize the window the tiles will disappear. In order to combat this, resize your editor window to the desired dimensions prior to loading a level. If you don&#8217;t heed this warning and you get invisible tiles, simply close the project and reopen it.</p>
<p>Above is the level file you will find in the archive. As you may have noticed, I have two tile layers &#8211; one for the bottom (or &#8220;floor&#8221;) tiles and the another for the top (or &#8220;detail&#8221;) tiles. This allows you to place other tiles on top of each other without the bottom one being over written. As you will see below, you just need to make second tile layer with the same properties to achieve this.</p>
<p><a href="http://blog.pixelsquidgames.net/wp-content/uploads/2012/08/screen000035.png"><img class="alignnone size-medium wp-image-187" title="screen000035" src="http://blog.pixelsquidgames.net/wp-content/uploads/2012/08/screen000035-300x300.png" alt="" width="300" height="300" /></a></p>
<p>Okay, so how do you actually get the level <em>into</em> your project you ask? Well it&#8217;s quite simple really.</p>
<p>You&#8217;ll want to add a new class to your project that extends FlashPunk&#8217;s entity class:</p><pre class="crayon-plain-tag">public class Level extends Entity 
{
    private var xml:XML;
    private var tile_layer1:Tilemap;
    private var tile_layer2:Tilemap;
    private var grid:Grid;

    public function Level(rawData:Class) 
    {
        super(0, 0);

        // to check for level collisions
        type = "level"; 

        // FlashPunk function makes get all that data super easy!
        this.xml = FP.getXML(rawData);
    }
}</pre><p>You&#8217;ll need a variable to hold the parsed XML data, one for each tileset, and one for the grid.</p>
<p>Many people who have seen <a href="http://flashpunk.net/2011/05/episode-5-importing-an-ogmo-level-into-flashpunk/">Zach&#8217;s tutorial</a> use a slightly more verbose method of getting the XML data. However, since that video a function in FP called FP.getXML() has been added that simplifies this process, which I&#8217;ve used my my constructor.</p>
<p>In this next block of code is the added() function of the entity, which will be loading up our tilesets:</p><pre class="crayon-plain-tag">override public function added():void 
{
    super.added();

    // load tiles
    // bottom tile layer
    tile_layer1 = new Tilemap(Assets.SPR_TILES, xml.@width, xml.@height, 16, 16);
    tile_layer1.loadFromString(xml.tile_layer1);
    trace(xml.tile_layer1);

    // top tile layer (details)
    tile_layer2 = new Tilemap(Assets.SPR_TILES, xml.@width, xml.@height, 16, 16);
    tile_layer2.loadFromString(xml.tile_layer2);

    // set graphic to graphiclist of tilesets, order matters!
    graphic = new Graphiclist(tile_layer1, tile_layer2);
}</pre><p>Here we want to initialize the tilemaps with the width and height values from the XML data of the Ogmo level. Then use the loadFromString function available in the tilemap class which loads tiles from a string, which is exactly how Ogmo formats it. How handy! Then we just have to construct a graphic list and assign it to our graphic.</p>
<p>&nbsp;</p>
<p><strong>PRO TIP:</strong> I&#8217;d like to take the time to point out that you use the &#8220;@&#8221; when you want to access a value within an XML tag. For example:</p><pre class="crayon-plain-tag">&lt;data&gt;
    &lt;company name="Awesome Co"&gt;
        &lt;employee id="1"&gt;John Doe&lt;/employee&gt;
    &lt;/company&gt;
&lt;/data&gt;</pre><p>To get the &#8220;name&#8221; value from the company node: &#8220;data.company.@name&#8221;. If you want to get value <em>between</em> XML tags, leave out the &#8220;@&#8221; and use the name of the root node. So to get the employee name: &#8220;data.company.employee&#8221;.</p>
<p>&nbsp;</p>
<p>Next we&#8217;ll want to use the same principles to load the grid. Keep in mind this is still within the added() function of our Level class:</p><pre class="crayon-plain-tag">// load the collision grid
grid = new Grid(xml.@width, xml.@height, 16, 16);
grid.loadFromString(xml.grid, "");

// set the grid to the mask of this entity
mask = grid;</pre><p>However, note that Ogmo doesn&#8217;t use the FP default comma (&#8220;,&#8221;)  for the column delimiter. You&#8217;ll need to pass in double quotes for the delimiter parameter so it is loaded correctly.</p>
<p>Finally, we need to add our entities. Typically, you have more than just one instance of any given entity, so we&#8217;ll want to loop through each one and add it to the game. We can do this by creating an XMLList and assigning a parent node to it. Then all we need to do is loop through the list and add each entity:</p><pre class="crayon-plain-tag">// load entities
var list:XMLList; // holds an xmllist
var element:XML; // a specific xml element

// for each player in the xml list
list = xml.entities.player;
for each (element in list) {
    // add it
    world.add(new Player(element.@x, element.@y));
}

// for each coin in the xml list
list = xml.entities.coin;
for each (element in list) {
    // add it
    world.add(new Coin(element.@x, element.@y));
}</pre><p>You can also pass other XML values into the constructors of your entities if they have other properties. For example, let&#8217;s say our coin has a &#8220;pointWorth&#8221; value:</p><pre class="crayon-plain-tag">world.add(new Coin(element.@x, element.@y, element.@pointWorth))</pre><p>Just make sure you define the property in your Ogmo project as well!</p>
<p>That concludes the tutorial! If you have any questions, please leave a comment, email me, or <a href="http://flashpunk.net/forums/index.php?action=profile;u=7223">find me on the FlashPunk forums</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/08/loading-ogmo2-levels-in-flashpunk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Play Infested Space</title>
		<link>http://blog.pixelsquidgames.net/2012/08/play-infested-space/</link>
		<comments>http://blog.pixelsquidgames.net/2012/08/play-infested-space/#comments</comments>
		<pubDate>Tue, 14 Aug 2012 18:48:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Releases]]></category>
		<category><![CDATA[horror]]></category>
		<category><![CDATA[infested space]]></category>
		<category><![CDATA[topdown]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=176</guid>
		<description><![CDATA[Infested Space is now available! Have fun and feel free to leave feedback. 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_secure_infestedspace_1285692631"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="http://games.mochiads.com/c/g/infestedspace/secure_infestedspace.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://games.mochiads.com/c/g/infestedspace/secure_infestedspace.swf"
			name="fm_secure_infestedspace_1285692631"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Controls WASD: move F: toggle flashlight E: interact Mouse: aim Left-Click: fire Esc (or P): pause M: toggle audio &#160;]]></description>
				<content:encoded><![CDATA[<p>Infested Space is now available! Have fun and feel free to leave feedback.</p>
<p><span id="more-176"></span></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_secure_infestedspace_2073009647"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="http://games.mochiads.com/c/g/infestedspace/secure_infestedspace.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://games.mochiads.com/c/g/infestedspace/secure_infestedspace.swf"
			name="fm_secure_infestedspace_2073009647"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><span style="text-decoration: underline;">Controls</span><br />
WASD: move<br />
F: toggle flashlight<br />
E: interact<br />
Mouse: aim<br />
Left-Click: fire<br />
Esc (or P): pause<br />
M: toggle audio</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/08/play-infested-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InfestedSpace Post Mortem</title>
		<link>http://blog.pixelsquidgames.net/2012/08/infestedspace-post-mortem/</link>
		<comments>http://blog.pixelsquidgames.net/2012/08/infestedspace-post-mortem/#comments</comments>
		<pubDate>Tue, 14 Aug 2012 02:17:05 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Post Mortem]]></category>
		<category><![CDATA[horror]]></category>
		<category><![CDATA[infested space]]></category>
		<category><![CDATA[post mortem]]></category>
		<category><![CDATA[topdown]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=168</guid>
		<description><![CDATA[Infested Space is a top down, survival-horror game. It is also my third &#8220;official&#8221; game (as the others were post compo versions of Ludum Dare entries). I first started playing with the idea during a Ludum Dare jam, but I ended up dropping out of the jam due to time constraints. Then back in July [...]]]></description>
				<content:encoded><![CDATA[<p>Infested Space is a top down, survival-horror game. It is also my third &#8220;official&#8221; game (as the others were post compo versions of Ludum Dare entries). I first started playing with the idea during a Ludum Dare jam, but I ended up dropping out of the jam due to time constraints. Then back in July during my summer vacation, I decided to revisit the project as a short, one-week project. It ended up taking me about two months to complete it, but it was definitely worth the extra time.</p>
<p>I&#8217;m mostly proud of the atmosphere, not so much the actual game play. I personally feel that its a little linear (and short) but then again I&#8217;ve been playing the damn thing over and over again for the past few months. Thus far, most people take about 20 minutes to finish it and have said it was moderately challenging so I&#8217;m happy. I&#8217;ll likely have to patch it in the coming week if the majority of people find the game to be too difficult, like most my games. I&#8217;m also very thankful that <a href="http://jitterbones.com/">Chris Sinnott</a> helped out me out once again with the audio. It really adds to the experience!</p>
<p>This game was also important to me because its the first project after I decided to shelf the monstrous project I had been working on for nearly a year &#8211; Gridnet. I&#8217;m not going to go into the reasons why except that my current plan is to work on much smaller, month-sized projects. I&#8217;m already prototyping a new game as we speak!</p>
<p>Anyway, Infested Space will be available once Mochi approves of the game. At that point, you can find the play link on <a href="http://pixelsquidgames.net/gamepages/infestedspace.html">it&#8217;s dedicated page</a> or where ever else the game pops up (because I&#8217;m letting Mochi distribute it where ever it pleases).</p>
<p>Until next time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/08/infestedspace-post-mortem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StatSystem: Inventory and Item Management</title>
		<link>http://blog.pixelsquidgames.net/2012/08/statsystem-inventory-and-item-management/</link>
		<comments>http://blog.pixelsquidgames.net/2012/08/statsystem-inventory-and-item-management/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 03:18:43 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[inventory]]></category>
		<category><![CDATA[items]]></category>
		<category><![CDATA[rpg]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[statsystem]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pixelsquidgames.net/?p=143</guid>
		<description><![CDATA[[This is a tutorial for my AS3 stat library which can be found here. You can find the full documentation here.] As of version 2.1.0, StatSystem contains inventory and item management features! This tutorial was created to introduce these new features. As usual, when functions and properties are mentioned, they will be linked to their respective location [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This is a tutorial for my AS3 stat library which can be found <a href="http://pixelsquidgames.net/projects/statsystem/statsystem.html">here</a>. You can find the full documentation <a href="http://pixelsquidgames.net/projects/statsystem/documentation/index.html">here</a>.]</em></p>
<p>As of version 2.1.0, StatSystem contains inventory and item management features! This tutorial was created to introduce these new features. As usual, when functions and properties are mentioned, they will be linked to their respective location in the documentation.</p>
<p>The new features summarized in one sentence: an Inventory is a collection of ItemStacks, each of which hold an amount of an Item.</p>
<p>The <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Item.html">Item</a> class contains three basic properties:</p>
<ul>
<li>name &#8211; the name of the item as a string</li>
<li>type &#8211; the type of item (this can be anything e.g. weapon, consumable, potion, and etc)</li>
<li>stack &#8211; the maximum stackable amount for this item in an ItemStack</li>
<li>stats &#8211; the StatSystem for the item</li>
</ul>
<p>To create a new Item simply pass the desired name, (optional) item type, and (optional) max stack of the item. Here I&#8217;ve created a new item called &#8220;Health Potion&#8221; that is a &#8220;potion&#8221; type item and stacks to the maximum of eight.</p><pre class="crayon-plain-tag">var itemdata:Item = new Item("Health Potion", "potion", 8);</pre><p><strong>PRO TIP:</strong> If you set the max stack of an item to -1, there will be no limit. This happens to be the default value if you do not pass a value in the constructor.</p>
<p>To clarify the &#8220;type&#8221; property: In RPGs, there are often different types of items &#8211; weapons, shields, armor, consumables, food, and so on &#8211; each that have a different set of stats. If you are familiar with FlashPunk, you can think of it the same way the Entity&#8217;s &#8220;type&#8221; property.</p>
<p>Now back to our Health Potion! Let&#8217;s say all of our potions in our imaginary game have following stats &#8211; health, mana, and worth. Since this our Health Potion obviously affects health, we&#8217;ll give it a value of 20, mana a value of 0, and lets make it an expensive by setting the worth to 500:</p><pre class="crayon-plain-tag">itemdata.stats.addStat(new Stat("health", 20));
itemdata.stats.addStat(new Stat("mana", 0));
itemdata.stats.addStat(new Stat("worth", 500));</pre><p>The reason we still add the &#8220;mana&#8221; stat to the health potion is because we want all &#8220;potion&#8221; type items to have the same stats (but they don&#8217;t have to have the same value!) so when we need to do something with it, we don&#8217;t need have have any special cases and use a &#8220;catch all&#8221; code block. For instance, take this code snippet for example:</p><pre class="crayon-plain-tag">// inside function that uses an item

if (itemdata.type == "potion") {
    player.stats.getStat("health").addValue(itemdata.getStat("health").value);
    player.stats.getStat("mana").addValue(itemdata.getStat("mana").value);
} else if (itemdata.type == "weapon") {
    // weapon-y stuff here
}</pre><p>Other good examples are weapons in rouge-likes since they often have a multitude of different attributes:</p><pre class="crayon-plain-tag">//Sword of Fire
var itemdata:Item = new Item("Sword of Fire", "weapon", 1);

itemdata.stats.addStat("slashing", 3); // swords do slashing damage
itemdata.stats.addStat("crushing", 0);
itemdata.stats.addStat("piercing", 0); // I guess you could poke someone with a sword
itemdata.stats.addStat("fire", 10); // this isn't your normal kind of sword
itemdata.stats.addStat("water", 0);
itemdata.stats.addStat("earth", 0);</pre><p></p><pre class="crayon-plain-tag">//Mace of Rocks
var itemdata:Item = new Item("Mace of Rocks", "weapon", 1);

itemdata.stats.addStat("slashing", 0);
itemdata.stats.addStat("crushing", 20); // smash them slimes!
itemdata.stats.addStat("piercing", 0);
itemdata.stats.addStat("fire", 0); 
itemdata.stats.addStat("water", 0);
itemdata.stats.addStat("earth", 5);</pre><p>Now that we&#8217;re overflowing with cool items, you&#8217;ll likely want to store them all somewhere. This is where ItemStacks and Inventories come in handy!</p>
<p>First off, let me make it clear that an Inventory is a collection of ItemStacks, not Items. ItemStacks are stacks of <em>identical </em>items. If an item contains a property that changes over time (such as, charge, durability, etc) or can be changed by the player, you&#8217;ll want to set the max stack of the item to 1. For example, say you find a Steel Sword that has 10 points of durability left and you have a Steel Sword in your inventory that has full durability points. If the max stack isn&#8217;t set to 1, that almost broken Steel Sword will have max durability once you add it to your inventory since it will be added to a stack. Now here&#8217;s to actually use ItemStacks and Inventories.</p>
<p>An <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/ItemStack.html">ItemStack</a> has two properties : the item it contains and the amount of said item. So say we wanted to create a stack of Health Potions for a trip down into the dungeons:</p><pre class="crayon-plain-tag">var item:Item = new Item("Health Potion", "potion", 8);
var stack:ItemStack = new ItemStack(item, 8);</pre><p><strong>PRO TIP</strong>: It&#8217;s also worth mentioning that ItemStacks have three methods for altering the amount &#8211; <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/ItemStack.html#add()">add()</a>, <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/ItemStack.html#remove()">remove()</a>, and <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/ItemStack.html#setAmount()">setAmount()</a> which should all be self explanatory.</p>
<p>Now we need to create an Inventory to hold the stack. <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html">Inventories</a> have only one property &#8211; the maximum size. So let&#8217;s create a small inventory of size 5 and then add our stack of potions:</p><pre class="crayon-plain-tag">var inventory:Inventory = new Inventory(5);
inventory.addItemStack(stack);</pre><p><strong>PRO TIP</strong>: the size of an inventory is the number of <em>slots, </em>not the number of <em>items</em> it can contain.</p>
<p>Since our inventory was empty when we used <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html#addItemStack()">addItemStack()</a>, our stack of potions will take up the first slot. You can also add items via the <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html#addItem()">addItem()</a> method which takes an Item instead of an ItemStack and the amount of the Item to add.</p>
<p>To get our stack of items back from the inventory, we can use <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html#getBySlot()">getBySlot()</a> which returns an ItemStack at a specified slot in an inventory but doesn&#8217;t remove the ItemStack. Since our potions are in slot one, we&#8217;d pass &#8220;0&#8243; into the parameters as the inventory slots are <em>zero-based</em>. To remove an ItemStack from a specified slot, use <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html#removeBySlot()">removeBySlot()</a> by simply passing the slot and amount to remove in the parameters.</p>
<p>There will be other occasions where we won&#8217;t know where an item is in an inventory. This is where the <a href="http://pixelsquidgames.net/projects/statsystem/documentation/statsystem/inventory/Inventory.html#removeByName()">removeByName()</a> method comes in. The function takes a name and the amount to be removed.</p>
<p>This concludes the introduction to the item and inventory management features!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pixelsquidgames.net/2012/08/statsystem-inventory-and-item-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
