the movement of the alien ships on the gradius game?
they move like a train right? wherein they have a pattern and moves together, keeping a distance between each other, any idea how that thing is done? thanks!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
- probably the 1st one is the one where the move is calculated and then the others take up the spaces the 1st one occupied.
- Or a list of deltas is stored and the deltas are applied to each unit after a delay.
-
ZoomBoy
- Or a list of deltas is stored and the deltas are applied to each unit after a delay.
-
ZoomBoy
quote: Original post by ZoomBoy
- probably the 1st one is the one where the move is calculated and then the others take up the spaces the 1st one occupied.
Remember, though, that if you shoot an enemy in the middle of the procession that space is not taken up. In other words, each enemy (except the first) proceeds to occupy the position of the preceding enemy. All that means for implementation is that you maintain the list/array of positions independently of the object states so that even if the object state is DEAD, the list reamins active (in entirety) until all objects are terminated.
This thread has been pacified.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
Hi guys! thanks so much for contributing, anyway so do i like just code them to follow the first one? i think that''s bad... maybe i should give them each their own ''movement''? more ideas pls? btw, ideas if possible only in C, thanks!
oh one more thing zoomboy, a list of values? well i gave them all their own delay, then after their time is up, they move... but what do you mean by giving them values after their delay is up?
how do you guys put timer''s on your game? is it also like this?
then you use the dwTimeDifference''s value to manipulate your various delay variables? ie,
oh one more thing zoomboy, a list of values? well i gave them all their own delay, then after their time is up, they move... but what do you mean by giving them values after their delay is up?
how do you guys put timer''s on your game? is it also like this?
dwTimeNow = timeGetTime(); dwTimeDifference = dwTimeNow - dwLastTime; dwLastTime = dwTimeNow;
then you use the dwTimeDifference''s value to manipulate your various delay variables? ie,
if(nextTimeToAnimate > dwTimeDifference)nextTimeToAnimate -= dwTimeDifferenceelse// time is up, you can now animate it, nextTimeToAnimate = // back to it''s original value, ie, 1000.0f if you want to animate it every sec.
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
typedef struct{ int x, y;} Vector;Vector * EnemyPositions;EnemyPositions = (EnemyPositions *)malloc(numEnemies * sizeof(Vector));//void UpdateEnemyPositions(){ int n = numEnemies; while( n >= 0 } { --n; EnemyPositions[n].x = EnemyPositions[n-1].x; EnemyPositions[n].y = EnemyPositions[n-1].y; } // relocate first enemy: EnemyPositions[0].x += nextX; EnemyPositions[0].y += nextY;}//free(EnemyPositions);
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
Edited by - Oluseyi on March 13, 2002 8:38:27 AM
You could set up a path of predefined positions, and a numeric value determines an object's place in that path.
Each tick just increment that position, and initialize each object to have a different starting position so they all move in a train.
Yeah, like Oluseyi did
Edited by - Waverider on March 13, 2002 8:44:56 AM
Each tick just increment that position, and initialize each object to have a different starting position so they all move in a train.
Yeah, like Oluseyi did
Edited by - Waverider on March 13, 2002 8:44:56 AM
It's not what you're taught, it's what you learn.
March 13, 2002 07:52 AM
I would use an simple algorithm for the movement of the alien ships. For same input in the algo, the result would always be the same. Same start position and the same velocity would generate the same movement pattern
For example, if the movement algorithm was a simple SIN function, making the alien ships move in a wave pattern.
But in the bottom there is a mathematical algo to calculate X, Y by time and speed.
For example, if the movement algorithm was a simple SIN function, making the alien ships move in a wave pattern.
But in the bottom there is a mathematical algo to calculate X, Y by time and speed.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement