<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>2d RPG type games</title>
		<link>http://www.allegro.cc/forums/view/588739</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 01 Dec 2006 20:13:32 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How to games like the below:<br /><span class="remote-thumbnail"><span class="json">{"name":"img.php","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/449218d8066452ffd7bdc35bffabd454.png","w":320,"h":240,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/449218d8066452ffd7bdc35bffabd454"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/4/4/449218d8066452ffd7bdc35bffabd454-240.jpg" alt="img.php" width="240" height="180" /></span></p><p>handle collision? </p><p>My thought was that objects (but not characters) are bound to the grid with a passable/not passable flag. These games, like this one, often simulate depth. If you look at the 2 people standing by the buildings you can see their heads are &quot;on&quot; the building. How do they handle this? Do you just give characters a collision rectangle around their feet and do a BB collision check with their feet rectangle against actual grid squares that these non passable objects are on? Then draw non character objects first, then characters so they are drawn overlapping these objects? I&#39;m just thinking there is a standard way of making a game like the above and I&#39;m curious of what it is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Sun, 26 Nov 2006 03:34:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>From what I&#39;ve played of games like that, I doubt they even do bounding box collision, but just don&#39;t allow movement at all into such tiles.</p><p>As to the drawing, imagine that he screen is horizontal and you are at the bottom (front). Once you&#39;ve drawn your background tiles, draw any objects from the back first.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 26 Nov 2006 03:39:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The above game doesn&#39;t seem to move characters from tile to tile. It seems to have free movement, so some sort of checking would need to be done to see if a character can move on a tile? If it&#39;s free movement and doesn&#39;t use BB collision, how else would you do that?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Sun, 26 Nov 2006 03:45:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Uh, what exactly is the problem? Throw a bounding box that only partially covers the sprite (like around the feet) and go to town, sorting sprites by depth before you draw them?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Sun, 26 Nov 2006 04:10:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There is no problem, I was just curious on how these games handle collision.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Throw a bounding box that only partially covers the sprite (like around the feet) and go to town, sorting sprites by depth before you draw them?
