<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
	<head>
		
	<title>Coding.Cookies
</title>
<meta charset="utf-8" />
<meta name="author" content="Dominic Charley-Roy"/>
<meta name="keywords" content="dominic charley roy coding cookies programming html html5 javascript php functional js jquery css css3"/>
<meta name="description" content="A blog all about programming something awesome."/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/feed"/>
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/feed/atom"/>
<link rel="stylesheet" href="/css/page.css?version=1391868354"/>
<!--[if lt IE 9]>
<script src="/js/shiv.min.js"></script>
<![endif]-->

	</head>
	<body>
		<div class="container">
			<header class="sixteen columns page-header">
				
	<div class="page-branding">
	<a href="/"><img id="logo-image" src="/img/icon.png" alt="coding cookies logo"/></a>
	<h1>coding<br/>cookies</h1>
</div>
<nav class="page-menu">
	<ul id="page-menu-list">
		<li><a href="/" rel="home">Home</a></li>
		<li><a href="/archive">Archive</a></li>
		<li><a href="https://github.com/jokeofweek" rel="external">Github</a></li>
		<li><a href="https://twitter.com/jokeofweek" rel="external">Twitter</a></li>
		<li><a href="http://feeds.feedburner.com/codingcookies">RSS</a></li>
		<li><a href="http://feedburner.google.com/fb/a/mailverify?uri=codingcookies&amp;loc=en_US" rel="external" target="_blank">Subscribe</a></li>
	</ul>
	<select id="page-menu-select">
		<option value="" selected="selected">Browse...</option>
		<option value="/">Home</option>
		<option value="/archive">Archive</option>
		<option value="https://github.com/jokeofweek">Github</option>
		<option value="https://twitter.com/jokeofweek">Twitter</option>
		<option value="http://feeds.feedburner.com/codingcookies">RSS</option>
		<option value="http://feedburner.google.com/fb/a/mailverify?uri=codingcookies&amp;loc=en_US&blank">Subscribe</option>
	</select>
</nav>
<hr />

			</header>
			<div class="twelve columns">
				
  

<article>
	<header>
		<a id="post-building-a-roguelike-in-javascript-part-16"></a>
		<h2 class="post-title">
			<a href="/2013/11/25/building-a-roguelike-in-javascript-part-16" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 16">Building a Roguelike in Javascript - Part 16</a>
		</h2>

			<h3 class="post-subtitle">
				Help, Examine and Look Screens
			</h3>

		<h4 class="post-byline subheader">
			Posted on <time datetime="2013-11-25T15:30:00-04:00">November 25, 2013</time> (<a class='category-link' href='/category/build-a-rl' rel='tag'>Build a RL</a>, <a class='category-link' href='/category/gamedev' rel='tag'>Gamedev</a>, <a class='category-link' href='/category/javascript' rel='tag'>Javascript</a>, <a class='category-link' href='/category/roguelikes' rel='tag'>Roguelikes</a>)
		</h4>
	</header>
	<div class="post-content">
		
  <p>This is the twentieth post in the <em>Building a Roguelike in Javascript</em> series. I recommend you <a href="/2013/04/01/building-a-roguelike-in-javascript-part-1/">start at the beginning</a> unless you've been following along. This part corresponds to <a href="http://trystans.blogspot.ca/2011/10/roguelike-tutorial-15-help-examine-and.html">part 15</a> in Trystan's series. All the code for this part can be found at the <a href="https://github.com/jokeofweek/jsrogue/tree/part16">part 16 tag</a> of the <a href="https://github.com/jokeofweek/jsrogue">jsrogue repository</a>. At the time of writing, I am still using the <a href="https://github.com/ondras/rot.js/commit/d4ea2abb55432929aee1ed81cac10cebdda5aebb">d4ea2ab commit</a> for rot.js.</p>
<p>In this post we're going to add new screens to our game to make it easier to play as well as to make the environment more detailed. We'll start by adding a screen to examine the items in our inventory and get more details about them. Then we will add a look screen which effectively allows us to look around the map and get more details about items and creatures laying around. Finally we will add a help screen listing all the game commands!</p>
<h3>Demo Link</h3>
<p>The results after this post can be seen <a href="/demo/rl_part16/">here</a>.</p>


	</div>
	


	<footer>
		<a href="/2013/11/25/building-a-roguelike-in-javascript-part-16" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 16">Continue reading&#8230;</a>
	</footer>
  </article>
  <hr/>
  

