Quantcast
Channel: Cemetech
Viewing all articles
Browse latest Browse all 75345

Contests :: RE: [Contest #9] [Prizm] Zombie Gun

$
0
0
Author: Spenceboy98
Posted: 03 Jan 2013 10:12:37 pm (GMT -5)

I'm not going to be able to enter the contest with this. Sad I'm still going to finish it eventually though, so don't be too sad. I'm going to come right out and ask for code help. Razz This is my code for spawning zombies:

Code:
      for(int h = 0; h < 20; h++){
         zombiespawn++;
         speedlimit++;
         if (speedlimit>=3 && zombie[h][1]==153){
            zombie[h][0] = zombie[h][0] + zombie[h][3];
            speedlimit = 0;
         }
         if ((zombie[h][0]+terrainx)==playerx){
            zombie[h][4] = 0;
            health-=2;
         }
         if(zombie[h][4] == 0){
            CopySpriteMasked(ZombieRight, zombie[h][0]+terrainx, zombie[h][1], 18, 39, 0xf000);
         }
         if(zombie[h][4] == 1){
            CopySpriteMasked(ZombieLeft, zombie[h][0]+terrainx, zombie[h][1], 18, 39, 0xf000);
         }
         if (playerx - (zombie[h][0]+terrainx) > 0){
            zombie[h][3] = 1;
            zombie[h][4] = 1;
         }
         if (playerx - (zombie[h][0]+terrainx) < 0){
            zombie[h][3] = -1;
            zombie[h][4] = 0;
         }
         if(zombiespawn == 5){
            if (zombie[h][1] > 153){
               for(int yminus = 0; yminus < 39; yminus++){
                  zombie[h][1]--;
               }
            }
            zombiespawn = 0;
         }
      }


I don't understand why it isn't spawning one at a time. Can anyone help?


Viewing all articles
Browse latest Browse all 75345

Trending Articles