<?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>Dreamsocket &#187; News</title>
	<atom:link href="http://dreamsocket.com/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://dreamsocket.com</link>
	<description></description>
	<lastBuildDate>Mon, 14 May 2012 20:14:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19904</generator>
		<item>
		<title>A Few Good Radars</title>
		<link>http://dreamsocket.com/2012/03/02/a-few-good-radars/</link>
		<comments>http://dreamsocket.com/2012/03/02/a-few-good-radars/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 22:57:20 +0000</pubDate>
		<dc:creator>Brad Dillon</dc:creator>
				<category><![CDATA[Dev Tools]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/?p=68</guid>
		<description><![CDATA[Last night, Daniel Pasco posted an article about radars on the Black Pixel blog that is more than worth your time and attention. Daniel Pasco: Make no mistake: a lot ...]]></description>
			<content:encoded><![CDATA[<p>Last night, Daniel Pasco posted an article about radars on the Black Pixel blog that is more than worth your time and attention.</p>
<p><a title="Radar or GTFO" href="http://blackpixel.com/blog/1558/radar-or-gtfo/">Daniel Pasco</a>:</p>
<blockquote><p>Make no mistake: a lot of people – including people on my own team – have been seeing legitimate issues, and their productivity is being impacted. But what bothered me was the scarcity of tweets mentioning bug reports. Many people weren’t actually <em>doing</em> anything about it besides voicing their distress</p></blockquote>
<p>If you&#8217;re not familiar with radars, please <a title="Radar or GTFO" href="http://blackpixel.com/blog/1558/radar-or-gtfo/">read Dan&#8217;s post</a>. It is the best explanation of what they are and why they&#8217;re important that I&#8217;ve seen.</p>
<p>At the end of the article, Dan listed a series of radars from Open Radar that he (and many other developers including myself) hopes that you will take a look at and dupe. After reading through those radars I spent some time looking through Open Radar, and I found a few gems. Some of these are from Dan&#8217;s list and deserve more exposure and some are more thought provoking (or humorous) than mission critical, but all are worth reading, considering, and duping if you&#8217;re affected by them:</p>
<ul>
<li><a href="http://openradar.appspot.com/10962421">Create NS/CGRect class which knows its own coordinate space</a></li>
<li><a href="http://openradar.appspot.com/10972927">Problems in red text require your attention not useful if colourblind.</a></li>
<li><a href="http://openradar.appspot.com/10966764">Mike Jurewitz is answering questions on Twitter instead of enjoying his vacation</a></li>
<li><a href="http://openradar.appspot.com/10956241">Update documentation with known bugs / workarounds</a></li>
<li><a href="http://openradar.appspot.com/10956077">Make 3rd party issues in radar searchable by outside developers</a></li>
<li><a href="http://openradar.appspot.com/10955879">iOS Simulator Frequently hangs; can&#8217;t register with the bootstrap server</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2012/03/02/a-few-good-radars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on Webviews</title>
		<link>http://dreamsocket.com/2011/05/05/more-on-webviews/</link>
		<comments>http://dreamsocket.com/2011/05/05/more-on-webviews/#comments</comments>
		<pubDate>Fri, 06 May 2011 02:18:27 +0000</pubDate>
		<dc:creator>Brad Dillon</dc:creator>
				<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/?p=22</guid>
		<description><![CDATA[This is a follow-up to Please Stop Pushing Web Views After reading my article on pushing web views, one of my co-workers pointed out a mistake. Here&#8217;s what I said: ...]]></description>
			<content:encoded><![CDATA[<p><em>This is a follow-up to <a href="http://whileyes.com/2011/05/04/please-stop-pushing-web-views/">Please Stop Pushing Web Views</a></em></p>
<p>After reading my article on pushing web views, one of my co-workers pointed out a mistake.</p>
<p>Here&#8217;s what I said:</p>
<blockquote cite="http://whileyes.com/2011/05/04/please-stop-pushing-web-views/"><p>The only reason Mobile Safari gets away with putting back and forward buttons in the bottom left is that there is never a back button in the top left of the app, as real estate is scarce up there. Note that, on the iPad, these controls are in their rightful place, thanks to the larger screen.<br />
<cite>- <a href="http://whileyes.com/2011/05/04/please-stop-pushing-web-views/">Please Stop Pushing Web Views</a></cite></p></blockquote>
<p>Michael (<a href="http://twitter.com/#!/turbotomato">@turbotomato</a>) disagrees, and points out that the HIG outlines specific use for Toolbars, as well as positioning:</p>
<blockquote cite="http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html%23//apple_ref/doc/uid/TP40006556-CH13-SW10"><p>A toolbar contains controls that perform actions related to objects in the screen or view.<br />
&#8230;<br />
On iPhone, a toolbar always appears at the bottom edge of a screen or view, but on iPad it can instead appear at the top edge.<br />
<cite>- <a href="http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html%23//apple_ref/doc/uid/TP40006556-CH13-SW10">Apple iOS UI Element Usage Guidelines</a></cite></p></blockquote>
<p>Taking this into account, it&#8217;s definitely arguable that this is the reason Mobile Safari keeps the web view navigation controls in the bottom toolbar on iPhone, vs the top on iPad. One could also argue that placing these controls in the top left on an iPhone would break consistency, because of this choice by Apple. I&#8217;ll concede that point as well.</p>
<p><a href="http://dreamsocket.com/wp/wp-content/uploads/2011/05/IMG_0823.png"><img class="alignleft" title="IMG_0823" src="http://dreamsocket.com/wp/wp-content/uploads/2011/05/IMG_0823.png" alt="" width="320" height="480" /></a>However, as Michael will agree, this doesn&#8217;t change the larger issue. Having two &#8220;Back buttons&#8221; on a screen is both confusing and sloppy.</p>
<p>Twitteriffic for iPhone seems to have <a href="http://whileyes.com/wp/wp-content/uploads/2011/05/IMG_0823.png">the best solution</a>. Modal presentation, Done button top-right, web view controls in a toolbar at the bottom, no navigation back button (unless the hyperlink was tapped inside of a modal view, but that opens a whole separate modal-on-modal can of worms, so I&#8217;ll give them full marks). Consistency achieved + HIG hounds called off.</p>
<p><em>Originally posted on the while(YES) blog on May 5th, 2011</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2011/05/05/more-on-webviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Problem With Pushing Webviews</title>
		<link>http://dreamsocket.com/2011/05/04/the-problem-with-pushing-webviews/</link>
		<comments>http://dreamsocket.com/2011/05/04/the-problem-with-pushing-webviews/#comments</comments>
		<pubDate>Thu, 05 May 2011 02:17:37 +0000</pubDate>
		<dc:creator>Brad Dillon</dc:creator>
				<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/?p=20</guid>
		<description><![CDATA[I&#8217;ve noticed a common interface pattern in several popular iOS apps that really annoys me. Let me paint a picture for you&#8230; A user is looking at a table view ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed a common interface pattern in several popular iOS apps that really annoys me. Let me paint a picture for you&#8230;</p>
<p>A user is looking at a table view of web-related content. This might be a list of Tweets, or an RSS feed, or what have you. This table view&#8217;s view controller is in a navigation controller&#8217;s stack, and a navigation bar is being used to manage navigation through the stack hierarchy. Typical navigation controller usage. Nothing out of the ordinary.</p>
<p>The user taps a hyperlink in the table view, and a web view is pushed onto the navigation stack to display the desired web page. In theory, that&#8217;s exactly what we&#8217;d expect to happen. The user is drilling down through a hierarchy, getting more specific with each step, with a back button consistently appearing in the top left of the screen, ready and willing to take them back a step. These are all things the navigation controller was made for.</p>
<p>The problem is that &#8220;back a step&#8221; bit. In this example, the back button would take us back to the previous screen, the table view. But this case adds an unforeseen twist: web views have their own navigation structure. They have their own notion of &#8220;back&#8221;.<br />
If the user taps our hyperlink, the web view is pushed onto the navigation stack, and the page loads.</p>
<p>If they then tap a link on that page, a new page loads within that web view. Now, if they want to get back to the table view, they tap the back button. However, if they want to go back to the previous WEBPAGE, they need a method to do that. A common (and mostly correct) solution to this is to add a toolbar at the bottom and provide back and forward controls for the web view.</p>
<p><a href="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-111208.jpg"><img class="wp-image-50 alignnone" title="Reeder" src="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-111208.jpg" alt="Reeder for iOS" width="166" height="249" /></a><a href="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-112204.jpg"><img class="wp-image-51 alignnone" title="Tweetbot" src="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-112204.jpg" alt="Tweetbot for iOS" width="166" height="249" /></a><a href="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-112219.jpg"><img class="wp-image-52 alignnone" title="Facebook" src="http://dreamsocket.com/wp/wp-content/uploads/2011/05/20110503-112219.jpg" alt="Facebook for iOS" width="166" height="249" /></a></p>
<p>For some visuals, see these screenshots of Reeder, TweetBot, and Facebook. Problem solved?</p>
<p>Well actually, no. This is the solution adopted by many app makers, but it turns out the user (me) has been programmed by Apple to use the trusty back button, in the top left of the screen, to go back. This is doubly enforced: both by the navigation controller&#8217;s behavior, and by virtually every web browser in the world, save Mobile Safari (iPhone/iPod). Muscle memory is a very powerful thing. Top left == back.</p>
<p>The only reason Mobile Safari gets away with putting back and forward buttons in the bottom left is that there is never a back button in the top left of the app, as real estate is scarce up there. Note that, on the iPad, these controls are in their rightful place, thanks to the larger screen.</p>
<p>I can not tell you how many times I have dug 3 or 4 pages deep on a blog I found through my favorite RSS reader, Reeder, only to have all that navigation history thrown away when I impulsively tap the wrong back button, only to return to the article index.</p>
<p>So what&#8217;s the solution? Simple. Present web views as modal views. Keep your back and forth controls in the bottom left to stay in sync with Mobile Safari (unless you&#8217;re on an iPad, then I&#8217;d argue that you should put them in the top left). Provide a Done button in the top right to allow the user to dismiss the modal and return to the previous view. Potential user confusion and rage averted.</p>
<p>Don&#8217;t underestimate the power of muscle memory when designing your user interface. Look at your choices through the lens of the user&#8217;s expectations. Don&#8217;t confuse navigation metaphors, especially the subtle ones. And please, for my sanity, stop pushing web views.</p>
<p><strong>UPDATE</strong></p>
<p><strong></strong>The fine folks at The Iconfactory have it right, by the way. Twitteriffic rocks the modal web view controller the way it should be. That&#8217;s honestly almost enough for me to switch back from TweetBot. Now if someone would just fix Reeder&#8230;</p>
<p><em>Originally posted on the while(YES) blog on May 4th, 2011</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2011/05/04/the-problem-with-pushing-webviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bear on a Wire (previously Poor Bear) IPhone game released</title>
		<link>http://dreamsocket.com/2009/09/01/bear-on-a-wire-previously-poor-bear-iphone-game-released/</link>
		<comments>http://dreamsocket.com/2009/09/01/bear-on-a-wire-previously-poor-bear-iphone-game-released/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:01:39 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/09/01/bear-on-a-wire-previously-poor-bear-iphone-game-released/</guid>
		<description><![CDATA[Bear on a Wire Trailer from bearzo on Vimeo. The Game Our first IPhone game, previously code named Poor Bear is officially available in the app store today under the ...]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/6367707?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="500" height="333"></iframe></p>
<p><a href="http://vimeo.com/6367707">Bear on a Wire Trailer</a> from <a href="http://vimeo.com/user2239705">bearzo</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h2>The Game</h2>
<p>Our <a href="http://bearonawire.com">first IPhone game</a>, previously code named Poor Bear is officially <a href="http://itunes.com/app/bearonawire">available in the app store today</a> under the name Bear on a Wire. For those of you who followed the progression of the game on our site (<a title="Annoucing Project Codename: Poor Bear" href="http://dreamsocket.com/wp/2009/03/04/annoucing-project-codename-poor-bear">1</a>, <a title="Poor Bear Stage 2: Design" href="http://dreamsocket.com/wp/2009/03/26/poor-bear-stage-2-design">2</a>, <a title="Poor Bear Update 3: Development Progress" href="http://dreamsocket.com/wp/2009/03/31/poor-bear-update-3-development-progress">3</a>, <a title="Poor Bear Update 4: Collision Detection" href="http://dreamsocket.com/wp/2009/04/15/poor-bear-update-4-collision-detection">4</a>) know that this game didn&#8217;t start with designs, requirements, deadlines, or the promise of gold bars. Instead it was built on the premise that we could make something fun that we molded just how we wanted it. That mold shifted and turned over time. Even at the starting gate, we didn&#8217;t even know what type of game we were making. The game really grew organically and took on a life of its own. I&#8217;m personally blown away with the outcome, especially considering this was Chad&#8217;s (the developer) first game and he went into it not knowing Objective C. The design is a work of art as well. However, for those of you know <a href="http://tvmstudio.com">Trevor (the designer)</a>, know that you could expect nothing less. Words can&#8217;t do justice to what 1 designer and 1 developer have done with this game. It is simply amazing and even though it is our own game, none of us can stop playing. That was the point though. We built something we loved. We hope you will too!</p>
<h2>Support Us</h2>
<p>We appreciate any support you can give us. For those with an IPhone grab the game now, rate it, and review it!<br />
APP STORE: http://itunes.com/app/bearonawire</p>
<p>For those wanting to get the word out. Here are some links to blog, twitter, AIM, tell someone on a subway, etc. We will have flyers too that you can print and post on bathroom walls, telephone polls, and anywhere in eyes view.<br />
SHARE THE BEAR!</p>
<p>APP STORE: http://itunes.com/app/bearonawire<br />
SITE: http://bearonawire.com<br />
TWITTER: http://twitter.com/bearonawire<br />
VIMEO: http://www.vimeo.com/6367707<br />
YOUTUBE: http://www.youtube.com/dreamsocket</p>
<h2>Press Release</h2>
<p>Dreamsocket &amp; TVM Studio are excited to announce they have just released Bear On A Wire.</p>
<p>URL: <a href="http://bearonawire.com/">http://bearonawire.com/</a></p>
<p>Apple app store link: <a href="http://itunes.com/app/bearonawire">http://itunes.com/app/bearonawire</a></p>
<p>About the game:<br />
Our green hero, Bearzo, has had it! No more performing for &#8220;THE MAN&#8221; day in and day out. What! Do you think he is some kind of dancing bear? NO&#8230; he is a high wire bear, and it&#8217;s time for him to make his great escape from the Big Top. He loves his fans and his work, but he just wants to be free and feel his scarf blow in the wind as he shreds wire with the most insane moves ever attempted &#8230; on a Moped&#8230; on top of high voltage power lines. Get ready to feel the power of the 49cc, two stroke, and single cylinder stallion!</p>
<p>As you tear off on the wire, try to balance Bearzo and keep him from fallingdown into the 1.21 gigawatts that alternate through the wires below him (Ah, the smell of burnt bear hair). While balancing on the wire, acquire crazy mad points by using the different stunt key combinations to generate some MOPED MAYHEM (ECO..ECo..eco) Bearzo&#8217;s stunts include no hands, half twist, full twist, bear buck, back roll, front roll, jump roll, grinder, spin roll, spin buck, spin buck grinder, coat tail, coat tail kick, and the next to impossible coat tail kick spin grinder. Combine these stunts with full flips, double flips&#8230; triple flips&#8230;? Now you are just being crazy! Collect coins and rack up even more points. I know&#8230;you never saw collectable coins coming. Don&#8217;t get caught hibernating b/c it&#8217;s about to get all GRIZZLY up in here!</p>
<p>Get pumped for BEAR ON A WIRE.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/09/01/bear-on-a-wire-previously-poor-bear-iphone-game-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor Bear Update 4: Collision Detection</title>
		<link>http://dreamsocket.com/2009/04/15/poor-bear-update-4-collision-detection/</link>
		<comments>http://dreamsocket.com/2009/04/15/poor-bear-update-4-collision-detection/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 18:33:54 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/04/15/poor-bear-update-4-collision-detection/</guid>
		<description><![CDATA[I have been working on adding tricks to PoorBear over the last week. Trevor has sent us a ton of crazy animations for tricks (I will try and throw up ...]]></description>
			<content:encoded><![CDATA[<p>I have been working on adding tricks to PoorBear over the last week. <a href="http://www.tvmstudio.com/" target="_blank">Trevor</a> has sent us a ton of crazy animations for tricks (I will try and throw up a video preview of some of them soon) as a result, I was in desperate need of a way to generate collision verts in a manner other than plotting them by hand (yeah, I plotted and translated the verts for one animation by hand and it took about an hour). I will go over the method I used to solve this problem.</p>
<p>&nbsp;</p>
<h2>The problem</h2>
<p>I am using the <a href="http://wiki.slembcke.net/main/published/Chipmunk" target="_blank">Chipmunk</a> physics engine on PoorBear and very basic collision shapes for all objects to try and keep it as fast as possible. You can make very complex objects with Chipmunk, combining many circles and polygons, but I feel that a single convex poly will provide accurate enough collision for this particular game. So, PoorBear&#8217;s body and scooter are represented with seven verts which are depicted by the orange dots below:</p>
<p><img class="center" src="http://dreamsocket.com/files/articles/2009/idle001p.jpg" alt="" /></p>
<p>Up until we decided to add tricks to the game these vertices were all that was needed to provide collision detection for PoorBear&#8217;s body and scooter. The only variation in the animation was the movement of his scarf which didn&#8217;t need any collision detection so the verts remained static. Since we want to be able to do some pretty crazy tricks, these verts are no longer sufficient because the trick animations aren&#8217;t close to the shape of these verts. For example, this is a frame from one of the tricks:</p>
<p><img class="center" src="http://dreamsocket.com/files/articles/2009/stunt10007.jpg" alt="" /></p>
<p>As you can see, not only is it a totally different shape but the image is a different size and the wheels and shocks of the scooter are also included. This particular animation has ten frames and each frame is different enough to warrant unique collision verts. We have around 15 different trick animations with as many as 40 frames each which is why it became unrealistic to plot the verts by hand.</p>
<p>I browsed the internet for advice on how to solve this problem, but being new to game development I wasn&#8217;t even sure what to search for. Someone mentioned to be that I could use a single color image to generate terrain when I was working on the level editor for PoorBear so I started thinking how I could implement something like that and apply it to this problem. The solution turned out to be simpler than I had imagined and has saved me a ton of time.</p>
<h2>The solution</h2>
<p>My solution was to open each frame in Photoshop, create a new blank layer, and draw a 1px black (could be any color) dot where I wanted each vert to be. Then simply hide the original layer and save the layer with the dots to a file. Then I wrote a little script with my scripting language of choice, Python, to grab each pixel and convert them to coordinates that I can use with the physics engine. I have since extended the script so that I can generate the verts for multiple frames and animations at once because all the animations for PoorBear are complied into 1024&#215;1024 images to cut down on the number of textures being swapped. However, I will just go over the basic steps of generating verts for a single image.</p>
<p>Below is sample of the previous image with several points drawn to form a loose polygon for collision detection. The points are overlaid on the image so that it is obvious what they represent and the points are large for the sake of clarity. The red dots have to be 1px on the real thing.</p>
<p>&nbsp;</p>
<p>Once the verts are pulled out of the image and converted to something the physics engine can understand, they will represent something like the following in the game:</p>
<p>&nbsp;</p>
<h2>The script</h2>
<p>There is a great image handling module for Python called <a href="http://www.pythonware.com/products/pil/" target="_blank">Python Imaging Library</a> (PIL) which is required for this code to work.</p>
<p>First we need to open the image saved from photoshop and pull out the pixels that were drawn. This can be done with the following code:</p>
<pre>def grab_points():
image = Image.open("/path/to/image/animation0000.png")
pixels = image.load()
width = image.size[0] # the size property is a tuple (width, height)
height = image.size[1]
points = []

for x in xrange(width):
for y in xrange(height):
if pixels[x, y][0] == 255: # could just as easily detect any color
# pixels[x, y] returns the tuple (R, G, B)
points.append([x,y])</pre>
<p>This code opens the image and loads the pixel data into memory and steps through each pixel, adding the ones with a red channel value of 255 to the points list. We could have also used a list comprehension which most likely runs more efficiently but is considerably less readable. This is what it would look like:</p>
<pre>def grab_points():
image = Image.open("/path/to/image/animation0000.png")
pixels = image.load()

points = [[x,y] for x in xrange(image.size[0) for y in xrange(image.size[1]) if pixels[x, y][0] == 0]</pre>
<p>Now that we have the location of all the pixels we drew in Photoshop, we need to convert them to something the physics engine can understand. Getting the pixel data was very simple thanks to PIL and at this step these points could be used for any physics engine with the right translations. These next steps will be more and more specific to my situation (Chimpmunk physics and the iPhone) but can be adjusted to most any project.</p>
<p>Chipmunk expects the verts to be in clockwise order and to form a convex poly. Currently, the verts are ordered by their x value. Given the image below, we need the verts in the order ABCDE but they are in the order ABECD right now.</p>
<p>I developed a simple algorithm which arranges the verts in the correct order, it has four basic steps:</p>
<ul>
<li>1. Iterate over all verts excluding the first and last</li>
<li>2. Remove the verts with a y value less that half the height of the image, saving them in a temporary list</li>
<li>3. Reverse the order of the temporary list</li>
<li>4. Append the temporary list onto the original list</li>
</ul>
<p>This is the code that does that:</p>
<pre>def sort_points(points):
length = len(points) - 1
temp = []

i = 1
while i &amp;lt; length:
y = points[i][1]
if y &amp;gt; HEIGHT / 2:
temp.append(points.pop(i))
length -= 1 # we are editing the list in place. since
# we popped a value, decrement the length
else: i += 1

temp.reverse()

[points.append(point) for point in temp]</pre>
<p>At this point, we have pulled the pixel data out of the original image and sorted the points in an order that the physics engine will understand. Now we just need to translate the points to the coordinate system used by the physics engine. The pixels were stored linearly in the <code>pixels</code> list where the first pixel in the list represented the top left pixel of the image and the last represented the bottom right pixel. This can logically be thought of as a coordinate system with the origin in the top left and the positive y-axis growing downwards. Chipmunk uses the traditional coordinate system with the origin located in the center. We just need to loop back over every point and transform them to coordinates Chipmunk understands. This code will do that:</p>
<pre>def transform_points(points):
for point in points:
x = point[0]
y = point[1]
point[0] = x - OFFSET_X if x &amp;gt; OFFSET_X else (OFFSET_X - x) * -1
point[1] = (y - OFFSET_Y) * -1 if y &amp;gt; OFFSET_Y else OFFSET_Y - y</pre>
<p>Now we have the list in an order and format that Chipmunk can use. Being that PoorBear is running on the iPhone, I just format this data to resemble a multidimensional C array and copy/paste it over into the code for the game. There are better ways to get the data over but copy/pasting is good enough for now.</p>
<p>The full script is below, I just chained each function together for simplicity.</p>
<pre>from PIL import Image

OFFSET_X = 75 # image width / 2
OFFSET_Y = 75 # image height / 2

def grab_points():
image = Image.open("/path/to/image/animation0000.png")
pixels = image.load()

points = [[x,y] for x in xrange(image.size[0]) for y in xrange(image.size[1]) if pixels[x, y][0] == 0]

sort_points(points)

def sort_points(points):
length = len(points) - 1
temp = []

i = 1
while i &amp;lt; length:
y = points[i][1]
if y &amp;gt; OFFSET_Y:
temp.append(points.pop(i))
length -= 1
else: i += 1

temp.reverse()

[points.append(point) for point in temp]

transform_points(points)

def transform_points(points):
for point in points:
x = point[0]
y = point[1]
point[0] = x - OFFSET_X if x &amp;gt; OFFSET_X else (OFFSET_X - x) * -1
point[1] = (y - OFFSET_Y) * -1 if y &amp;gt; OFFSET_Y else OFFSET_Y - y

# format the list if needed
file = open ('output.txt', 'w')
file.write (points)
file.close()

grab_points()</pre>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/04/15/poor-bear-update-4-collision-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor Bear Update 3: Development Progress</title>
		<link>http://dreamsocket.com/2009/03/31/poor-bear-update-3-development-progress/</link>
		<comments>http://dreamsocket.com/2009/03/31/poor-bear-update-3-development-progress/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 20:22:58 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/03/31/poor-bear-update-3-development-progress/</guid>
		<description><![CDATA[From our last post, you got a glimpse into Trevor&#8217;s mind and where things were headed from a design standpoint. This update shows the concrete transition of those elements into ...]]></description>
			<content:encoded><![CDATA[<p>From <a title="Poor Bear Stage 2: Design" href="http://dreamsocket.com/wp/2009/03/26/poor-bear-stage-2-design/">our last post</a>, you got a glimpse into Trevor&#8217;s mind and where things were headed from a design standpoint. This update shows the concrete transition of those elements into the game. The title screen and elements have been incorporated, along with stunt recognition (flips, wheelies), item collection, and finer game controls.</p>
<p>&nbsp;</p>
<div class="center" style="width: 500px;"><object id="swfobject-1" style="visibility: visible;" width="500" height="375" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="base" value="http:/dreamsocket.com/files/global/swf/" /><param name="flashvars" value="file=http://dreamsocket.com/files/news/2009/03/31/poorbear/poorbear_proto_update3.f4v&amp;image=http://dreamsocket.com/files/news/2009/03/31/poorbear/splash.jpg&amp;google_analytics_id=UA-7275490-1" /><param name="src" value="http://dreamsocket.com/files/global/swf/mediaplayer.swf" /><embed id="swfobject-1" style="visibility: visible;" width="500" height="375" type="application/x-shockwave-flash" src="http://dreamsocket.com/files/global/swf/mediaplayer.swf" allowFullScreen="true" base="http:/dreamsocket.com/files/global/swf/" flashvars="file=http://dreamsocket.com/files/news/2009/03/31/poorbear/poorbear_proto_update3.f4v&amp;image=http://dreamsocket.com/files/news/2009/03/31/poorbear/splash.jpg&amp;google_analytics_id=UA-7275490-1" /></object></div>
<h3>Help make Poor Happy!</h3>
<p>As you can tell, Poor Bear&#8217;s life is starting to hype up, but we have him running in different directions. He is a little confused and we&#8217;d like your input. How? Well we&#8217;ve played with different goals for Poor from beat the buzzer to collect and score. What do you think would make Poor fun? Either of those? A combination? Or something else? We have tons of ideas, but would like to know what you think in terms of the fundamental game play. Please share your thoughts in the comments or with us directly!</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/03/31/poor-bear-update-3-development-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor Bear Stage 2: Design</title>
		<link>http://dreamsocket.com/2009/03/26/poor-bear-stage-2-design/</link>
		<comments>http://dreamsocket.com/2009/03/26/poor-bear-stage-2-design/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:42:48 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/03/26/poor-bear-stage-2-design/</guid>
		<description><![CDATA[Project Poor Bear is shaping up pretty nicely, with every day bringing in a little more &#8220;flair&#8221;. Not to leave you in the dark we wanted to post some of ...]]></description>
			<content:encoded><![CDATA[<p>Project Poor Bear is shaping up pretty nicely, with every day bringing in a little more &#8220;flair&#8221;. Not to leave you in the dark we wanted to post some of the design progress and process. In addition, <a target="_blank" href="http://www.tvmstudio.com/">Trevor</a> the man behind the &#8220;flair&#8221; kindly took a step back to share some insight into the origins of his ideas for the game and process. Below are images and direct excerpts from Trevor&#8217;s mind, enjoy!</p>
<p><!--break--></p>
<p style="margin:16px 48px 0">&#8220;The idea behind project poor bear is to mesh a couple of my favorite ideas with the awesome game engine Dreamsocket came up with.  First, I love the idea of making a monumental escape from work. I think anyone can relate to that. Here we have a bear who is good at what he does, loves to do his thing, but is stuck inside the unrelenting system (the big top) that sucks the fun out of his work. Sound like your life? The next idea I&#8217;ve incorporated is one I&#8217;ve been sitting on for a while. As a kid, I used to skate board. Trust me, I sucked&#8230; real bad. Even though I didn&#8217;t have any thrashing skillz, I could imagine the possibilities. I would always look up at the power lines and imagine ridding a skate board, or bike, or rocket boots on the power lines. Man, that would be so cool. I don&#8217;t think there could be a better escape route for our high wire bear.  Of course we can&#8217;t just let our poor bear ride off into the sunset all golden parachute style. We have included a few challenges that should make for an interesting ride.  <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="margin:0 48px 16px">For the overall look, I wanted to make something that was just really fun to to interact with. I was initially going to make something all stylistic and out there, but it has been a while since I just made something tat felt cartoony. It&#8217;s almost a bad word these days. &#8220;CARTOONY.&#8221; Yeah, I feel bad even typing it. Well, I&#8217;m glad I did, because I think it really has a nice goofy look.&#8221;</p>
<h2>Splash screen development</h2>
<p>The development of the splash screen from a hand-drawn image to the (almost) completed image.</p>
<p><img class="center border" src="http://dreamsocket.com/files/news/2009/03/26/poorbear/bearSketch.jpg" style="width: 500px"/><br />
<img class="center border" src="http://dreamsocket.com/files/news/2009/03/26/poorbear/splashPeek.jpg" style="width: 500px"/></p>
<h2>In-game assets</h2>
<p>Potential objects you can expect to see in the game, from deadly barbed wire to not-so deadly squirrels.</p>
<p><img class="center border" src="http://dreamsocket.com/files/news/2009/03/26/poorbear/devImage.jpg" style="width: 500px"/></p>
<h2>Level one intro video</h2>
<p>A sample intro/theme video we are using to defined the game. It shows Poor Bear making his death defying escape from the circus.</p>
<div class="center" style="width:500px;">
<object type="application/x-shockwave-flash" data="http://dreamsocket.com/files/global/swf/mediaplayer.swf" width="480" height="320" id="swfobject-1" style="visibility: visible; "><param name="allowFullScreen" value="true"><param name="base" value="http:/dreamsocket.com/files/global/swf/"><param name="bgcolor" value="#000000"><param name="type" value="movie"><param name="flashvars" value="file=http://dreamsocket.com/files/news/2009/03/26/poorbear/level1intro.flv&amp;image=http://dreamsocket.com/files/news/2009/03/26/poorbear/videoSplash.jpg&amp;google_analytics_id=UA-7275490-1"></object></div>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/03/26/poor-bear-stage-2-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kenny Speaking at NAB2009 on Games and TV Collaborations.</title>
		<link>http://dreamsocket.com/2009/03/26/kenny-speaking-at-nab2009-on-games-and-tv-collaborations/</link>
		<comments>http://dreamsocket.com/2009/03/26/kenny-speaking-at-nab2009-on-games-and-tv-collaborations/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:34:54 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/03/26/kenny-speaking-at-nab2009-on-games-and-tv-collaborations/</guid>
		<description><![CDATA[I was asked, agreed, and received confirmation that I will be speaking at the NAB conference in Vegas this month. The presentation/panel is titled &#8220;Game &#38; TV Collaborations&#8221; and is ...]]></description>
			<content:encoded><![CDATA[<p>I was asked, agreed, and received confirmation that I will be speaking at the NAB conference in Vegas this month. The presentation/panel is titled &#8220;Game &amp; TV Collaborations&#8221; and is focused on solutions that integrate games with video based entertainment. I will be showing off the <a title="Megasode" href="http://dreamsocket.com/wp/portfolio/megasode/" target="_blank">Playstation Megasode</a> that we built a few years back and participating in the subject discussion.</p>
<p>The presentation is slated for Thursday April 23 at 10:15.<br />
You can find all the details here.</p>
<p>It should be quite interesting presenting at NAB, since the crowd is so different than a lot of the places I speak. It also marks my first attendance to the event, so I&#8217;d love to hear feedback from others that have attended in years past.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/03/26/kenny-speaking-at-nab2009-on-games-and-tv-collaborations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annoucing Project Codename: Poor Bear</title>
		<link>http://dreamsocket.com/2009/03/04/annoucing-project-codename-poor-bear/</link>
		<comments>http://dreamsocket.com/2009/03/04/annoucing-project-codename-poor-bear/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 21:48:16 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/03/04/annoucing-project-codename-poor-bear/</guid>
		<description><![CDATA[The iPhone bug bit and we have started working on a side project code named POOR BEAR. The project is a small iPhone game collaboration between the folks at Dreamsocket ...]]></description>
			<content:encoded><![CDATA[<p>The iPhone bug bit and we have started working on a side project code named POOR BEAR. The project is a small iPhone game collaboration between the folks at Dreamsocket and <a href="http://tvmstudio.com/" target="_blank">Trevor Van Meter</a>, who we consider friend of the family. For those who aren&#8217;t familiar with Trevor, you may remember his game <a href="http://trevorvanmeter.com/flyguy/" target="_blank">Fly Guy</a> that garnered a lot of praise. Trev and I (Kenny) actually went to school together and were part of the same crew of friends, so we have roots. Personally, I look at him like a renaissance guy when it comes to illustration work. He literally does it all: cartoons, toys, comics, games, you name it. Needless to say, we are excited to be working together. Right Trev <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<h2>Plot</h2>
<p>Trevor is working out the dynamics of POOR BEAR&#8217;s story line and it will evolve as we progress. Nothing is nailed in stone, but we have our basics. Our main character is a circus bear who rides bikes on tight ropes. Pretty hype already, huh? Who doesn&#8217;t love bears on bikes??? The game starts with our fearless character blasting out of a circus tent and landing on some power lines. He has some where he has to go, and he has to get there fast, so it is up to you to help him get there. A side scrolling bearrific race against time!</p>
<h2>Current State</h2>
<div style="width: 500px"><object type="application/x-shockwave-flash" data="http://dreamsocket.com/files/global/swf/mediaplayer.swf" width="500" height="370" id="swfobject-1" style="visibility: visible; "><param name="allowFullScreen" value="true"><param name="base" value="http:/dreamsocket.com/files/global/swf/"><param name="bgcolor" value="#000000"><param name="type" value="movie"><param name="flashvars" value="file=http://dreamsocket.com/files/news/2009/03/02/poorbear.stage.2/video.flv&amp;image=http://dreamsocket.com/files/news/2009/03/02/poorbear.stage.2/poorbear.jpg&amp;google_analytics_id=UA-7275490-1"></object></div>
<p>You can see from the video above, our development started by just getting basic mechanics working in the game along with a few art elements and menu screens. Some how the luck of the Irish hit, and we already have our fearless hero iPhone ready and controllable via the accelormeter and screen interaction. Tilting the phone to either side controls balance, touching the front of the phone speeds him up, and touching the back slows him down. Although some of the game elements are limited now, they along with the terrain are getting generated from a custom level editor we built in AIR. This gives us the ability to really map out and throw things in pretty rapidly. Expect good things <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Future</h2>
<p>Moving forward, there are many hours of work left at this point. We still need to settle on layouts for all the menus and screens, get art for them, add sound effects, add background music, and create levels for the game. Perhaps one of the most important tasks left is to implement a scoring system. We have not ironed out the details yet but are considering making the levels time-limited and scoring based on quickness of MR BEAR. If we go this route, things like power-ups via time bonuses and speed boosts come to mind. Finally but not least, our bear FLIPS, yes he FLIPS while jumping his bike! Obviously, we might have to take that into account too!</p>
<p>All that said, welcome to PROJECT POOR BEAR. Expect us to post our process and progress here, so you can follow along and add your 2 cents into the game. Help us shape it into something great. We want POOR BEAR to pull you into the bears shoes and have you craving to play!</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/03/04/annoucing-project-codename-poor-bear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teams, Chad Fuller, and Business Investments</title>
		<link>http://dreamsocket.com/2009/02/25/teams-chad-fuller-and-business-investments/</link>
		<comments>http://dreamsocket.com/2009/02/25/teams-chad-fuller-and-business-investments/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:43:20 +0000</pubDate>
		<dc:creator>Kenny Bunch</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://dreamsocket.com/wp/2009/02/25/teams-chad-fuller-and-business-investments/</guid>
		<description><![CDATA[Owning and running a business, the most important elements to your company are your image and the people working with you. This is even more important when you are a ...]]></description>
			<content:encoded><![CDATA[<p>Owning and running a business, the most important elements to your company are your image and the people working with you. This is even more important when you are a smaller business. If you are surrounding by the best of the best, that becomes the perception of what your company is. A small agile company composed of experts is a lot different than a large company with a few experts and a lot of worker bees. Both are valid models and neither is right or wrong. I opt for the quality over quantity approach, regardless of the income difference.</p>
<p>Therefore, when looking for folks to work on projects or to join the team, I look for people that are:</p>
<ul>
<li>a) smarter than I am</li>
<li>b) completely devoted</li>
<li>c) care</li>
</ul>
<p>It&#8217;s a decision that I don&#8217;t take lightly since I&#8217;m essentially asking someone to join a &#8220;family of friends&#8221;. That&#8217;s how I view work. It is part of your life, the people around you are part of your life, and you should surround yourself with those that bring out the best in you and themselves.</p>
<h2>Chad Fuller</h2>
<p>Last June, <a href="http://chadfuller.com">Mr. Chad Fuller</a> sent me a note mentioning that he was moving to Atlanta. I knew Chad well, knew how smart he was, but also knew that he didn&#8217;t have any work experience. Point blank, experience is huge for <a href="http://dreamsocket.com">us</a>. Due to the positioning of <a href="http://dreamsocket.com">Dreamsocket</a>, we typically receive jobs I would refer to as high experience work. Thus, we can&#8217;t have people work on the projects who don&#8217;t know the technologies better than they know their own name. It is our position and what we&#8217;ve built the business on it. So Chad was in a way a gamble. Obviously there is risk with any gamble. You either win or lose. However, I took a pretty calculated gamble and came out ahead&#8230;. way ahead. If I were in Vegas, I would probably be the owner of the Wynn right now <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>How did I win? Instead of throwing projects at Chad he would tear his hair out with, I decided to invest in him and the company. Chad&#8217;s first project was <a href="http://dreamsocket.com">dreamsocket.com</a>. If you haven&#8217;t looked at the site yet I highly advise that you do. Not out of self promotion, but to see what he accomplished. Before the project, Chad had never touched HTML or built a website. After the project he could boast a site that included a store front, live docs, bug tracker, and more all under one dynamic system. Needless to say, I&#8217;m more than impressed. Being able to own and shape it himself, Chad really was able to take value in his creation and learn a lot (at least I think he did <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).</p>
<h2>Investments</h2>
<p>Since the site was an internal project, it was an investment. We invested in defining our image more concretely, creating a way to extend our business, and developing ole Chad. Personally, I know what its like to run in his shoes. Developers that care want to learn as much as they possibly can, to work on great things, and just enjoy what they do. It felt really good to give him a project that he could call his own, mold it, and learn from. That is really what being a business owner can do for you, it can help you help others.</p>
<p>As much as the business will let me, that is what I intend to do. Invest in the folks around me. If your folks have passion, let them run with it as much as you are able to afford. Your workers will grow in strength, which will in turn mean that you get an experience level you couldn&#8217;t get any other way. On that note, Chad got the IPhone bug and I&#8217;m letting him get all over it. It means diversification and it means he continues dealing with things he is really excited about. Wait and see what he&#8217;s got running <img src='http://dreamsocket.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Look for big things on <a href="http://chadfuller.com">Chad&#8217;s blog</a> and <a href="http://dreamsocket.com/news">our site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsocket.com/2009/02/25/teams-chad-fuller-and-business-investments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

