Re: rubygame
- From: "Bill Kelly" <billk@xxxxxxx>
- Date: Fri, 31 Aug 2007 14:54:59 +0900
From: "John Joyce" <dangerwillrobinsondanger@xxxxxxxxx>
On Aug 30, 2007, at 11:40 PM, Bill Kelly wrote:
Might i enquire as to what genre of game you had in mind?
I've written several and may be able to help.
[...]
My goal is to create a knockoff of the original Legend of Zelda. A fairly simple top-down 2d game.
Cool :)
I was having a bit of trouble getting movement to be only vertical or horizontal. That's not so crucial.
If I've understood the Gosu tutorial code correctly, it
looks as though your code would be responsible for rendering
the entire scene, and would be responsible for determining
what should be shown on screen.
If so, I'd expect any kind of perceived movement would be
your code deciding to draw all the sprites and background
at a different offset than the previous frame.
However, I didn't see any obvious method of collisions based on the graphic shape.
Ah... I noticed on the DesignRationale page:
http://code.google.com/p/gosu/wiki/DesignRationale
Sounds like collision detection is not within the scope
of Gosu.
However, for a Zelda-like game, I think you could get pretty
far on simple axis-aligned bounding boxes.
If that. ...Weren't the original Zelda's strictly tile-based?
If so, it would typically come down to just a simple grid,
and whether a particular 'square' is occupied. (I've never
played Zelda, I'm just looking at screenshots.)
If you're doing a strictly tile-based game, you may not need
to worry about shape-based sprite collisions at all.
If you do want shape-based sprite collisions, I'd recommend
maybe starting out with simple axis-aligned rectangles,
and see how far that gets you.
In one of those examples there was some small degree of sprite animation, but couldn't make sense of it.
From the tutorial, it looks like there's a helper methodcalled load_tiles that will dice up an image into an array
of sub-image tiles for you:
@animation = Gosu::Image::load_tiles(self, "media/Star.png", 25, 25, false)
Then when animating, it appears they're just taking one of
these arrays of tiles, and indexing through it based on
elapsed clock time (current millisecond tick count.)
img = @animation[Gosu::milliseconds / 100 % @animation.size];
img.draw(@x - img.width / 2.0, @y - img.height / 2.0,
ZOrder::Stars, 1, 1, @color, :additive)
I'm totally new to the game thing, so maybe I'm missing some of the standard code that would be found anywhere.
My plan is to first work out player movement, enemy movent, combat between the two, then work out all the littler details of items and what not.
Sounds like a good plan.
Since Gosu is hardware-accelerated, you may be able to get
away with simply re-drawing the whole scene every game frame.
Are you planning to have various terrain tiles, like
forest, water, stone, grass, dirt, etc.?
LOL, now I almost feel like writing a little game. :D
Regards,
Bill
.
- Follow-Ups:
- Re: rubygame
- From: John Joyce
- Re: rubygame
- References:
- rubygame
- From: John Joyce
- Re: rubygame
- From: Bill Kelly
- Re: rubygame
- From: John Joyce
- Re: rubygame
- From: Bill Kelly
- Re: rubygame
- From: John Joyce
- rubygame
- Prev by Date: Re: Ruby stupidities
- Next by Date: Re: How to make an array of hashes to a single array with all the values of these hashes ?
- Previous by thread: Re: rubygame
- Next by thread: Re: rubygame
- Index(es):
Relevant Pages
|