[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] a bit #ot: design for a game board supporting user facing different directions?



On 30.10.2011 04:29, Alex Hall wrote:
It is real-time. I don't want it as accurate as movement acceleration
for stepping, at least not yet, but I am not sure how I would manage a
map without a grid. How, for instance, will the computer know where
the player is in relation to objects? If the player fires a weapon,
how can the computer calculate if the projectile will hit a target?
Currently I am planning to manage targeting by getting the slope of
the line and the point of the player, then extending the line to the
weapon's range and seeing if it intersects a point on which there is
an object.
For my game creation I am using the Blastbay Game Toolkit, which is a
subset of C++ but written specifically for use with audio games and
run sort of as a scripting language through an interpreter. For
instance, there is a sound class, a tts class for speaking text,
sound_pool (sort of like a "world" that manages sound positioning
relative to the player), a timer, and so on. Sound_pool, which I
subclass for my Map class, relies on a grid to properly position
sounds, which is the other reason I am using grid-based positioning. I
can't imagine how it would work with no grid. Is there a way?

On 10/29/11, René Dudfield<renesd@xxxxxxxxx>  wrote:
Hi,

a few notes, and questions...

Is your game turn based?  Or is it real time?

If you don't have realistic 3d sound, then using a grid is probably easier
for players.

Instead of frame rate, think about it like the update rate of your main
loop.

Before the player takes a step they are standing.  When standing, speed is
zero.  When stepping, the person gets some acceleration and moves.  Then
they get some deceleration and stop.

It's more complicated than that, but the more physically accurate you want
it, then more complex your code will be.  If you're more interested in
making the game, than a physics engine, you might want to consider looking
at one of the physics engines available.

Keeping the game movement to grids might make it easier to play as well as
program.


cheers,



Hi Alex

Do you know about coordinates and vectors (vector math)? This is how it is done in most games. If you make your game grid based, I have not understand if you want just go from one grid cell to another or if you want to allow arbitrary positions in between cells. According to your example it looks to me as if you want to go from one cell to another, so going diagonal would just move you to the next cell diagonally. Of course this means you travel faster because you cover a longer distance (diagonal is sqrt(2) longer) than moving orthogonal. You could restrict movement to just up/down and left/right and not allow diagonal movement at all. If you want to allow diagonal movement then you need to decide if you want to move from cell to cell (where diagonal movement is faster then) or if you want to allow arbitrary positions.

I hope it helps.

~DR0ID