<article>
	<header>
		<a id="post-creating-a-proxy-server-with-go"></a>
		<h2 class="post-title">
			<a href="/2013/09/21/creating-a-proxy-server-with-go" rel="bookmark" title="Permanent Link to Creating a Proxy Server with Go">Creating a Proxy Server with Go</a>
		</h2>


		<h4 class="post-byline subheader">
			Posted on <time datetime="2013-09-21T23:30:00-04:00">September 21, 2013</time> (<a class='category-link' href='/category/http' rel='tag'>HTTP</a>, <a class='category-link' href='/category/go' rel='tag'>Go</a>, <a class='category-link' href='/category/golang' rel='tag'>Golang</a>)
		</h4>
	</header>
	<div class="post-content">
		
  <p>I recently bought a <a href="http://www.raspberrypi.org/">Raspberry Pi</a> to tinker around with and I've been having a blast developing little applications and services for it. I've been wanting to expose some of these services however I'm skeptical about my abilities at doing Linux system administration so I figured I would expose them through another server on my network. As I've <a href="http://www.codingcookies.com/2013/03/21/consuming-json-apis-with-go/">mentioned before</a> I've been playing around with <a href="http://golang.org/">Go</a> so I figured it'd be a fun project to build a small TCP request proxying server with it. Ideally the server would listen for TCP requests and forward them to another host and/or port. Note that this post was heavily inspired by <a href="https://gist.github.com/vmihailenco/1380352">this gist by vmihailenco</a>. The complete code for this blog post can be found at the <a href="https://github.com/jokeofweek/gotcpproxy">jokeofweek/gotcpproxy repo</a>.</p>


	</div>
	


	<footer>
		<a href="/2013/09/21/creating-a-proxy-server-with-go" rel="bookmark" title="Permanent Link to Creating a Proxy Server with Go">Continue reading&#8230;</a>
	</footer>
  </article>
  <hr/>
  

<article>
	<header>
		<a id="post-building-a-roguelike-in-javascript-part-15"></a>
		<h2 class="post-title">
			<a href="/2013/09/21/building-a-roguelike-in-javascript-part-15" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 15">Building a Roguelike in Javascript - Part 15</a>
		</h2>

			<h3 class="post-subtitle">
				Event-Based Entities and a Final Boss
			</h3>

		<h4 class="post-byline subheader">
			Posted on <time datetime="2013-09-21T20:20:00-04:00">September 21, 2013</time> (<a class='category-link' href='/category/build-a-rl' rel='tag'>Build a RL</a>, <a class='category-link' href='/category/gamedev' rel='tag'>Gamedev</a>, <a class='category-link' href='/category/javascript' rel='tag'>Javascript</a>, <a class='category-link' href='/category/roguelikes' rel='tag'>Roguelikes</a>)
		</h4>
	</header>
	<div class="post-content">
		
  <p>This is the nineteenth post in the <em>Building a Roguelike in Javascript</em> series. I recommend you <a href="/2013/04/01/building-a-roguelike-in-javascript-part-1/">start at the beginning</a> unless you've been following along. This part <strong>does not</strong> correspond to a part in Trystan's series. All the code for this part can be found at the <a href="https://github.com/jokeofweek/jsrogue/tree/part15">part 15 tag</a> of the <a href="https://github.com/jokeofweek/jsrogue">jsrogue repository</a>. At the time of writing, I am still using the <a href="https://github.com/ondras/rot.js/commit/d4ea2abb55432929aee1ed81cac10cebdda5aebb">d4ea2ab commit</a> for rot.js.</p>
<p>In this point we're going to make two major changes to our game. First we are going to make our entities be more event-driven. What this means is that mixins will be able to subscribe to certain events, say when an entity dies or gains a level, and react accordingly. The second change will be adding a new final level to the game. This will allow us to have different map objects and will add a nice bit of variety to our game. As I said, this post does not correspond to a part in Trystan's series, but I do think this is the right time for this post.</p>
<h3>Demo Link</h3>
<p>The results after this post can be seen <a href="/demo/rl_part15/">here</a>.</p>


	</div>
	


	<footer>
		<a href="/2013/09/21/building-a-roguelike-in-javascript-part-15" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 15">Continue reading&#8230;</a>
	</footer>
  </article>
  <hr/>
  

