Blank Screen

Understanding the language, error messages, etc.

Blank Screen

Postby aderp1 » Fri Mar 27, 2015 10:34 pm

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);
      }
    }
  }
}
aderp1
 
Posts: 21
Joined: Sun Apr 27, 2014 7:24 pm

Re: Blank Screen

Postby Myndale » Sat Mar 28, 2015 3:14 am

I think you're going to have to create a full, working example, there are too many things there that could be going wrong.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am


Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 67 guests

cron