<?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>Bit Battalion &#187; Our Games</title>
	<atom:link href="http://bitbattalion.com/category/games/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitbattalion.com</link>
	<description>Game Dev, Programming, Flash, Oh My!</description>
	<lastBuildDate>Sun, 05 Feb 2012 18:02:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tiny Turrets: Dev Diary #1, Humble Beginnings</title>
		<link>http://bitbattalion.com/2011/10/dev-diary-1/</link>
		<comments>http://bitbattalion.com/2011/10/dev-diary-1/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 07:46:41 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Tiny Defense]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=1074</guid>
		<description><![CDATA[BEHOLD! My very first Dev Diary. As you can tell, things have been moving a little slower than I had hoped. I&#8217;m not too worried though, I&#8217;ve learned a lot and seeing the game at such an early stage will be great to look back on in a few months. I have two more little [...]]]></description>
			<content:encoded><![CDATA[<object width="640" height="400"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=29872381"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="never"></param><param name="allownetworking" value="internal"></param><param name="flashvars" value="" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=29872381" type="application/x-shockwave-flash" allowscriptaccess="never" allownetworking="internal" allowfullscreen="true" width="640" height="400" flashvars=""></embed></object>
<p>BEHOLD! My very first Dev Diary. As you can tell, things have been moving a little slower than I had hoped. I&#8217;m not too worried though, I&#8217;ve learned a lot and seeing the game at such an early stage will be great to look back on in a few months. I have two more little bits of news too.</p>
<h3>A New Name: Tiny Turrets</h3>
<p>As it turns out, a game called &#8220;Tiny Defense&#8221; just launched on the App Store. They sent me a kind email asking me to rename so I turned to trusty twitter to find &#8220;Tiny Turrets&#8221;. Terrific! (Seriously, try saying that fast &#8211; I now have a speech impediment)</p>
<h3>A Coding Time Lapse</h3>
<object width="640" height="400"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=29872309"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="never"></param><param name="allownetworking" value="internal"></param><param name="flashvars" value="" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=29872309" type="application/x-shockwave-flash" allowscriptaccess="never" allownetworking="internal" allowfullscreen="true" width="640" height="400" flashvars=""></embed></object>
<p>This Time Lapse documents me putting together the Gui System. It&#8217;s pretty short and not all that interesting, but it does give you a bit of an insight into my work flow. I should note &#8211; I actually hid my browser in this time lapse, I spent almost 50% of my time checking the cocos2D forums and stack overflow&#8230; not all that fun to watch.</p>
<p>You&#8217;ll also notice I&#8217;m working full screen in XCode and using &#8220;ALT TAB&#8221;. It makes a ton of difference to my productivity.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/10/dev-diary-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tiny Defense: Using UIScrollView in Cocos2d</title>
		<link>http://bitbattalion.com/2011/09/uikit-uiscrollview-and-cocos2d/</link>
		<comments>http://bitbattalion.com/2011/09/uikit-uiscrollview-and-cocos2d/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 04:42:29 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Tiny Defense]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=1031</guid>
		<description><![CDATA[So as you know that I spent the weekend trying to get xcode, objective c and cocos2d to be my bitch. Most of my time I was working on a solution to implementing scrollviews in cocos2d. Turns out this isn&#8217;t as straight forward as I thought, but I found a tutorial over at getsetgames.com which gave [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://bitbattalion.com/2011/09/tiny-defense-using-uiscrollview-in-cocos2d/"><img class="size-full wp-image-1032 aligncenter" title="BlogTitle" src="http://bitbattalion.com/wp-content/uploads/2011/09/BlogTitle1.png" alt="" width="640" height="200" /></a></p>
<p>So as you know that I spent the weekend trying to get xcode, objective c and cocos2d to be my bitch.</p>
<p>Most of my time I was working on a solution to implementing scrollviews in cocos2d. Turns out this isn&#8217;t as straight forward as I thought, but I found a <a href="http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/">tutorial over at getsetgames.com</a> which gave me a good place to start. I have to warn you, the code in that <a href="http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/">tutorial</a> is pretty messy. I&#8217;ve cleaned it up a lot below.</p>
<p><span id="more-1031"></span></p>
<h3>The Problem</h3>
<p>Cocos 2d has no equivalent to UIScrollView. You can&#8217;t even use the regular UIScrollview, since it doesn&#8217;t fit into the framework. This leaves you with two possible solutions:</p>
<ol>
<li><strong><em>Reverse engineer the UIScroll View<br />
</em></strong>This would take a long time to get right. Apple has put a lot of polish into making the touch interactions perfect. There are a ton of edge cases and the code is not available to copy. Ouch.</li>
<li><span style="color: #000000;"><em><strong>Implement an invisible UIScrollView</strong></em></span><br />
And use its contentOffset property to position your CCNode. Much better!</li>
</ol>
<p>The later solution is much cleaner and has a straight forward implementation. Basically it works like this. We subclass UIScrollView, make sure it is invisible, put it on top of Cocos2d so that the user is interacting with it, then take the scroll position and apply it to the stuff in cocos2D each frame. There are a few challenges that we will have a look at, but check out the code I wrote first:</p>
<h3>Code: CCScrollView.h</h3>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;cocos2d.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@interface</span> CCScrollView <span style="color: #002200;">:</span> UIScrollView
&nbsp;
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>CCScrollView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> makeScrollViewWithWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>width Height<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>height;
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>setWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>width Height<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>height;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span> getOffset;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span> getOffsetAsPoint;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<h3>Code: CCScrollView.m</h3>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;CCScrollView.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> CCScrollView
&nbsp;
<span style="color: #11740a; font-style: italic;">/*
* Returns a CCScrollView Object.
* You can treat this like a regular UIScrollView, but don't add subviews. Instead
* use the methods getOffset and getOffsetAsPoint to set the Y Position of the
* CCNode you want to scroll each frame
*/</span>
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span>CCScrollView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> makeScrollViewWithWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>width Height<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>height
<span style="color: #002200;">&#123;</span>
   CCScrollView <span style="color: #002200;">*</span> scrollView <span style="color: #002200;">=</span>
     <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCScrollView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span>.applicationFrame<span style="color: #002200;">&#93;</span>;
   scrollView.contentSize <span style="color: #002200;">=</span> CGSizeMake<span style="color: #002200;">&#40;</span>width, height<span style="color: #002200;">&#41;</span>;
   scrollView.showsHorizontalScrollIndicator <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
   scrollView.showsVerticalScrollIndicator <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
   <span style="color: #002200;">&#91;</span>scrollView setUserInteractionEnabled<span style="color: #002200;">:</span>TRUE<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>scrollView setScrollEnabled<span style="color: #002200;">:</span>TRUE<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> addSubview<span style="color: #002200;">:</span>scrollView<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #a61390;">return</span> scrollView;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*
* Change the size of the scrollable area
*/</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>setWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>width Height<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>height
<span style="color: #002200;">&#123;</span>
   self.contentSize <span style="color: #002200;">=</span> CGSizeMake<span style="color: #002200;">&#40;</span>width, height<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*
* Returns the offset of the scrollview as a point
*/</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span> getOffsetAsPoint
<span style="color: #002200;">&#123;</span>
   CGPoint offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self contentOffset<span style="color: #002200;">&#93;</span>;
   offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> convertToGL<span style="color: #002200;">:</span> offset<span style="color: #002200;">&#93;</span>;
   offset.y <span style="color: #002200;">*=</span> <span style="color: #002200;">-</span><span style="color: #2400d9;">1</span>;
   offset.x <span style="color: #002200;">*=</span> <span style="color: #002200;">-</span><span style="color: #2400d9;">1</span>;
&nbsp;
   <span style="color: #a61390;">return</span> offset;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*
* Returns the Y co-ordinate of the offset of the ScrollView
*/</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span> getOffset
<span style="color: #002200;">&#123;</span>
   CGPoint offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self getOffsetAsPoint<span style="color: #002200;">&#93;</span>;
   <span style="color: #a61390;">return</span> offset.y;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> dealloc
<span style="color: #002200;">&#123;</span>
   <span style="color: #002200;">&#91;</span>self removeFromSuperview<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*
* Override touch functions
* This allows Cocos2d to process touches
*/</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> touchesBegan<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> touches withEvent<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> event
<span style="color: #002200;">&#123;</span>
   <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>self.dragging<span style="color: #002200;">&#41;</span>
      <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> touchesBegan<span style="color: #002200;">:</span>touches withEvent<span style="color: #002200;">:</span>event<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #002200;">&#91;</span>super touchesBegan<span style="color: #002200;">:</span> touches withEvent<span style="color: #002200;">:</span> event<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> touchesEnded<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> touches withEvent<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> event
<span style="color: #002200;">&#123;</span>
   <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>self.dragging<span style="color: #002200;">&#41;</span>
      <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> touchesEnded<span style="color: #002200;">:</span>touches withEvent<span style="color: #002200;">:</span>event<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #002200;">&#91;</span>super touchesEnded<span style="color: #002200;">:</span> touches withEvent<span style="color: #002200;">:</span> event<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@end</span></pre></div></div>

<h3>Code: Implementation.m</h3>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  Implementation.m</span>
<span style="color: #11740a; font-style: italic;">//  TinyDefense</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  Created by Sasha MacKinnon on 21/09/11.</span>
<span style="color: #11740a; font-style: italic;">//  Copyright 2011 Bit Battalion. All rights reserved.</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
<span style="color: #6e371a;">#import &quot;Implementation.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> Implementation
&nbsp;
<span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>CCScene <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> scene
<span style="color: #002200;">&#123;</span>
    CCScene <span style="color: #002200;">*</span> s <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCScene node<span style="color: #002200;">&#93;</span>;
    Implementation <span style="color: #002200;">*</span> l <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>Implementation node<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>s addChild<span style="color: #002200;">:</span>l<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">return</span> s;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>init
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
        gameNode <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCNode alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">//add the background to the game</span>
        background <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSprite spriteWithFile<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;background.png&quot;</span><span style="color: #002200;">&#93;</span>;
        background.position <span style="color: #002200;">=</span> ccp<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">160</span>, <span style="color: #2400d9;">480</span><span style="color: #002200;">&#41;</span>;
        <span style="color: #002200;">&#91;</span>gameNode addChild<span style="color: #002200;">:</span>background<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>self addChild<span style="color: #002200;">:</span> gameNode<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">//set up scrolling</span>
        scrollView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCScrollView makeScrollViewWithWidth<span style="color: #002200;">:</span><span style="color: #2400d9;">320</span> Height<span style="color: #002200;">:</span><span style="color: #2400d9;">960</span><span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #002200;">&#91;</span>self schedule<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>enterFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> enterFrame<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>ccTime<span style="color: #002200;">&#41;</span> dt
<span style="color: #002200;">&#123;</span>
    gameNode.position <span style="color: #002200;">=</span> ccp<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>scrollView getOffset<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@end</span></pre></div></div>

<h3>Setting up the UIScrollView</h3>
<p>We want an easy way to create scroll views without having to go through the hassle of manually allocing and setting properties every time w need a new one. The makeScrollViewWithWidth method does just this. It:</p>
<ul>
<li>creates the scroll view,</li>
<li>sets its content size to the arguments</li>
<li>adds itself to the OpenGLView, so it appears on the screen</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span>CCScrollView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> makeScrollViewWithWidth<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>width Height<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span>height
<span style="color: #002200;">&#123;</span>
    CCScrollView <span style="color: #002200;">*</span> scrollView <span style="color: #002200;">=</span>
       <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCScrollView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span>.applicationFrame<span style="color: #002200;">&#93;</span>;
    scrollView.contentSize <span style="color: #002200;">=</span> CGSizeMake<span style="color: #002200;">&#40;</span>width, height<span style="color: #002200;">&#41;</span>;
    scrollView.showsHorizontalScrollIndicator <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
    scrollView.showsVerticalScrollIndicator <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
    <span style="color: #002200;">&#91;</span>scrollView setUserInteractionEnabled<span style="color: #002200;">:</span>TRUE<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>scrollView setScrollEnabled<span style="color: #002200;">:</span>TRUE<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> addSubview<span style="color: #002200;">:</span>scrollView<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">return</span> scrollView;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h3>The contentOffset Property</h3>
<p>Next we need is to be able to access the position of our ScrollView after the user has scrolled. Since CCScrollView is a subclass of UIScrollView, we could access the &#8220;contentOffset&#8221; property directly, but we need to do a few transformations on that before hand to make it work the way we want. I made getter methods to make life easier:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span> getOffsetAsPoint
<span style="color: #002200;">&#123;</span>
    CGPoint offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self contentOffset<span style="color: #002200;">&#93;</span>;
    offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> convertToGL<span style="color: #002200;">:</span> offset<span style="color: #002200;">&#93;</span>;
    offset.y <span style="color: #002200;">*=</span> <span style="color: #002200;">-</span><span style="color: #2400d9;">1</span>;
    offset.x <span style="color: #002200;">*=</span> <span style="color: #002200;">-</span><span style="color: #2400d9;">1</span>;
&nbsp;
    <span style="color: #a61390;">return</span> offset;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span> getOffset
<span style="color: #002200;">&#123;</span>
    CGPoint offset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self getOffsetAsPoint<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> offset.y;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h3>Making sure touches are registered by cocos2D</h3>
<p>Right now we can have elements scrolling on the screen, but we can&#8217;t touch any of them. This is because CCScrollView is sitting on top of cocos2d, so the touches stop being processed before they hit cocos2D. To solve this we override touchBegan and touchEnd, and pass the touches down to cocos2D</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> touchesBegan<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> touches withEvent<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> event
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>self.dragging<span style="color: #002200;">&#41;</span>
        <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> touchesBegan<span style="color: #002200;">:</span>touches withEvent<span style="color: #002200;">:</span>event<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>super touchesBegan<span style="color: #002200;">:</span> touches withEvent<span style="color: #002200;">:</span> event<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> touchesEnded<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> touches withEvent<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> event
<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>self.dragging<span style="color: #002200;">&#41;</span>
        <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span> touchesEnded<span style="color: #002200;">:</span>touches withEvent<span style="color: #002200;">:</span>event<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>super touchesEnded<span style="color: #002200;">:</span> touches withEvent<span style="color: #002200;">:</span> event<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h3>Fixing the content offset bug</h3>
<p>But it STILL won&#8217;t work. Cocos2D, for some weird reason, isn&#8217;t prepared to deal with the touches we get from UIScrollView. It offsets the touches by a small margin when you scroll down far enough. I found a great solution online, which requires a quick change to CCNode.m</p>
<p style="text-align: center;"><a href="http://stackoverflow.com/questions/2457380/uiscrollview-and-cocos2d ">http://stackoverflow.com/questions/2457380/uiscrollview-and-cocos2d</a></p>
<p>Basically replace these functions in CCNode.m:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span>convertTouchToNodeSpace<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// cocos2d 1.0 rc bug when using with additional overlayed views (such as UIScrollView).</span>
    <span style="color: #11740a; font-style: italic;">// CGPoint point = [touch locationInView: [touch view]];</span>
    CGPoint point <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>touch locationInView<span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    point <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> convertToGL<span style="color: #002200;">:</span> point<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>self convertToNodeSpace<span style="color: #002200;">:</span>point<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGPoint<span style="color: #002200;">&#41;</span>convertTouchToNodeSpaceAR<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// cocos2d 1.0 rc bug when using with additional overlayed views (such as UIScrollView).</span>
    <span style="color: #11740a; font-style: italic;">// CGPoint point = [touch locationInView: [touch view]];</span>
    CGPoint point <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>touch locationInView<span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    point <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> convertToGL<span style="color: #002200;">:</span> point<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>self convertToNodeSpaceAR<span style="color: #002200;">:</span>point<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>and CCMenu.m</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>CCMenuItem <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> itemForTouch<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UITouch <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> touch <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// cocos2d 1.0 rc bug when using with additional overlayed views (such as UIScrollView).</span>
    <span style="color: #11740a; font-style: italic;">// CGPoint touchLocation = [touch locationInView: [touch view]];</span>
    CGPoint touchLocation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>touch locationInView<span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> openGLView<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    touchLocation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> convertToGL<span style="color: #002200;">:</span> touchLocation<span style="color: #002200;">&#93;</span>;
    ...</pre></div></div>

<p>And now it&#8217;s ready to go!! The code is here in full, so feel free to copy paste these classes.</p>
<h3>Fixing it for iOS 5</h3>
<p>After all this, it might still not work with iOS 5. Instead of explaining why, I&#8217;ll point you to a stack overflow answer that has the solution:</p>
<blockquote>
<p style="text-align: center;"><a href="http://stackoverflow.com/questions/4876488/animation-in-opengl-es-view-freezes-when-uiscrollview-is-dragged-on-iphone">Animation in OpenGL ES view freezes when UIScrollView is dragged on the iPhone</a></p>
</blockquote>
<h3>Whats Next</h3>
<p>I&#8217;ve done a ton of work since I made this video which I&#8217;ll post in a few days. Tonight, I&#8217;m travelling back to Australia! I&#8217;m hoping to get a bit of code written on the plane before my battery dies. Wish me luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/09/uikit-uiscrollview-and-cocos2d/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tiny Defense: Concept Art Time Lapse</title>
		<link>http://bitbattalion.com/2011/09/tiny-defense-concept-art-time-lapse/</link>
		<comments>http://bitbattalion.com/2011/09/tiny-defense-concept-art-time-lapse/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 10:41:43 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Tiny Defense]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=1010</guid>
		<description><![CDATA[Lee Lee is still going full pace on the concept art for Tiny Defence. Most recently, did some more refined, more stylised tower sketches. I bullied her into capturing the entire process in a time lapse and man it looks cool! As someone who has very little artistic talent and quite frankly has no idea [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://bitbattalion.com/2011/09/tiny-defense-concept-art-time-lapse/"><img class="aligncenter size-full wp-image-1022" title="BlogTitle" src="http://bitbattalion.com/wp-content/uploads/2011/09/BlogTitle.png" alt="" width="640" height="200" /></a></p>
<p>Lee Lee is still going full pace on the concept art for Tiny Defence. Most recently, did some more refined, more stylised tower sketches. I bullied her into capturing the entire process in a time lapse and man it looks cool!</p>
<p>As someone who has very little artistic talent and quite frankly has no idea how them artsy types do it, it&#8217;s exciting seeing the process. Here you can see her work at hyper speed from concept to&#8230; well, concept art:</p>
<object width="640" height="340"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=29307757"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="never"></param><param name="allownetworking" value="internal"></param><param name="flashvars" value="" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=29307757" type="application/x-shockwave-flash" allowscriptaccess="never" allownetworking="internal" allowfullscreen="true" width="640" height="340" flashvars=""></embed></object>
<p><span id="more-1010"></span></p>
<h3>The Science-y New Style</h3>
<p>We&#8217;ve really hit a sweet spot with style. I&#8217;m really pushing to make the towers futuristic, but cartoony. Lots of bright colours, lights, shininess and in general, lost of <strong>Science</strong>. These are much more like edge world in style, but more <strong>Scientific</strong>. I&#8217;m pretty sure I wrote in capitol letters for half an hour after seeing these. <strong>Science</strong>.</p>
<p style="text-align: center;"><a href="http://bitbattalion.com/wp-content/uploads/2011/09/TowersConcepts_03.jpg"><img class="aligncenter size-full wp-image-1011" title="TowersConcepts_03" src="http://bitbattalion.com/wp-content/uploads/2011/09/TowersConcepts_03.jpg" alt="" width="540" height="800" /></a></p>
<h3>What Next?</h3>
<p>I feel like the style has really been nailed with these drawings. The next step is to see how well we can translate it into the game. Lee Lee&#8217;s mission is to get a few monsters and towers boiled down to really, really sexy in-game sprites. Feel free to throw flowers, money, and your underpants at her.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/09/tiny-defense-concept-art-time-lapse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tiny Defense</title>
		<link>http://bitbattalion.com/2011/09/tiny-defense/</link>
		<comments>http://bitbattalion.com/2011/09/tiny-defense/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 08:09:20 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Other Stuff]]></category>
		<category><![CDATA[Tiny Defense]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=973</guid>
		<description><![CDATA[So a lot has been happening in my life recently: I launched Mr Runner 2, I moved from Australia to San Francisco, I scored a job working for Zynga and now I&#8217;m being kicked out of the country while my visa is being sorted out. Things have been pretty exciting. But somehow, amidst all this [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://bitbattalion.com/2011/09/tiny-defense/"><img class="aligncenter size-full wp-image-974" title="Tiny Defense" src="http://bitbattalion.com/wp-content/uploads/2011/09/TinyDefenseTitle.png" alt="" width="640" height="300" /></a></p>
<p>So a lot has been happening in my life recently: I launched Mr Runner 2, I moved from Australia to San Francisco, I scored a job working for Zynga and now I&#8217;m being kicked out of the country while my visa is being sorted out. Things have been pretty exciting.</p>
<p>But somehow, amidst all this chaos, I  have two months of complete freedom. I&#8217;m going to use this two months to start work on a new game. But this time, I&#8217;m going to do things a little differently.<br />
Here is what will be new:</p>
<p><span id="more-973"></span></p>
<h2>A New Game: Tiny Defense</h2>
<p>Announcing Tiny Defense! Tiny Defense is a tower defense game for the iPhone that happens in real time. You&#8217;ll be fighting off monsters for days at a time, wherever you go. As you check back each day you&#8217;ll level up and unlock new towers to fight more and more bad ass monsters. You&#8217;ll even face off against epic boss monsters!</p>
<h2>A New Artist</h2>
<p>I&#8217;m bring Lee Lee on the team to help me churn this baby out. She&#8217;s a cool girl &#8211; she&#8217;s been working on a web comic for the escapist, <a href="http://www.escapistmagazine.com/articles/view/comics/namegame">Name Game</a>. Now she&#8217;s making bad ass games with me.</p>
<p style="text-align: center;"><a href="http://lascaldaferri.tumblr.com/"><img class="aligncenter" src="http://s3.amazonaws.com/data.tumblr.com/tumblr_lr4rj2fUZ71qf35wfo1_1280.jpg?AWSAccessKeyId=AKIAJ6IHWSU3BX3X7X3Q&amp;Expires=1316328629&amp;Signature=qNhKFnGJv9abEIAn44axz4pyEOM%3D" alt="" width="583" height="541" /></a></p>
<h2>A New Platform</h2>
<p>For the first time I&#8217;m developing on the iOS. I&#8217;m using the library <a href="http://www.cocos2d-iphone.org/">cocos2d</a>. It has a shitty logo, but its a great product! The API is actually very similar to flash&#8217;s display structure. I&#8217;ve also got a great friend Joey (he made <a href="http://itunes.apple.com/us/app/cave-dweller-dy-no-mite!/id418822375?mt=8">Cave Dweller</a>) helping me out learning XCode and Objective-C.</p>
<p style="text-align: center;"><a href="http://www.cocos2d-iphone.org/"><img class="aligncenter" title="Cocos2d" src="http://karnakgames.com/wp/wp-content/uploads/2010/07/Cocos2D-logo-angry.png" alt="" width="119" height="176" /></a></p>
<p style="text-align: center;">
<p style="text-align: center;">
<h2>A New Development Style</h2>
<p>I&#8217;m going to be doing <strong>Video Dev Logs</strong> every few days to show off what I&#8217;ve done. I&#8217;ll be using <strong>Screen Flow</strong>, which is a great (but expensive) piece of screen recording software.</p>
<p>I&#8217;m also going to be doing a Time Lapse of some of my coding sessions, so you can see the development of the game in action &#8211; from start to finish. I&#8217;ve found a great piece of software for time lapses &#8211; check out Screen Ninja.</p>
<p style="text-align: center;"><a href="http://itunes.apple.com/us/app/screenflow/id422025166?mt=12"><img src="http://a1.mzstatic.com/us/r1000/074/Purple/9d/33/a4/mzi.yrwiaevq.175x175-75.png" alt="" width="175" height="175" /></a> <a href="http://itunes.apple.com/us/app/screenninja/id408219793?mt=12"><img src="http://a2.mzstatic.com/us/r1000/067/Purple/9f/d1/c7/mzi.hajfgpve.175x175-75.png" alt="" width="175" height="175" /></a></p>
<p style="text-align: center;">
<h2>Lets do this!</h2>
<p>To kick things off, I&#8217;m doing a Game jam this weekend with Joey, Sam and Jeremy. Jeremy&#8217;s rocking HTML 5, Joey&#8217;s working on some IOS stuff, Sam&#8217;s drunk right now and playing mine craft. Scratch that, he&#8217;s now using an exercise  ball amusingly  incorrectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/09/tiny-defense/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Mr Runner 2</title>
		<link>http://bitbattalion.com/2011/07/900/</link>
		<comments>http://bitbattalion.com/2011/07/900/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 21:52:34 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Mr Runner 2]]></category>
		<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=900</guid>
		<description><![CDATA[What are you waiting for? Go play it here! And then, if you would be so kind, rate it five stars on Kongregate To everyone that has been waiting with baited breath for the last few months &#8211; I&#8217;m sorry! Hopefully the extra few months that I put into the polish of the game will be [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://bitbattalion.com/games/mr-runner-2/"></a><a href="http://bitbattalion.com/games/mr-runner-2/"><img class="aligncenter size-full wp-image-906" title="MrRunner2" src="http://bitbattalion.com/wp-content/uploads/2011/07/finallyHere1.png" alt="" width="637" height="240" /></a></p>
<p style="text-align: center;">
<p>What are you waiting for? Go play it <a href="http://bitbattalion.com/games/mr-runner-2/">here</a>! And then, if you would be so kind, rate it five stars on <a href="http://www.kongregate.com/games/BitBattalion/mr-runner-2">Kongregate</a></p>
<p>To everyone that has been waiting with baited breath for the last few months &#8211; I&#8217;m sorry! Hopefully the extra few months that I put into the polish of the game will be worth while. Make sure when you play it you submit to leader boards, and race against all the people on the leaderboards, including me. If you can&#8217;t keep up to them, you can also watch their replays to see how they beat the level.</p>
<p>When you finish the game, send me an email! I&#8217;d love to hear what you thought. If anyone can get all platinum medals and all the treasure, I will knight them &#8211; this game is not easy.</p>
<p>So my adventure developing mr runner 2 has finally come to an end! Thanks to everyone that supported me and beta tested. It&#8217;s made a huge difference to me, I really appreciate your help. And thanks so much Zack James who did all the art, and Paul Kopetko, who did the amazing music. I love you guys!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/07/900/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Mr Runner 2 Trailer</title>
		<link>http://bitbattalion.com/2011/04/mr-runner-2-trailer/</link>
		<comments>http://bitbattalion.com/2011/04/mr-runner-2-trailer/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 10:14:50 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Mr Runner 2]]></category>
		<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=883</guid>
		<description><![CDATA[If you&#8217;ve been following the beta tests you&#8217;ll know that it&#8217;s almost upon us. I&#8217;ve just finished uploading the game to Flash Game License to find a sponsor, so he&#8217;ll be ready to run within a few weeks. In the mean time &#8211; enjoy the trailer above with a juicy remix of the music by [...]]]></description>
			<content:encoded><![CDATA[<object width="640" height="340"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=22877005"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="never"></param><param name="allownetworking" value="internal"></param><param name="flashvars" value="" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=22877005" type="application/x-shockwave-flash" allowscriptaccess="never" allownetworking="internal" allowfullscreen="true" width="640" height="340" flashvars=""></embed></object>
<p>If you&#8217;ve been following the beta tests you&#8217;ll know that it&#8217;s almost upon us. I&#8217;ve just finished uploading the game to Flash Game License to find a sponsor, so he&#8217;ll be ready to run within a few weeks.</p>
<p>In the mean time &#8211; enjoy the trailer above with a juicy remix of the music by Paul Kopetko.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/04/mr-runner-2-trailer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mr Runner Makeover</title>
		<link>http://bitbattalion.com/2011/02/mr-runner-makeover/</link>
		<comments>http://bitbattalion.com/2011/02/mr-runner-makeover/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 04:13:36 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Mr Runner 2]]></category>
		<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=839</guid>
		<description><![CDATA[One of the most interesting things about writing a sequel is that you feel obligated to fix everything that was wrong with the first game. I&#8217;m being almost OCD about it, which might explain why the game is running very very very slightly late. The latest thing that I&#8217;ve been working hard on is Mr Runner [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most interesting things about writing a sequel is that you feel obligated to fix everything that was wrong with the first game. I&#8217;m being almost OCD about it, which might explain why the game is running very very very slightly late.</p>
<p>The latest thing that I&#8217;ve been working hard on is Mr Runner himself. I feel like he deserves extra treatment since the game is named after him. The first game didn&#8217;t really give him much context or character development. He was just a cute black square thing running through world. It was cute. He&#8217;s still a cute black thing running through a world but now, well,</p>
<h4>Now he&#8217;s even cuter</h4>
<div id="efe-swf-1" class="efe-flash"><!-- --></div>
<h4>And has a pet, Sir Scruffs</h4>
<div id="efe-swf-2" class="efe-flash"><!-- --></div>
<p><span id="more-839"></span><strong>Here is what he used to look like</strong></p>
<div id="efe-swf-3" class="efe-flash"><!-- --></div>
<p>Suffices to say Mr Runner won&#8217;t be so alone in the second game. You&#8217;ll find out why you&#8217;re running through a world that is coming to an end.</p>
<h3>Animation lessons I Learned</h3>
<p>Animating Mr Runner wasn&#8217;t just my own doing. I&#8217;ve got a great friend who is also conviently a super talented professional animator. There were a few really interesting things that I learned from him when we sat down to animate. Here are the things I learned:</p>
<h4>Exaggerate your animation</h4>
<p>Firstly, there is almost always room to exaggerate your animation, and it looks great. Here is the same image 5x slower &#8211; it looks strange, particularly when he is squashed right into the ground. When its animating fast though, you can hardly see it. In fact, you can see it even less in his in game sprite (which is much smaller). Despite that, the one frame adds ALOT to the quality his animation.</p>
<div id="efe-swf-4" class="efe-flash"><!-- --></div>
<h4>Draw up the key poses first</h4>
<p>Make sure he looks good in his key poses, before you worry about how he looks inbetween them. Draw out exactly what your character will look like during the key points in the animation. We drew out, for example, what he would look like with his left hand forward, his left hand back, and while he was squashed towards the ground. From there, putting in the motion is just a matter of fiddling with tweens.</p>
<h4>Don&#8217;t use eases</h4>
<p>Don&#8217;t use the flash eases, create &#8220;fake&#8221; eases by keyframing. This was something that I had trouble wrapping my head around. Once you have put in an ease ease between two keyframes, its almost impossible to add any more keyframe inbetween. Doing so will often make it look the the characters velocity jumps. ugly. Instead, try putting a keyframe in the middle of your two frames, and then move it around. This will create the illusion of easing and still leave you in total control.</p>
<h4>Flash is a bitch</h4>
<p>So you might have guessed, but working with flash is a bitch. I&#8217;m still using classic animation, which might be part of it. Whenever you&#8217;re animating something its easy for one change in one frame to end up causing a chain reaction and changing the look of your animation entirely without you knowing. My advice? Save incrementally. Whenever you want to change anything, make a new save.</p>
<p>Over and out</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/02/mr-runner-makeover/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Why Pathos is Pathetic</title>
		<link>http://bitbattalion.com/2011/02/what-pathos-means/</link>
		<comments>http://bitbattalion.com/2011/02/what-pathos-means/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 05:48:18 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=820</guid>
		<description><![CDATA[I released Pathos Yesterday, and already it has had more comments than any of my other games&#8230; combined. It seems like people either love or hate it, in some cases both. I thought it would be worth writing up my own thoughts on the game and taking an inside look at the issues that have [...]]]></description>
			<content:encoded><![CDATA[<p>I released Pathos Yesterday, and already it has had more comments than any of my other games&#8230; combined. It seems like people either love or hate it, in some cases both. I thought it would be worth writing up my own thoughts on the game and taking an inside look at the issues that have been raised online.</p>
<p style="text-align: center;"><a href="http://bitbattalion.com/2011/02/what-pathos-means/"><img class="aligncenter size-full wp-image-832" title="Pathos Screenshot2" src="http://bitbattalion.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-4.54.42-PM.png" alt="" width="590" height="283" /></a></p>
<p><span id="more-820"></span>If you haven&#8217;t played the game, the post has spoilers and will ruin it for you so play it <a href="http://bitbattalion.com/games/pathos/">here</a> first.</p>
<h4>The player has very little control over the character</h4>
<p>This is a game design flaw that is hard to overlook. As a player your only role is to interact in subtle and infrequent ways with the boy. It puts you in an environment where you are forced to watch the events in a world play out &#8211; there is no skipping, and no catering for people with a short attention span. And the further and further on you get, the less and less control you have. By the very last scene you have to turn out lights to keep him moving. Paul over on IndieGames.com/blog said:</p>
<blockquote><p>this was remarkably shoddy. It had a really nice visual style, but it was torture to play. &#8220;Why do I go on&#8221;. Who knows&#8230;</p></blockquote>
<p>But here in is the point. When you realise that you are a predator, your lack of control over the boy is cast in a whole different light. You aren&#8217;t playing as the boy, you are simply trying to &#8220;force him onwards&#8221; (cliff scene). You&#8217;re manipulating him and as the game goes on his fear makes him less and less susceptible to this manipulation. Adam on my blog put it perfectly:</p>
<blockquote><p>&#8220;The whole thing was about control, to me. I was constantly fighting the kid for control the whole game—he would stop every so often and I just wanted him to get on with it. And then suddenly at the end, I had all the control…until I didn’t, because I couldn’t let him go. And then I kind of regretted pushing him forward, and chasing him down, but it was too late… I had to keep going.&#8221;</p></blockquote>
<h4>You are forced into being &#8220;evil&#8221;</h4>
<p>There is a trend in modern gaming to let you choose how &#8220;renegade&#8221; your character is &#8211; Pathos gives the finger to this trend and forces you, in surprisingly uncomfortable way, to be evil. This is initially indicative of criticism,</p>
<blockquote><p>&#8220;There’s no weight to it, because there’s no choice, except play or don’t. You can’t decide to not follow the rules, as then nothing happens.&#8221;</p></blockquote>
<p>But its not your choice that is important, it is your reaction to your lack of choice. As SpinalJack on Rock Paper Shotgun said:</p>
<blockquote><p>&#8220;Your reaction to the game says something about you. Whether or not that’s something you didn’t already know is a different story.<br />
Imagine the Stanley Milgram’s Obedience Experiment, would you hesitate to electrocute a man to death if told to do so with enough authority?<br />
Whether you felt bad/enjoyed/apathetic about hurting the boy in the game or immediately tried to do the opposite of what you were instructed to do is all part of the game/social experiment.&#8221;</p></blockquote>
<p>Adam says:</p>
<blockquote><p>&#8220;Sometimes art makes you uncomfortable. But sometimes you have to get uncomfortable to see something in a way you haven’t seen before.&#8221;</p></blockquote>
<p>By forcing the player into uncomfortable action, I was asking a question. Why do we take a back seat with video game characters so blindly? Do we play, not because we empathise, but instead in the hopes that we will eventually have &#8220;fun&#8221;? DustbinK on my blog hit the nail on the head:</p>
<blockquote><p>&#8220;It seems people don’t get that this is a “meta game” &#8211; it’s about you forcing yourself onto characters in video games without questioning whether they want you to make them do these things or not.&#8221;</p></blockquote>
<p>Of course, there is always another option. You can always quit before the end &#8211; but really, how many people are willing to do that? And why not? Why would anybody want to play as a boy who is suffering? Consumatopia on Rock Paper Shotgun raises an interesting point:</p>
<blockquote><p>&#8220;This game is actually more interesting if you interpret this game as a criticism of the “only way to win is not to play” genre rather than an instance of it. In what sense can we say that “you” are the one pushing events forward when the only other option is to halt the program? Am I also responsible for every death in every movie I’ve watched because I could have stopped the movie from playing?&#8221;</p></blockquote>
<h4>And why did I even bother making this a game?</h4>
<p>The lack of control, both over the boy and over the direction of the game has definitely been an issues for a lot of people:</p>
<blockquote><p>&#8220;This would have been better off as an animation. The bad design choices just distract from the message he&#8217;s trying to make.&#8221;</p></blockquote>
<p>But there is one fundamental reason why it has to be interactive to pull its weight:</p>
<blockquote><p>&#8220;The difference being that YOU’RE the one who is forcing this boy to go on even if you don’t have the option to do something else. It’s the difference between watching a video and pulling the trigger.&#8221;</p></blockquote>
<h4>So what DID you learn?</h4>
<blockquote><p>Also, I almost LOL&#8217;ed reading the author&#8217;s description &#8220;you will learn something about yourself&#8221;.</p></blockquote>
<p>Yes, I am pretentious, I admit. But what I meant is that Pathos might just make you think about one of these issues.</p>
<p>As a video game, it is flawed. And it&#8217;s certainly not everyones cup of tea. But whether you hated it or loved it, or both, Pathos isn&#8217;t about having fun or being &#8220;cool&#8221;, it&#8217;s about making you think, and starting a conversation. Something which it has certainly achieved.</p>
<p>I&#8217;d just like to close with a comment from MisterX on IndieGames.com, which I think sums up the experience nicely:</p>
<blockquote><p>At first I was also a little afraid of what was to come, like the boy. But, then, it becomes apparent that you are in control of him, and that he is actually afraid of *you*, suddenly erasing all suspense and turning it  into empathy for the little guy.</p></blockquote>
<p>Comments were found here:</p>
<ul>
<li><a href="http://www.indiegames.com/blog/2011/02/browser_game_pick_pathos_bit_b.html">http://www.indiegames.com/blog/2011/02/browser_game_pick_pathos_bit_b.html</a></li>
<li><a href="http://www.rockpapershotgun.com/2011/02/20/an-impossible-boy-pathos/">http://www.rockpapershotgun.com/2011/02/20/an-impossible-boy-pathos/</a></li>
<li><a href="http://bitbattalion.com/games/pathos/">http://bitbattalion.com/games/pathos/</a></li>
<li><a href="http://www.flashgamelicense.com/view_game.php?from=dev&amp;game_id=15621">http://www.flashgamelicense.com/view_game.php?from=dev&amp;game_id=15621</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/02/what-pathos-means/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>New(ish) Game: Pathos</title>
		<link>http://bitbattalion.com/2011/02/newish-game-pathos/</link>
		<comments>http://bitbattalion.com/2011/02/newish-game-pathos/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 02:04:07 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=811</guid>
		<description><![CDATA[Things in the flash game world move SLOWLY (although it might just be me). A few months ago for the Ludum Dare competition, I developed a game called Pathos. It took me 48 hours to develop, 12 hours to polish, and slightly less than two months to release into the wild. But now he has [...]]]></description>
			<content:encoded><![CDATA[<p>Things in the flash game world move SLOWLY <span style="color: #c0c0c0;"><a href="http://bitbattalion.com/2010/11/mr-runner-beta-is-up-has-release-date/">(although it might just be me)</a></span>. A few months ago for the Ludum Dare competition, I developed a game called Pathos. It took me 48 hours to develop, 12 hours to polish, and slightly less than two months to release into the wild. But now he has found a home.</p>
<p><a href="http://bitbattalion.com/games/pathos/"><img class="aligncenter size-full wp-image-812" title="PathosScreenshot" src="http://bitbattalion.com/wp-content/uploads/2011/02/pathosScreenshot.png" alt="" width="560" height="260" /></a></p>
<p><a href="http://bitbattalion.com/games/pathos/">Pathos</a> is a slow, experimental game about a boy who gets lost in another world and is trying to find his way home. It&#8217;s a short experience (about 10 minutes) and by the end of it you&#8217;ll have discovered something about the boy, the world and maybe even about yourself. It&#8217;s worth playing the whole way through.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2011/02/newish-game-pathos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chaos Invaders Soundtrack on Bandcamp</title>
		<link>http://bitbattalion.com/2010/12/chaos-invaders-soundtrack-on-bandcamp/</link>
		<comments>http://bitbattalion.com/2010/12/chaos-invaders-soundtrack-on-bandcamp/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 08:14:11 +0000</pubDate>
		<dc:creator>Sash</dc:creator>
				<category><![CDATA[Chaos Invaders]]></category>
		<category><![CDATA[Our Games]]></category>

		<guid isPermaLink="false">http://bitbattalion.com/?p=776</guid>
		<description><![CDATA[So after a whole bunch of requests, the sound track from Chaos Invaders is now downloadable for $1 (or more if you&#8217;re feeling generous) on Bandcamp! Paul Kopetko, who scored the entire game, has done such an awesome job remixing all of the tracks in-game into one epic piece of music. He&#8217;s included a whole [...]]]></description>
			<content:encoded><![CDATA[<p>So after a whole bunch of requests, the sound track from Chaos Invaders is now downloadable for $1 (or more if you&#8217;re feeling generous) on <a href="http://paulkopetko.bandcamp.com/">Bandcamp</a>!</p>
<p style="text-align: center;"><a href="http://paulkopetko.bandcamp.com/"><img class="aligncenter" title="Chaos Invaders Soundtrack" src="http://bandcamp.com/files/42/92/4292778237-1.jpg" alt="" width="350" height="350" /></a></p>
<p>Paul Kopetko, who scored the entire game, has done such an awesome job remixing all of the tracks in-game into one epic piece of music. He&#8217;s included a whole bunch of new and awesome transitions that will most probably melt your brain. You&#8217;ve been warned.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitbattalion.com/2010/12/chaos-invaders-soundtrack-on-bandcamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

