On Aug 31, 2007, at 2:51 AM, Bill Kelly wrote:

>
> From: "John Joyce" <dangerwillrobinsondanger / gmail.com>
>>
>> Anymore explanation of axis-aligned rectangles? what do you mean  
>> axis- aligned? (i'm new at the game thing)
>
> Considering the origin at the lower left corner of the screen,
> you'd have the X and Y axes:
>
> Y
> ^
> |
> |
> |
> +------> X
>
> (Or sometimes Y is inverted, if your preference is to deal in  
> screen-space Y coordinates increasing from
> top of screen to bottom; but anyway...)
>
>
> In 2D, an axis-aligned bounding box would be a rectangle defined by  
> two points.  The top and bottom
> edges of the rectangle are parallel to the X axis,
> and the sides are parallel to the Y axis.
>
> This makes collision tests like point-in-rect, and
> rect-rect-overlap extremely easy to write.
>
> AABB's (axis-aligned bounding boxes) are of course
> usually an imperfect approximation of the various-
> shaped objects in a game; however for many games they
> are sufficient.  (Even recent popular 3D games like
> Quake use AABB's for collision detection.)
>
>
> If/when AABB's turn out to be too imprecise for a
> game, there are all sorts of various methods to get
> more collision resolution.  In 2D, these could include:
> collision mask shapes for sprites; other collision primitives like  
> elipsoids or rhomboids; a quadtree
> decomposition of fine-grained AABB's or rhomboids; etc.
>
>
> But anyway, for your game I'd recommend either going
> strictly tile based for simplicity; or going with
> AABB's.  My guess is most of your game should be fine with simple  
> axis-aligned collision tests.  If
> at some point you have some really weird shaped
> boss creature that needs something more precise than a rectangle  
> for collision purposes, you could
> deal with that when you get to it.  (Often, just
> using a few smaller rectangles instead of one big
> rectangle can be good enough.)
>
>
>> The tiles in Zelda are actually smaller than they seem. Where you   
>> might think there is one tile, there are usually 4 tiles.
>> My biggest frustration will no doubt be getting the motion I want.
>
> What sort of motion will that be?  Are you talking about
> how the whole world scrolls past the screen?  Or how
> various monsters animate as they move?
>
>
>> I want to basically recreate the game, though some boss enemies  
>> will  be pretty tough to build, but ultimately I'd like to  
>> reinvent it with  a new adventure with the same basic mechanics.
>
> Sounds fun.
>
>
> Regards,
>
> Bill
Thanks Bill,
That clears up a lot. You do games for a living or something?
>
As for motion, pretty simple. But needs to be just so..
The player and enemies should all move N, S, E, or W only. (remember,  
the original Nintendo's D-pad is only 4 directional)
Movement should come to a complete stop when no D-pad button (or  
arrow keys) are depressed.
In Gosu's tutorial, there is a velocity factor that I haven't quite  
got a hang of. The acceleration is ok, but needs to stop pretty  
abruptly.
Also, I'd like the movement input to immediately change direction if  
a new key is pressed, so that a new direction key overrides even a  
previously depressed direction key. Couldn't figure out how to do  
that. I tried some while loops, even inside of if's but the app  
always crashed or went infinite on me.

I think I can hack out the sprite animations, from other examples it  
seems to use something similar to a CSS rollover effect, with an  
image that actually is only displayed partially, but what part is  
displayed is changed.

The screen should only scroll for transitions from screen to screen,  
pretty common effect on 8 bit Nintendo games and Game boy/ Advance/  
DS games.

Once this is all done, everything else will be cake. Almost every  
other feature is simple event driven stuff, easy to insert into  
existing methods or functions. (play a sound, or video when something  
special occurs)

I spent last night getting pygame installed, and though it is  
installed, I know zero about python. It's pretty established so I  
will try it out. Maybe the tutorials there will give me ideas for how  
to do things in Gosu.