Page 1 of 1

Blank Screen

PostPosted: Fri Mar 27, 2015 10:34 pm
by aderp1
Hello,
I am making a game in which I am implementing a particle system. I used a similar method as bullet creation to generate the particles, but when I try to add the functions to the game, the LCD just comes up blank. Here is the code:

Code: Select all
void initParticles(){
   if(crashed){
   for(byte thisParticle = 0; thisParticle < NUMPARTS; thisParticle++){
      int randX = random(-8,8);
      int randSelect = random(1,25);
      if(!particleActive[thisParticle]){
         if(randSelect == 2){
         particleActive[thisParticle] = true;
         particleLife[thisParticle] = random(10,40);
         particleX[thisParticle] = playerX+randX;
         particleY[thisParticle] = playerY;
         break;
         }
      }
   }
   }
}

void moveParticles(int dir, int sp){
   for(byte thisParticle = 0; thisParticle < NUMPARTS; thisParticle++){
      moveXYDS(particleX[thisParticle],particleY[thisParticle],dir,sp);
      if(particleLife[thisParticle] == 0){
         particleActive[thisParticle] = false;
      }
   }
}

void drawParticles(){
  for(byte thisParticle = 0; thisParticle < NUMPARTS; thisParticle++){
    if(particleActive[thisParticle]){
      int x, y;
      if(screenCoord(particleX[thisParticle], particleY[thisParticle], x, y)){
         gb.display.fillRect(x, y,2,2);
      }
    }
  }
}

Re: Blank Screen

PostPosted: Sat Mar 28, 2015 3:14 am
by Myndale
I think you're going to have to create a full, working example, there are too many things there that could be going wrong.