</p></div></div><p>
Depth being the top of the sprite or the BB of the sprite, or another given variable about the sprite?</p><p>In this game you can walk &quot;behind&quot; the top of the building giving it more of a &quot;depth&quot;. </p><p>Am I right to assume the building is bound to the map grid and made up of smaller squares. If so do you BB each of those squares or do you make a big BB around the entire building.</p><p>I&#39;m just curious on how these things are done, and how others would do them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Sun, 26 Nov 2006 04:15:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It can be done like this:
</p><div class="source-code snippet"><div class="inner"><pre>
<span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> ty<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> ty<span class="k3">&lt;</span>TILESY<span class="k2">;</span> ty<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="k2">{</span>
<span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> tx<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> tx<span class="k3">&lt;</span>TILESX<span class="k2">;</span> tx<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="k2">{</span>
  <span class="k1">int</span> x <span class="k3">=</span> tx<span class="k3">*</span>TILESIZE<span class="k2">;</span>
  <span class="k1">int</span> y <span class="k3">=</span> ty<span class="k3">*</span>TILESIZE<span class="k2">;</span>
  
  <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_38.html" target="_blank">abs</a><span class="k2">(</span>charx-x<span class="k2">)</span><span class="k3">&lt;</span><span class="k3">=</span>BBOX_W<span class="k3">/</span><span class="n">2</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_38.html" target="_blank">abs</a><span class="k2">(</span>chary-y<span class="k2">)</span><span class="k3">&lt;</span><span class="k3">=</span>BBOX_H<span class="k3">/</span><span class="n">2</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="k3">!</span>Tiles<span class="k2">[</span>tx<span class="k2">]</span><span class="k2">[</span>ty<span class="k2">]</span><span class="k3">-</span><span class="k3">&gt;</span>Passable<span class="k2">)</span>
  <span class="k2">{</span>
    StopMovement<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <span class="k2">}</span>
<span class="k2">}</span>
<span class="k2">}</span>
</pre></div></div><p>
It should work fine, I remember doing something like this in one of my games. Of course it could be wrong, I didn&#39;t test it and I am a bit tired. Of course it would vary depending on the pivot point of your tiles, so you&#39;d have to adjust a few things.</p><p>EDIT: Not entirely sure if it&#39;s even on-topic... need more sleep.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CursedTyrant)</author>
		<pubDate>Sun, 26 Nov 2006 04:16:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You just make certain tiles unwalkable, and make certain tiles always overlap NPCs; yes, <i>you cheat.</i> Assuming the base of your buildings are wide enough no one will ever notice.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Sun, 26 Nov 2006 04:27:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So if you are doing free movement of characters (they aren&#39;t tied to any tile), do you do BB collision between the characters BB and actual tile areas?</p><p>I would think after you place your building tiles down, making 1 big rect the BB on that building would speed things up, since now you have 1 check (player BB vs building BB) as opposed to the player BB vs each tile the building is made up of. Does that seem logical or would it not make a difference really?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Sun, 26 Nov 2006 04:39:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
With actual tile areas. It&#39;s really not as slow as you might think, since at most you need to check four tiles for walkability (assuming the player&#39;s bounding box is smaller than one tile), which cuts down the time you need to spend drastically.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Sun, 26 Nov 2006 04:57:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You may look at AGDN on the tutorials, there is nice tutorial where he makes engine like that you posted screenie. There&#39;s some sort of free movement.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Sun, 26 Nov 2006 05:08:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A few boxes are enough.</p><p><span class="remote-thumbnail"><span class="json">{"name":"590582","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/5\/6576b097f2a239ecbe1e2755e0492529.png","w":320,"h":240,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/5\/6576b097f2a239ecbe1e2755e0492529"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/6/5/6576b097f2a239ecbe1e2755e0492529-240.jpg" alt="590582" width="240" height="180" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Paul whoknows)</author>
		<pubDate>Sun, 26 Nov 2006 07:33:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am working on the somewhat of the same thing. What I am trying to do is sort of like what Paul whoknows posted. I have 6 tile layers: 3 ground (below sprites grass, dirt, etc), 2 sky (above sprites tree branches, bridges) and 1 collision. </p><p>The collision layer is invisible in the game but not in the editor. I have a seperate tile sheet with different shapes and sizes: boxes, rectangles, circles all colored yellow. They are drawn onto the map just like an other tile but in the collision layer.</p><p>I have not implemented the collision yet because I have not learned about pixel perfect collision only bounding boxes plus I haven&#39;t made the game I have only made the editor. The collision tile layer is updated and moved just like the other layers. Instead of drawing it to the screen I am going to draw it to a seperate bitmap and check collison from there.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (KnightWhoSaysNi)</author>
		<pubDate>Sun, 26 Nov 2006 21:36:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>See, there are many people working on similar projects. Anyways, the result is half an engine instead of a complete game. I recommend you to fuse to a single developer team. That is what I think will lead you you to success. Btw, I love pixelling 2d tiles. In case there will be a group of at least three programmers (and thus a real chance to get such a game finished), I`d love to help out.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mordredd)</author>
		<pubDate>Sun, 26 Nov 2006 22:17:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My tile engine works with collision detection.</p><p>Every tile has a flag &quot;walkable&quot;. If it&#39;s false the player can&#39;t step on it. I have some sort of a movement queue implemented, so it only checks the tile you would be walking over next. And yes, the player doesn&#39;t &quot;jump&quot; from tile to tile, he really &quot;walks&quot;. With animation and everything. I can share the code and/or a small techdemo if anyone cares.</p><p>@Micah: Two people are slower than one person. Three people are slower than two people. At least when it comes to conception and planning, which is the foundation of making a game. I&#39;d rather have half an engine or a poor game than nothing at all.<br />Obvious exception is when you really know the people you work with. Personally. And when you meet them frequently.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Simon Parzer)</author>
		<pubDate>Mon, 27 Nov 2006 02:58:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve played around with these sorts of things plenty a long time ago, and I found the simplest method was to have the map be just a grid of walkable/non-walkable tiles as you have stated, and the character represented by x,y coordinates rather than a bounding box. When moving, just do something like this:
</p><div class="source-code snippet"><div class="inner"><pre>  <span class="k1">if</span><span class="k2">(</span> <a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_UP<span class="k2">]</span> <span class="k2">)</span>
  <span class="k2">{</span>
    <span class="k1">if</span><span class="k2">(</span> is_free<span class="k2">(</span>x, y <span class="k3">-</span> MOVE_SPEED <span class="k2">)</span>
    <span class="k2">{</span>
      do_animation<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
      y <span class="k3">-</span><span class="k3">=</span> MOVE_SPEED<span class="k2">;</span>
    <span class="k2">}</span>
  <span class="k2">}</span>

  <span class="k1">do</span> other keys here.
</pre></div></div><p>

Where is_free(x, y) checks if the position is not in contact with a non-walkable tile or some sort of solid object(such as an NPC). If you want the character to move over full tiles rather than just a speed(or, &quot;free movement&quot; as someone called it), just use newx and newy variables and interpolate rather than changing the coordinates right away.</p><p>And for handling depth, when the map is loaded, you should assign each tile a depth.  depth = -(y); works very well. Movable objects should, of course, update their depth each time they are moved, and when drawing, the array needs to be sorted.</p><p>Most of what I have said is probably stuff you already knew, but it reaffirms your thoughts that they can work rather well. I&#39;ve had good experiences with them, at least.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elverion)</author>
		<pubDate>Mon, 27 Nov 2006 11:05:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My two cents. Don&#39;t move your character and then check for collision, if collided then move them back. That can get buggy.
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">//Not good method</span>
<span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_RIGHT<span class="k2">]</span><span class="k2">)</span> <span class="k2">{</span>
  player.x<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
  <span class="k1">if</span><span class="k2">(</span>collided<span class="k2">(</span>player.x,player.y<span class="k2">)</span><span class="k2">)</span>
    player.x--<span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

Rather, check for the collision first, and permit passage if there&#39;s no collision.
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_RIGHT<span class="k2">]</span><span class="k2">)</span> <span class="k2">{</span>
  <span class="k1">if</span><span class="k2">(</span>collided<span class="k2">(</span>player.x<span class="k3">+</span><span class="n">1</span>,player.y<span class="k2">)</span>
    player.x<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Mon, 27 Nov 2006 11:23:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Of course, working in a group is different from working alone. It seems that people do not understand that 15 minutes of gameplay can&#39;t be called a game. On the inet everyone is a pro and working on his big deal, but in fact you`re not getting more than a crappy tileengine, which itself makes half an engine.</p><p>When it comes down to splitting tasks you could supply even a team of ten hobbyist developers: Webdesign and Webmastering, Engine ( 2 programmers ), Scripting, Storywriting, Music, Music Handling, Graphics ( Ingame, GUI )...<br />If that is not enough let one programmer go through the code and clean it.</p><p>Engine writing should be modular, so you can split tasks again. You see: if programmer a let`s say is going to write on the rendering routines where programmer b works on the ai, there is no need for knowing each other personally. Often every programmer wants to do everything, so this will lead to chaos. But that is not my idea&#39;s weakness...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mordredd)</author>
		<pubDate>Mon, 27 Nov 2006 11:42:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Engine writing should be modular, so you can split tasks again. You see: if programmer a let`s say is going to write on the rendering routines where programmer b works on the ai, there is no need for knowing each other personally. Often every programmer wants to do everything, so this will lead to chaos. But that is not my idea&#39;s weakness...
</p></div></div><p>

Ok, let&#39;s try it. Open a &quot;new team project&quot; thread and I&#39;m in. I can supply working code for drawing routines and a tile engine. Furthermore I have several great game ideas, some really innovative stuff. I&#39;m sure we&#39;ll find another programmer, then you do the graphics. Musicians and webmasters should be easy to find, too.<br />Oh, wait.. isn&#39;t it Monday today? <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" /> <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><p>About the &quot;Engine writing should be modular&quot;:<br />It SHOULD be modular but it isn&#39;t. A good game engine is built bottom-up. GFX/Sound/Input layer, on top of that a tile engine, on top of that basic game logic like collision detection, on top of that maybe a scripting engine utilizing the lower-level functions and on top of that the high-level logic. Notice the many &quot;on top of that&quot;s? You gotta know the entire existing code base if you want to work on a new layer. Yeah, or you have a good design plan -- the architecture of the finished engine before you start coding.</p><p><span class="remote-thumbnail"><span class="json">{"name":"590595","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/3\/835938715af9625fe3deb744a3b70866.png","w":700,"h":300,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/3\/835938715af9625fe3deb744a3b70866"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/8/3/835938715af9625fe3deb744a3b70866-240.jpg" alt="590595" width="240" height="102" /></span><br />Image: Modular vs. Bottom-up
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Simon Parzer)</author>
		<pubDate>Mon, 27 Nov 2006 13:44:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Would it be valid to create depth for static objects vs moveable objects at the editor level? Like for a tree I can put it&#39;s branches and leafs on a foreground level, so when the player walks on it they always get drawn over the player.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Tue, 28 Nov 2006 01:32:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>it is valid and that is what i am doing in my game <a href="http://www.allegro.cc/depot/Thegame/">http://www.allegro.cc/depot/Thegame/</a>.</p><p>my game is what i came up with after i looked at the AGDN rpg tutorial.</p><p>i will up data it now so you get fresh example.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Tue, 28 Nov 2006 02:42:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As piccolo said, it is valid. In fact, many old RPGs done it this way. Typically, the depth of each tile is determined by which layer it is on. The problem arises with larger, movable sprites, though. Consider if, for example, a larger than normal creature of some sort were to walk in front of the tree. If part of its sprite is taler than the tile width, then he would appear in front of the tree stump, but underneath the tree&#39;s branches. To counteract this, I would suggest you still take Y position into consideration when calculating the depth value for your tiles.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elverion)</author>
		<pubDate>Tue, 28 Nov 2006 03:18:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I didn&#39;t think about that Elverion. The problem is my tree is placed as x amount of separate tiles. To use the whole Y value sorting thing I would have to have the tree as one image it seems.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Tue, 28 Nov 2006 06:22:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ideally, yes. But you can also use the layer to find out the correct depth, and that should work with multiple tiles.</p><p>depth = -( y + layer offset )<br />where layer offset is computed as:<br />layer offset = ( layer - base layer ) * TILE_SIZE<br />where base layer is assumed to be the layer where the NPCs would normally walk around.</p><p>So, as long as you place the stumps at the base layer (which you should, because they would represent a non-walkable tile), and the branches a layer above that, I think that should work. This might be a bit more work than is necessary, so you might just use the simple method with layers.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elverion)</author>
		<pubDate>Tue, 28 Nov 2006 06:54:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think I&#39;ll just put all &quot;objects&quot; on the same layer and just sort by the y value of it&#39;s collision rectangle.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Tue, 28 Nov 2006 07:26:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;ll wind up putting layers in later <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Tue, 28 Nov 2006 09:13:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>hmm for object that don&#39;t move like trees and houses i put the bottom part on the lower layer then the top on the layer above it. like so.</p><p> 	http://www.allegro.cc/depot/screenshots/3138_large.jpg  layer 2</p><p> 	http://www.allegro.cc/depot/screenshots/3139_large.jpg  layer 3</p><p>this way you can put you none passable zones and the base of the house or tree. when you do this it make the object appear 3D because the top part of the object will be draw after the player object so it will look like the player is be hide the tree.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Tue, 28 Nov 2006 10:05:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s find if you characters are smaller than a few tiles. If one of your characters is 4 tiles tall and stands in front of your house, the top part will be drawn over him breaking the illusion. That is why I&#39;m thinking of just giving all objects collision rectangles.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Tue, 28 Nov 2006 17:41:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thats not a problem ether. what you do is break your characters in to parts draw the parts on different layers. i am also working on a characters editor the works with characters parts. that is also for my MMrpg and is located in the depot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Tue, 28 Nov 2006 20:47:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow, I guess I didn&#39;t think about putting characters on different layers. That seems like it would be a pain. I&#39;ll stick with just making collision rectangles and check against those.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Tue, 28 Nov 2006 23:09:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just sort my game objects by y coordinate and draw top down. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>My big sticking point (and I have an idea for this that suits my engine, but it merits discussion here and I haven&#39;t seen it brought up) is brideges and things you can walk iver/under. Fenix Blade, as well as quite a few of the old SNES RPG&#39;s, can do this and it&#39;s very effective both in terms of looking cool and possibly making map layouts a bit more efficient.</p><p>Attached a quick montage for visual reference:</p><p><span class="remote-thumbnail"><span class="json">{"name":"590613","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/6\/a698b3e99672e36c106cf99a6cce39ec.png","w":600,"h":140,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/6\/a698b3e99672e36c106cf99a6cce39ec"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/a/6/a698b3e99672e36c106cf99a6cce39ec-240.jpg" alt="590613" width="240" height="56" /></span></p><p>Ideas on how to do that?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Tue, 28 Nov 2006 23:49:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe putting those bridges onto different layer. Or even better idea: having separate layers for each ground level - only problem is with travelling between them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Wed, 29 Nov 2006 00:49:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Or even better idea: having separate layers for each ground level - only problem is with travelling between them.