<article>
	<header>
		<a id="post-building-a-roguelike-in-javascript-part-14"></a>
		<h2 class="post-title">
			<a href="/2013/09/14/building-a-roguelike-in-javascript-part-14" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 14">Building a Roguelike in Javascript - Part 14</a>
		</h2>

			<h3 class="post-subtitle">
				Experience Points and Levels
			</h3>

		<h4 class="post-byline subheader">
			Posted on <time datetime="2013-09-14T18:00:00-04:00">September 14, 2013</time> (<a class='category-link' href='/category/build-a-rl' rel='tag'>Build a RL</a>, <a class='category-link' href='/category/gamedev' rel='tag'>Gamedev</a>, <a class='category-link' href='/category/javascript' rel='tag'>Javascript</a>, <a class='category-link' href='/category/roguelikes' rel='tag'>Roguelikes</a>)
		</h4>
	</header>
	<div class="post-content">
		
  <p>This is the eighteenth post in the <em>Building a Roguelike in Javascript</em> series. I recommend you <a href="/2013/04/01/building-a-roguelike-in-javascript-part-1/">start at the beginning</a> unless you've been following along. This part corresponds to <a href="http://trystans.blogspot.ca/2011/10/roguelike-tutorial-14-experience-and.html">part 14</a> in Trystan's series. All the code for this part can be found at the <a href="https://github.com/jokeofweek/jsrogue/tree/part14">part 14 tag</a> of the <a href="https://github.com/jokeofweek/jsrogue">jsrogue repository</a>. At the time of writing, I am still using the <a href="https://github.com/ondras/rot.js/commit/d4ea2abb55432929aee1ed81cac10cebdda5aebb">d4ea2ab commit</a> for rot.js.</p>
<p>In this post, we're going to make it so that our entities can level up! Currently the only real differentiating factor between our entities is that they have a strength and defense value. We want our entities to be able to grow over time! We'll start out with a basic system in which an entity will gain experience when they kill another entity. Once enough experience is accumulated the entity will level up. In our game, we'll heal an entity when they level up and give them the choice of increasing one of their stats (max health, attack value, defense value, or sight radius). Note that entities other than our hero will also be able to level up!</p>
<h3>Demo Link</h3>
<p>The results after this post can be seen <a href="/demo/rl_part14/">here</a>.</p>


	</div>
	


	<footer>
		<a href="/2013/09/14/building-a-roguelike-in-javascript-part-14" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 14">Continue reading&#8230;</a>
	</footer>
  </article>
  <hr/>
  

<article>
	<header>
		<a id="post-building-a-roguelike-in-javascript-part-13"></a>
		<h2 class="post-title">
			<a href="/2013/09/07/building-a-roguelike-in-javascript-part-13" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 13">Building a Roguelike in Javascript - Part 13</a>
		</h2>

			<h3 class="post-subtitle">
				Aggressive Monsters
			</h3>

		<h4 class="post-byline subheader">
			Posted on <time datetime="2013-09-07T18:00:00-04:00">September 07, 2013</time> (<a class='category-link' href='/category/build-a-rl' rel='tag'>Build a RL</a>, <a class='category-link' href='/category/gamedev' rel='tag'>Gamedev</a>, <a class='category-link' href='/category/javascript' rel='tag'>Javascript</a>, <a class='category-link' href='/category/roguelikes' rel='tag'>Roguelikes</a>)
		</h4>
	</header>
	<div class="post-content">
		
  <p>This is the seventeenth post in the <em>Building a Roguelike in Javascript</em> series. I recommend you <a href="/2013/04/01/building-a-roguelike-in-javascript-part-1/">start at the beginning</a> unless you've been following along. This part corresponds to <a href="http://trystans.blogspot.ca/2011/09/roguelike-tutorial-13-aggressive.html">part 13</a> in Trystan's series. All the code for this part can be found at the <a href="https://github.com/jokeofweek/jsrogue/tree/part13">part 13 tag</a> of the <a href="https://github.com/jokeofweek/jsrogue">jsrogue repository</a>. At the time of writing, I am still using the <a href="https://github.com/ondras/rot.js/commit/d4ea2abb55432929aee1ed81cac10cebdda5aebb">d4ea2ab commit</a> for rot.js.</p>
<p>In this post, we are going to make our monsters more aggressive by making some chase down the hero! We're also going to do something a little bit different from Trystan's tutorial and add speed to the entities, so that some entities act faster than others!</p>
<h3>Demo Link</h3>
<p>The results after this post can be seen <a href="/demo/rl_part13/">here</a>.</p>


	</div>
	


	<footer>
		<a href="/2013/09/07/building-a-roguelike-in-javascript-part-13" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 13">Continue reading&#8230;</a>
	</footer>
  </article>
  <hr/>
	<div class="pagination-links">
		 <a href="/page/2" rel="next">Next Page »</a>
	</div>

			</div>
			<aside class="four columns">
				
	

