Ok here is what I'm trying to do, I have a group of 5x5 ships (Dark Invanders playing with the code) they are moving from one side of the screen to the other and I have disabled a lot of the game, anyway I am trying to replace the Y position on the group of ships to have them at the bottom of my screen and the code currently shares the same area for performing these 2 tasks...
The Y rows of ships and the Y position that the group is set at.
So what I need to do is somehow get them both working at the same time.
This is what I have so far.
"" "" = ""Highlights the area of code that is shared""
Code below allows 5x5 group to be displayed at (0,0)
void enemiesMoveLeft ( void )
{
// loop through the 5 rows of enemies, 5 in each row
int iSprite = 10;
//int iSpriteY = 200;
for ( int iY = 0 ; iY < 5 ; iY++ )
{
for ( int iX = 0; iX < 5 ; iX++ )
{
// make sure they are alive first
if ( g_bEnemiesAlive[iX][iY] )
dbSprite ( iSprite , dbSpriteX ( iSprite ) - (g_iEnemySpeedX) , ""dbSpriteY ( iSprite ) "", dbSpriteImage ( iSprite ) );
iSprite++;
}
}
}
Ok now if I take that "" "" area and change the ""dbSpriteY ( iSprite ) "" to "" 600 "" without the "" in code of course...
We get this code below which allows a row of 5 ships at (0,600) and we lose the 4 rows that are suppose to be drawn below the first row.
void enemiesMoveLeft ( void )
{
// loop through the 5 rows of enemies, 5 in each row
int iSprite = 10;
//int iSpriteY = 200;
for ( int iY = 0 ; iY < 5 ; iY++ )
{
for ( int iX = 0; iX < 5 ; iX++ )
{
// make sure they are alive first
if ( g_bEnemiesAlive[iX][iY] )
dbSprite ( iSprite , dbSpriteX ( iSprite ) - (g_iEnemySpeedX) , 600 , dbSpriteImage ( iSprite ) );
iSprite++;
}
}
}
I am thinking that I need to try to draw the group of ships first and then position them on the screen second and get the two groups of code away from each other.
So I'm basicly stuck atm on trying to code both of those things. If anyone could help that would be apprisheated.
Thanks Goply.