</p></div></div><p>
This is my thinking, yes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Wed, 29 Nov 2006 00:50:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>there should not be a problem this is how my games works.</p><p>edit
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">void</span> CharacterList::draw<span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> bmp,<span class="k1">int</span> lay,View v <span class="k2">)</span></td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>&#160;</td></tr><tr><td class="number">4</td><td><span class="k1">for</span><span class="k2">(</span> <span class="k1">int</span> i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> numItems<span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span> <span class="k2">)</span></td></tr><tr><td class="number">5</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">6</td><td>    <span class="k1">if</span> <span class="k2">(</span>characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.Get_layer<span class="k2">(</span><span class="k2">)</span><span class="k3">=</span><span class="k3">=</span> lay<span class="k2">)</span></td></tr><tr><td class="number">7</td><td>    <span class="k2">{</span>  </td></tr><tr><td class="number">8</td><td>      </td></tr><tr><td class="number">9</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.do_moveing<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.animate<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.draw<span class="k2">(</span>bmp,v<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.showname<span class="k2">(</span>bmp,v<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.showlife<span class="k2">(</span>bmp,v<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>      characterList<span class="k3">&lt;</span>i&gt;-&gt;CharacterObject.talk<span class="k2">(</span>bmp,v<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">16</td><td>    </td></tr><tr><td class="number">17</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>&#160;</td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>

that is the same as<br />drawlayer(1);<br />drawplayer();//if player on this layer<br />drawlayer(2);<br />drawplayer();//if player on this layer<br />drawlayer(3);<br />drawplayer();//if player on this layer<br />drawlayer(4);
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Wed, 29 Nov 2006 01:18:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m just going to babble here, but maybe it&#39;s some food for thought.</p><p>Why not have infinite layers?  In fact, represent layers with Z (as in X,Y,Z).  Each tile stores an X,Y and Z variable as well as b,t,l,r variable (bottom, top, left, right).  Now, in your map editor, at any time you can pick which layer (Z) you are adding to.  So you could have grass at Z=0 and Z=10 (where 0 would be lower depth-wise than grass at 10).  Next, you set the b,t,l,r variables, which determine if you can pass the position of the tile.  Alternatively, you could just use BB, but even with b,t,l,r I don&#39;t see why this would anger free movement (although it might get a little finicky at the edges).  </p><p>Now here&#39;s the kicker:  our player is at layer z. That&#39;s z, not Z.  Meaning, the player is not on a static layer, but his layer actually changes.  Say for example you go through a door, well the door has as underlying code that sets the player&#39;s z to its Z variable.  Thus, in 23&#39;s picture (the far left one) above with the bridge and the door, say when you exit that door your now on Z=20 so z = 20.  But, before z = 0, so you&#39;d be below the bridge.  There&#39;s still a bit of confusion in the collision, but maybe it&#39;s an idea. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>[edit]<br />In the end, you&#39;ll have to sort your tiles from Z=0 to Z=highest in some kind of structure and then draw them going through your sorted list with the method above.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Wed, 29 Nov 2006 01:37:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>23yrold3yrold, the second image is from Secret of Evermore (during the Prehistoria chapter), and the third from Final Fantasy 3? I&#39;m not so sure about the first one. But yes, I would say that the best way to do that would be to put the ground over multiple layers, and move the character up or down layers when they come in contact with things like stairs or ladders. Stairs could be done by having invisible collision points at both top and bottom of the stair sprite. If the character is on layer 1, and hits the collision point at the top of the stairs, move him to layer 2. Just the opposite, if he hits the bottom of the stairs while on layer 2, move him to layer 1.</p><p>Walking over/under the bridge would be pretty easy to do, I think. On the layer that you would walk under the bridge, you do not place &#39;blocking&#39; tiles, and your depth is greater than the tiles above, so you appear under it with no problem. On the above layer, though, you should place invisible non-walkable tiles at the sides of the bridge to prevent the character from walking into nothingness. Again, your depth would be less now that you are up a layer, so you would appear above it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elverion)</author>
		<pubDate>Wed, 29 Nov 2006 01:42:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
23yrold3yrold, the second image is from Secret of Evermore (during the Prehistoria chapter), and the third from Final Fantasy 3? I&#39;m not so sure about the first one.
</p></div></div><p>
Final Fantasy IV.</p><p>And Onewing/Elverion pretty much suggested it the way I&#39;d do it. Everything in my game is an object, sorted by z for layer and then y for objects on the same layer that overlap. Tiles would have triggers moving objects between layers as they pass over them. I don&#39;t know if that&#39;s how the old classics did it, but it&#39;s my way.</p><p>Now, how to draw transparent water over the player&#39;s lower legs when he&#39;s walking in liquid. Another trick some old classics (and Fenix Blade) did .... and one that still stumps me a bit.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Wed, 29 Nov 2006 01:50:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Now, how to draw transparent water over the player&#39;s lower legs when he&#39;s walking in liquid. Another trick some old classics (and Fenix Blade) did .... and one that still stumps me a bit.
</p></div></div><p>
Funny, I was just thinking about that too when I began reading your post. I think that it&#39;s the same as walking in the high grass (another Fenix Blade feature): you just draw seafloor, then begin drawing of translucent water tiles and when it comes to player you draw him and then again the water tiles. Which will end in half of the body (legs) covered by water. Just add some nifty effect of ripples around player and you got it.</p><p>Where is Sirocco? He could help...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Wed, 29 Nov 2006 02:18:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
you just draw seafloor, then begin drawing of translucent water tiles and when it comes to player you draw him and then again the water tiles.
</p></div></div><p>
I don&#39;t know, that sounds like over-complicating things.  I&#39;ve got two ideas:</p><p>1)  The FFIV way (or some rpg game...).  When over a forest tile, the lower half of the body turns translucent.  This could just be code inside the player object, in which when the player is on certain tiles, the lower half is draw translucently (that shouldn&#39;t be too difficult to do) on top of the forest tile.  Thus, when on a water tile, the player code knows to draw the bottom half translucently.  Now, we still have the problem of the ripple effect.  This is a special function in the tile object that basically is run when the player is moving on top of a water tile.  This special function draws the ripple <i>before</i> the player is drawn, so the solid part of the player is drawn over the ripple, while the translucent part appears below the ripple, creating some sort of depth.</p><p>2)  I scratched this idea as I was writing it. <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Wed, 29 Nov 2006 02:45:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>my game can do this as well. what i do is. my player is made up of parts so using my above post code i draw all parts of the play where they need to go. in this case :<br />ground layer 1 player feet or bottom half layer 1 translucent water layer 2 player top half layer 2. in that order.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Wed, 29 Nov 2006 03:02:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Since I started this thread I&#39;m using it for transfer of text. Feel free to ignore the following.</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">bool</span> collide<span class="k2">(</span>Object<span class="k3">*</span> a, Object<span class="k3">*</span> b<span class="k2">)</span></td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>  Rect aRect, bRect<span class="k2">;</span></td></tr><tr><td class="number">4</td><td>&#160;</td></tr><tr><td class="number">5</td><td>  <span class="c">//get the actual location of the collision rect. This means the offset collision rect is added to the objects location</span></td></tr><tr><td class="number">6</td><td>  aRect <span class="k3">=</span> a-&gt;getCollisionRect<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">7</td><td>  bRect <span class="k3">=</span> b-&gt;getCollisionRect<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>  <span class="k1">if</span><span class="k2">(</span>aRect-&gt;Left <span class="k3">&gt;</span> bRect-&gt;Right<span class="k2">)</span> <span class="k1">return</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>  <span class="k1">if</span><span class="k2">(</span>aRect-&gt;Right <span class="k3">&lt;</span> bRect-&gt;Left<span class="k2">)</span> <span class="k1">return</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>  <span class="k1">if</span><span class="k2">(</span>aRect-&gt;Top <span class="k3">&gt;</span> bRect-&gt;Bottom<span class="k2">)</span> <span class="k1">return</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>  <span class="k1">if</span><span class="k2">(</span>aRect-&gt;Bottom <span class="k3">&lt;</span> bRect-&gt;Top<span class="k2">)</span> <span class="k1">return</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>&#160;</td></tr><tr><td class="number">14</td><td>  <span class="k1">return</span> <span class="k1">true</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td><span class="k2">}</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>Rect getIntersectingRect<span class="k2">(</span>Object<span class="k3">*</span> a, Object<span class="k3">*</span> b<span class="k2">)</span></td></tr><tr><td class="number">18</td><td><span class="k2">{</span></td></tr><tr><td class="number">19</td><td>  Rect aRect, bRect, result<span class="k2">;</span></td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td>  aRect <span class="k3">=</span> a-&gt;getCollisionRect<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span><span class="c">//returns the actual location (adds x &amp; y to colision rect)</span></td></tr><tr><td class="number">22</td><td>  bRect <span class="k3">=</span> b-&gt;getCollisionRect<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td>  result.Left <span class="k3">=</span> max<span class="k2">(</span>aRect.Left, bRect.Left<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>  result.Top <span class="k3">=</span> max<span class="k2">(</span>aRect.Top, bRect.Top<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">26</td><td>  result.Right <span class="k3">=</span> min<span class="k2">(</span>aRect.Right, bRect.Right<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">27</td><td>  result.Bottom <span class="k3">=</span> min<span class="k2">(</span>aRect.Bottom, bRect.Bottom<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">28</td><td><span class="k2">}</span></td></tr><tr><td class="number">29</td><td>&#160;</td></tr><tr><td class="number">30</td><td>&#160;</td></tr><tr><td class="number">31</td><td>&#160;</td></tr><tr><td class="number">32</td><td><span class="k1">void</span> checkCollision<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">33</td><td><span class="k2">{</span></td></tr><tr><td class="number">34</td><td>  Iter innerIter, outerIter<span class="k2">;</span></td></tr><tr><td class="number">35</td><td>  Rect overlap<span class="k2">;</span></td></tr><tr><td class="number">36</td><td>  Object<span class="k3">*</span> pushBackObj<span class="k2">;</span></td></tr><tr><td class="number">37</td><td>&#160;</td></tr><tr><td class="number">38</td><td>  <span class="k1">for</span><span class="k2">(</span>outerIter<span class="k3">=</span>object.being<span class="k2">(</span><span class="k2">)</span>..<span class="k2">)</span></td></tr><tr><td class="number">39</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">40</td><td>    <span class="k1">for</span><span class="k2">(</span>innerIter<span class="k3">=</span>innerIter<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span><span class="k2">)</span></td></tr><tr><td class="number">41</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">42</td><td>      <span class="c">//persons to persons don't collide, only persons to non persons can collide</span></td></tr><tr><td class="number">43</td><td>      <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><span class="k2">(</span><span class="k3">*</span>outerIter<span class="k2">)</span><span class="k3">-</span><span class="k3">&gt;</span>isPerson<span class="k2">(</span><span class="k2">)</span> <span class="k3">|</span><span class="k3">|</span> <span class="k3">!</span><span class="k2">(</span><span class="k3">*</span>innerIter<span class="k2">)</span><span class="k3">-</span><span class="k3">&gt;</span>isPerson<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">44</td><td>      <span class="k2">{</span></td></tr><tr><td class="number">45</td><td>        <span class="k1">if</span><span class="k2">(</span>collide<span class="k2">(</span><span class="k2">(</span><span class="k3">*</span>outerIter<span class="k2">)</span>, <span class="k2">(</span><span class="k3">*</span>innerIter<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">46</td><td>        <span class="k2">{</span></td></tr><tr><td class="number">47</td><td>          overlap <span class="k3">=</span> getIntersetingRect<span class="k2">(</span><span class="k2">(</span><span class="k3">*</span>outerIter<span class="k2">)</span>, <span class="k2">(</span><span class="k3">*</span>innerIter<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">48</td><td>&#160;</td></tr><tr><td class="number">49</td><td>          <span class="c">//we now know the overlapping rectangle.</span></td></tr><tr><td class="number">50</td><td>          <span class="c">//find which one is the person and based on direction they were going adjust their</span></td></tr><tr><td class="number">51</td><td>          <span class="c">//position to snug up against the static object they hit</span></td></tr><tr><td class="number">52</td><td>          <span class="k1">if</span><span class="k2">(</span><span class="k2">(</span><span class="k3">*</span>outerIter<span class="k2">)</span><span class="k3">-</span><span class="k3">&gt;</span>isPerson<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">53</td><td>            pushBackObj <span class="k3">=</span> <span class="k2">(</span><span class="k3">*</span>outerIter<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">54</td><td>          <span class="k1">else</span></td></tr><tr><td class="number">55</td><td>            pushBackObj <span class="k3">=</span> <span class="k2">(</span><span class="k3">*</span>innerIter<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">56</td><td>&#160;</td></tr><tr><td class="number">57</td><td>          <span class="c">//pushBackObj needs to be adjusted by the overlapping rect</span></td></tr><tr><td class="number">58</td><td>          <span class="c">//depending on the direction it was going</span></td></tr><tr><td class="number">59</td><td>          <span class="k1">switch</span><span class="k2">(</span>pushBackObj-&gt;getDirection<span class="k2">)</span></td></tr><tr><td class="number">60</td><td>          <span class="k2">{</span></td></tr><tr><td class="number">61</td><td>          <span class="k1">case</span> NORTH:</td></tr><tr><td class="number">62</td><td>            <span class="c">//take the height of the overlapping rect and subtract that from the objects y location</span></td></tr><tr><td class="number">63</td><td>            pushBackObj-&gt;adjustY<span class="k2">(</span><span class="k3">-</span><span class="k2">(</span>overlap.bottom <span class="k3">-</span> overlap.top<span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">64</td><td>            <span class="k1">break</span><span class="k2">;</span></td></tr><tr><td class="number">65</td><td>          <span class="k1">case</span> SOUTH:</td></tr><tr><td class="number">66</td><td>            pushBackObj-&gt;adjustY<span class="k2">(</span><span class="k2">(</span>overlap.bottom <span class="k3">-</span> overlap.top<span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">67</td><td>            <span class="k1">break</span><span class="k2">;</span></td></tr><tr><td class="number">68</td><td>          <span class="k1">case</span> EAST:</td></tr><tr><td class="number">69</td><td>            pushBackObj-&gt;adjustX<span class="k2">(</span><span class="k2">(</span>overlap.right <span class="k3">-</span> overlap.left<span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">70</td><td>            <span class="k1">break</span><span class="k2">;</span></td></tr><tr><td class="number">71</td><td>          cast WEST:</td></tr><tr><td class="number">72</td><td>            pushBackObj-&gt;adjustX<span class="k2">(</span><span class="k3">-</span><span class="k2">(</span>overlap.right <span class="k3">-</span> overlap.left<span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">73</td><td>            <span class="k1">break</span><span class="k2">;</span></td></tr><tr><td class="number">74</td><td>          <span class="k2">}</span>  </td></tr><tr><td class="number">75</td><td>        <span class="k2">}</span></td></tr><tr><td class="number">76</td><td>      <span class="k2">}</span></td></tr><tr><td class="number">77</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">78</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">79</td><td><span class="k2">}</span></td></tr><tr><td class="number">80</td><td>&#160;</td></tr><tr><td class="number">81</td><td>&#160;</td></tr><tr><td class="number">82</td><td>&#160;</td></tr><tr><td class="number">83</td><td><span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_W<span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="k3">!</span>moveNorth<span class="k2">)</span></td></tr><tr><td class="number">84</td><td><span class="k2">{</span></td></tr><tr><td class="number">85</td><td>  player-&gt;setDirection<span class="k2">(</span>NORTH<span class="k2">)</span><span class="k2">;</span>  <span class="c">//sets the direction vector of the player</span></td></tr><tr><td class="number">86</td><td>  player-&gt;setState<span class="k2">(</span>MOVE<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">87</td><td>&#160;</td></tr><tr><td class="number">88</td><td>  moveNorth <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span></td></tr><tr><td class="number">89</td><td><span class="k2">}</span></td></tr><tr><td class="number">90</td><td><span class="k1">else</span></td></tr><tr><td class="number">91</td><td><span class="k2">{</span></td></tr><tr><td class="number">92</td><td>  player-&gt;setState<span class="k2">(</span>ILDE<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">93</td><td>&#160;</td></tr><tr><td class="number">94</td><td>  moveNorth <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">95</td><td><span class="k2">}</span></td></tr><tr><td class="number">96</td><td>&#160;</td></tr><tr><td class="number">97</td><td>qezc<span class="k3">=</span>diangle movement??</td></tr><tr><td class="number">98</td><td>&#160;</td></tr><tr><td class="number">99</td><td>&#160;</td></tr><tr><td class="number">100</td><td>&#160;</td></tr><tr><td class="number">101</td><td><span class="k1">void</span> logic<span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">102</td><td><span class="k2">{</span></td></tr><tr><td class="number">103</td><td>  <span class="k1">for</span><span class="k2">(</span>objects<span class="k2">)</span></td></tr><tr><td class="number">104</td><td>  <span class="k2">{</span></td></tr><tr><td class="number">105</td><td>    <span class="k1">if</span><span class="k2">(</span>object-&gt;getState<span class="k2">(</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> MOVE<span class="k2">)</span></td></tr><tr><td class="number">106</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">107</td><td>      <span class="c">//move the object</span></td></tr><tr><td class="number">108</td><td>      object-&gt;move<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>    <span class="c">//performs the actual vector movement code</span></td></tr><tr><td class="number">109</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">110</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">111</td><td>&#160;</td></tr><tr><td class="number">112</td><td>&#160;</td></tr><tr><td class="number">113</td><td>  <span class="c">//after everything has moved check collisions that might move things back a few pixels</span></td></tr><tr><td class="number">114</td><td>  checkCollision<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">115</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Wed, 29 Nov 2006 04:14:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Thus, when on a water tile, the player code knows to draw the bottom half translucently.
</p></div></div><p>
But now not only is the water showing over the legs, so is the seafloor. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I think OICW was onto something there; draw sea floor tiles, draw player or other objects, draw water, draw ripples (if any). Then specially draw the player again, but filter out the part of the sprite that&#39;s underwater so only the top half is drawn and it looks like his lower half is submerged. That actually seems a pretty good idea ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Wed, 29 Nov 2006 12:30:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d just draw the normal water tile, then the player, then a translucent special water tile with ripples <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 29 Nov 2006 12:33:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, I&#39;m not much into this (I&#39;m just the artsitic friend of the one who plans on making the game ^^ ).</p><p>Anyway, you mention the problem of <br />A) walking in front of and behind textures, not into them.<br />B) walking in grasslands etc.</p><p>A)<br />Why don&#39;t you just make your character AND some kind of indication of the feets. This way, it&#39;s not the question if the character collides with the basis of a building. The character is forced to stop when the indicator (feets) hit the basis. Combined with the house in two layers, the character will be able to walk up to the wall, but no further!</p><p>B)<br />If you are using .gif-files anyway, why don&#39;t just place a new .gif making the illusion of high grass moving. If this is placed over the character, it would look as if the character were moving, not the layer over him/her.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (2d-forever)</author>
		<pubDate>Thu, 30 Nov 2006 15:10:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I&#39;d do it how Thomas suggested.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 30 Nov 2006 17:09:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would think the &quot;foreground&quot; layer could handle walking in water or high grass. That&#39;s pretty much what Thomas is saying.</p><p>I was put a collision rect around what would be the base of objects. Then do simple BB collison checks. It seems to be working well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 30 Nov 2006 18:41:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh by the way Rick: I thought that you&#39;re working on that isometric board game.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Fri, 01 Dec 2006 00:15:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was but I have drawing technical issues that always get in the way, harder than these top down, and it takes away from programming the gameplay, which is what I enjoy more.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Fri, 01 Dec 2006 04:15:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hehe, me too, me too. That&#39;s why I abandoned the idea of isometric engine.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Fri, 01 Dec 2006 19:42:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If I were going to go isometric nowadays, I&#39;d just use a 3D grid and camera angle like Final Fantasy Tactics. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 01 Dec 2006 20:03:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, I&#39;m thinking that if I&#39;m going to make RTS or RPG I&#39;d go for normal tiles or switch to complete 3d.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (OICW)</author>
		<pubDate>Fri, 01 Dec 2006 20:13:32 +0000</pubDate>
	</item>
</rss>
