Mail Archives: djgpp/1998/03/20/10:16:27
On Wed, 18 Mar 1998 16:21:21 EST, ChrHenz <ChrHenz AT aol DOT com> wrote:
>
>I guess the question is how to implement certain movement-patterns...
>
>Just an idea... (i haven't tried it and don't know if it is a reasonable way
>to do it)
>
>Perhaps you could create an array of 'modifiers' for the coordinates of your
>alien spaceships (or whatever).
>(Each array would then define a certain movement-pattern)
>
>int PosModifiers[2][MAX_LENGHT];
>
>Here you could then store values that you would like to add to your X/Y-
>Coordinates...
>
>In your loop to update the enemy positions you could then have something like
>this:
>
>EnemyShip.X+=PosModifiers[0][EnemyShip.ModifierIndex];
>EnemyShip.Y+=PosModifiers[1][EnemyShip.ModifierIndex];
>
>For example, if your ship should move straight down, the array would look
>like:
> 0/1
> 0/1
> 0/1 etc...
>
>or straight up:
> 0/-1
> 0/-1
> 0/-1 etc...
>
>Using a method like this you could easily alternate moving speed (still
>straight down).
> 0/1
> 0/2
> 0/3 etc for an acceleration...
>
>Any comments ?
>
>Christian.
Hi,
I've already try something like move_pattern[] & store the
define directions(like U=0, UL=1,L=2...R=6,UR=7.)
And the enemy have it's own move_pattern[], and my
main loop call the routine once for update the enemy's
direction & it's moves. But, the result is not good (I think).
Did U guys have some example(s)/comment(s) for that ?
VinN.
sorry about my poor english.
- Raw text -