<h3 class="small-caps">recent articles</h3>
<ul>
		<li>
			<a href="/2013/11/25/building-a-roguelike-in-javascript-part-16" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 16">Building a Roguelike in Javascript - Part 16</a>
		</li>
		<li>
			<a href="/2013/09/21/creating-a-proxy-server-with-go" rel="bookmark" title="Permanent Link to Creating a Proxy Server with Go">Creating a Proxy Server with Go</a>
		</li>
		<li>
			<a href="/2013/09/21/building-a-roguelike-in-javascript-part-15" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 15">Building a Roguelike in Javascript - Part 15</a>
		</li>
		<li>
			<a href="/2013/09/14/building-a-roguelike-in-javascript-part-14" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 14">Building a Roguelike in Javascript - Part 14</a>
		</li>
		<li>
			<a href="/2013/09/07/building-a-roguelike-in-javascript-part-13" rel="bookmark" title="Permanent Link to Building a Roguelike in Javascript - Part 13">Building a Roguelike in Javascript - Part 13</a>
		</li>
</ul>
<h3 class="small-caps">categories</h3>
<ul>
		<li>
			<a href="/category\api" rel="tag" title="API (1)">
				API (1)
			</a>
		</li>
		<li>
			<a href="/category\blogofile" rel="tag" title="Blogofile (1)">
				Blogofile (1)
			</a>
		</li>
		<li>
			<a href="/category\build-a-rl" rel="tag" title="Build a RL (20)">
				Build a RL (20)
			</a>
		</li>
		<li>
			<a href="/category\functional" rel="tag" title="Functional (2)">
				Functional (2)
			</a>
		</li>
		<li>
			<a href="/category\gamedev" rel="tag" title="Gamedev (21)">
				Gamedev (21)
			</a>
		</li>
		<li>
			<a href="/category\general" rel="tag" title="General (2)">
				General (2)
			</a>
		</li>
		<li>
			<a href="/category\go" rel="tag" title="Go (2)">
				Go (2)
			</a>
		</li>
		<li>
			<a href="/category\golang" rel="tag" title="Golang (2)">
				Golang (2)
			</a>
		</li>
		<li>
			<a href="/category\http" rel="tag" title="HTTP (2)">
				HTTP (2)
			</a>
		</li>
		<li>
			<a href="/category\json" rel="tag" title="JSON (1)">
				JSON (1)
			</a>
		</li>
		<li>
			<a href="/category\java" rel="tag" title="Java (1)">
				Java (1)
			</a>
		</li>
		<li>
			<a href="/category\javascript" rel="tag" title="Javascript (23)">
				Javascript (23)
			</a>
		</li>
		<li>
			<a href="/category\meta" rel="tag" title="Meta (1)">
				Meta (1)
			</a>
		</li>
		<li>
			<a href="/category\node.js" rel="tag" title="Node.js (1)">
				Node.js (1)
			</a>
		</li>
		<li>
			<a href="/category\personal" rel="tag" title="Personal (1)">
				Personal (1)
			</a>
		</li>
		<li>
			<a href="/category\procedural-content" rel="tag" title="Procedural Content (1)">
				Procedural Content (1)
			</a>
		</li>
		<li>
			<a href="/category\python" rel="tag" title="Python (1)">
				Python (1)
			</a>
		</li>
		<li>
			<a href="/category\roguelikes" rel="tag" title="Roguelikes (21)">
				Roguelikes (21)
			</a>
		</li>
		<li>
			<a href="/category\socket.io" rel="tag" title="Socket.IO (1)">
				Socket.IO (1)
			</a>
		</li>
</ul>


			</aside>
			<footer class="sixteen columns page-footer">
				
	<hr />
<small>
	<a href="/disclaimer">Disclaimer</a> - Content &#169; 2014 Dominic Charley-Roy. Powered by <a href="http://www.blogofile.com" rel="external">Blogofile</a>, <a href="http://disqus.com" rel="external">Disqus</a>, <a href="http://www.getskeleton.com/" rel="external">Skeleton</a> and <a href="https://www.heroku.com/" rel="external">Heroku</a>
</small>
<script type="text/javascript">
//<![CDATA[
(function() {
		var links = document.getElementsByTagName('a');
		var query = '?';
		for(var i = 0; i < links.length; i++) {
			if(links[i].href.indexOf('#disqus_thread') >= 0) {
				query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
			}
		}
		document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/coding-cookies/get_num_replies.js' + query + '"></' + 'script>');
	})();
//]]>
</script>


			</footer>
		</div>
		<script type="text/javascript">var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-30044994-1"]);_gaq.push(["_trackPageview"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})();</script>
		<script type="text/javascript">
			(function() {
				var menu = document.getElementById('page-menu-select');
				menu.addEventListener('change', function() {
					if (menu.value) {
						if (menu.value.substring(menu.value.length - 6) === '&blank') {
							window.open(menu.value);
						} else {
							window.location = menu.value;
						}
					}
				}, false);
			})();
		</script>
	</body>
</html>








