# Old processing zombie game by Kevan Davis. Can you help me get it working?

**URL:** <https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178>\
**Category:** Coding Questions\
**Created:** [January 4, 2019, 6:03pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178 "2019-01-04T18:03:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronszcz](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aaronszcz](https://discourse.processing.org/u/aaronszcz)\
**Post date:** [January 4, 2019, 6:03pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/1 "2019-01-04T18:03:27Z")

</div>

Hello Forum,  
One day I remembered an old zombie game I played I high school computer class. I found the source code for it. Turns out it was written for Processing 1.0.  
Ive coded with java and python before, but not in processing or for making video games.  
There is a function called look() that takes four arguments and that is not recognized. I think its all old Processing thing, but I cant find any information about it.

Can any of you help me?

here the script.

```auto

// Zombie Infection Simulation // Kevan Davis, 16/8/03 // Modified by John Gilbertson 25/09/03 // just making zombies more dangerous, edited level creation code, increased max zombies, made zombies less likely to group etc... 
int freeze;
int num=4000;
int speed=1;
int panic=5;
int human;
int panichuman;
int zombie;
int dead;
int wall;
int empty;
int clock=0;
int hit;
int ishuman=2;
int ispanichuman=4;
int iszombie=1;
int isdead=5;
Being[] beings;

void setup() {
  PFont f=loadFont("Impact-48.vlw");
  frameRate(45);
  textFont(f,19);
  int x,y;
  size(1200,800);
  human=color(200,0,200);
  panichuman=color(255,120,255);
  zombie=color(0,255,0);
  wall=color(50,50,60);
  empty=color(0,0,0);
  dead=color(128,30,30);
  hit=color(128,128,0);
  clock=0;
  // noBackground();
  fill(wall);
  rect(0,0,width,height);
  fill(wall);
  stroke(empty);
  for (int i=0; i<100; i++) {
    rect((int)random(width)-(width/8), (int)random(height)-(height/8),(int)random(width/4), (int)random(height/4));
  }
  fill(empty);
  stroke(empty);
  for (int i=0; i<45; i++) {
    rect((int)random(width-1)+1, (int)random(height-1)+1, (int)random(40)+10,(int)random(40)+10);
    x=(int)random(width-1)+1; y=(int)random(height-1)+1;
  }
  /* fill(wall); stroke(wall); rect(190,0,20,200); rect(0,90,400,20);*/ 
  fill(wall);
  noStroke();
  rect(0,height-30,width,height);
  fill(empty);
  stroke(wall);
  rect(0,height-30,width-2,height-2);
  beings = new Being[8000];
}

void keyPressed() {
  if(key == ' ') {
    key='z';
  } 
  if(key == '+' && num < 8000) {
    num += 100;
    key='z';
  } if(key == '-' && num > 4000) {
    num -= 100;
    key='z';
  }
  if(key == 'z' || key == 'Z') {
    freeze=1;
    setup();
  }
}

class Being {
  int xpos, ypos, dir;
  int type, active;
  int belief, maxBelief;
  int zombielife;
  int rest;
  
  Being() {
    dir = (int)random(4)+1;
    type = ishuman;
    active = 0;
    belief=500;
    maxBelief=500;
    zombielife=1300;
    rest=40;
  } 
  
  void die() {
    type=5;
  }
  
  void position() {
    for (int ok=0; ok<100; ok++) {
      xpos = (int)random(width-1)+1;
      ypos = (int)random(height-30)+1;
      if (get(xpos,ypos)==color(0,0,0)) {
        ok = 100;
      }
    }
  }
  
  void infect(int x, int y) {
    if (x==xpos && y==ypos) {
      type = 1;
    }
  }
  
  void infect() {
    type = 1;
    set(xpos, ypos, zombie);
  }
  
  void uninfect() {
    type = ishuman;
    active = 0;
    zombielife=1000;
    belief=500;
  }
  
  void move() {
    if(type==5){
      set(xpos,ypos,dead);
    } else {
      int r = (int)random(3);
      if ((type==ishuman && active>0) || r==1) {
        set(xpos, ypos, color(0,0,0));
        if(belief<=0) {
          active=0;
          maxBelief-=100;
          belief=0;
          rest=0;
        }
        if (look(xpos,ypos,dir,1)==0) { */LOOK DONT WORK*/
        if (dir==1) {
          ypos--;
        } else if (dir==2) {
          xpos++;
        } else if (dir==3) {
          ypos++;
        } else if (dir==4) {
          xpos--;
        }
      /* if(belief>0) { belief--; }*/
        } else {
        dir = (int)random(4)+1;
      } 
      if (type == 1) {
        set(xpos, ypos, zombie);
      } else if (active > 0) {
        set(xpos, ypos, panichuman);
      } else { 
        set(xpos, ypos, human);
      } if (active>0) {
        active--;
      }
    }
    int target = look(xpos,ypos,dir,10) /*LOOK DONT WORK*/
    if (type==1) {
      zombielife--;
      if (target==2 || target==4) {
        active = 10;
      } else if (target==3) {
        if((int)random(8)==1) {
          if (dir==1) {
            set(xpos,ypos-1,empty);
          } else if (dir==2) {
            set(xpos+1,ypos,empty);
          } else if (dir==3) {
            set(xpos,ypos+1,empty);
          } else if (dir==4) {
            set(xpos-1,ypos,empty);
          }
        }
        if(0==iszombie) {
          dir=dir+1;
          if(dir>4) dir=1;
          }
        } else if (active==0 && target!=1) {
          if((int)random(6)>4) {
            if((int)random(2)==0) dir = dir+1;
            else dir = dir-1;
            if(dir==5) dir=1;
            if(dir==0) dir=4;
          } else {
            dir=dir;
          }
        }
        int victim = 0;
        if (victim == 2 || victim==4) {
          int ix = xpos;
          int iy = ypos;
          if (dir==1) {
            iy--;
          }
          if (dir==2) {
            ix++;
          }
          if (dir==3){
            iy++;
          }
          if (dir==4) {
            ix--;
          }
         /* for(int i=0; i=0;i++) {
            belief--;
          }*/
          if(belief==0 && maxBelief!=0 && rest>=40) {
            belief=maxBelief;
            rest=0;
          }else if(belief==0 && rest<40) {
            rest++;
          }
        } else if(target!=1 && target!=4 && active==0) {
          rest++;
        } else if (target==1) {
          dir = dir + 2;
          if (dir>4) {
            dir = dir - 4;
          }
        }
        if ((int)random(2)==1) {
          dir = (int)random(4)+1;
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 4, 2019, 6:23pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/2 "2019-01-04T18:23:01Z")

</div>

Please, edit your comment, remove the code, copy the code from whereever you got it again, paste it again, select it and press the little button right above the comment text field that looks like \</\> to format it into code - as the forum makes things fancier by using characters that aren’t really compatible with code.

I’m having a hard time understanding what’s going on as by simply copying it off your comment causes it to think that there’s a `}` symbol missing! .\_.

---

<div class="post-metadata">

**Author:** ![aaronszcz](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aaronszcz](https://discourse.processing.org/u/aaronszcz)\
**Post date:** [January 4, 2019, 6:45pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/3 "2019-01-04T18:45:41Z")

</div>

nice! looks good now. thx

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 4, 2019, 7:07pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/4 "2019-01-04T19:07:42Z")

</div>

Well, it seems runnable now, but all I can get is a static barrage of gray and black rectangles that doesn’t change under any circumstances - not even key presses or anything.  
To get to that, I made a dummy function `int look(int a, int b,int c, int d){ return 0;}` that simply fixes the error doing nothing useful. Then there’s a missing `;` to put and a messy comment to remove to fix other 2 errors that don’t let it compile.

There is not even `draw()` in the code that you provided, leaving the code not being able to draw anything other on the screen. Putting `void draw(){}` to fix that gives just a tiny bit of progress, as z, spacebar and numpad + - keys now make the screen refresh with a new barrage of rectangles.

Considering the code was written in Processing 1.0, what about downloading Processing 1.0 and getting it to work there instead? It has to because it was made there, right?

I feel like you may not have all of the source code, hence the `look` and `draw` functions missing, hence the problems.

---

<div class="post-metadata">

**Author:** ![aaronszcz](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aaronszcz](https://discourse.processing.org/u/aaronszcz)\
**Post date:** [January 4, 2019, 7:13pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/5 "2019-01-04T19:13:45Z")

</div>

Thanks for taking a look!  
I think what i remember happening is there are green “human” dots wandering around the black parts and then a red “zombie” dots bumps the human and turns them into red zombie.

I think the person who made this made a future version with a player able to shoot the zombies.

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 4, 2019, 7:16pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/6 "2019-01-04T19:16:09Z")

</div>

Well, I suggest you to find it!  
As I can’t find any code responsible to render any `Being` or that references a green color in what you posted… It is most definitely incomplete!

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [January 24, 2019, 5:50pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/7 "2019-01-24T17:50:48Z")

</div>

@aaronszcz – were you ever able to find the rest of your code? It could be in multiple tabs in the PDE interface – or in multiple .pde or .java files in the original game folder.

---

<div class="post-metadata">

**Author:** ![aaronszcz](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aaronszcz](https://discourse.processing.org/u/aaronszcz)\
**Post date:** [January 24, 2019, 6:15pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/8 "2019-01-24T18:15:10Z")

</div>

The website is old, but it’s still up. My anti malware says the page is not secure…

–www.hardcorepawn.com/zombie3–

and the source code…

–www.hardcorepawn.com/zombie3/zombie5.pde–

I’m not sure how to see more in a pde, if there is more.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [January 24, 2019, 7:06pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/9 "2019-01-24T19:06:50Z")

</div>

I suppose you could try seeing if you could browse the contents of the  
–www.hardcorepawn.com/zombie3/-- folder to see if you can find any other files – however I honestly wouldn’t recommend downloading and running assets from a compromised folder unless you feel very confident about inspecting them. Perhaps contact the author instead?

---

<div class="post-metadata">

**Author:** ![DrPlamsa](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@DrPlamsa](https://discourse.processing.org/u/DrPlamsa)\
**Post date:** [January 19, 2020, 1:24am UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/10 "2020-01-19T01:24:04Z")

</div>

Hello! If you’re actually trying to _play_ the eventual Zombie 4 game, in which you’re a dot and humans are dots and zombies are dots and zombie dots turn human dots to zombie dots, then I may have some leads for you. I was just able to get it to work by:

1. Finding a website which still nominally hosts Zombie 4
2. Using examine source to find the URL to the Jar file
3. Downloading the Jar file
4. Extracting the main class file from the Jar file
5. Creating an HTML page which had an tag that pointed to the class and Jar file
6. using Java’s appletviewer to run that page.

And that actually worked! I’ll attach a screenshot

If you want the specific help with the source file that you found from 2003, I haven’t looked at that. But if all you want is to play the 2005 game, this procedure worked for me in 2020.

![zombie4gameplay](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/57c56e32d20cde87125ab0acf76773a376a582d8.jpeg)

---

<div class="post-metadata">

**Author:** ![DrPlamsa](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@DrPlamsa](https://discourse.processing.org/u/DrPlamsa)\
**Post date:** [January 19, 2020, 1:24am UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/11 "2020-01-19T01:24:35Z")

</div>

Here’s what the menu looks like

![zombie4menu](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/aaffd3ba46e6cf4fceb08c585f80c5dce8b4fea0.jpeg)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 19, 2020, 7:33pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/12 "2020-01-19T19:33:24Z")

</div>

Well done!!!

Please upload sources to github

I guess `look()` was in another file / tab. It could be the viewport in that where a virtual 2D camera looks on a map that’s bigger than the screen

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [January 22, 2020, 9:55pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/13 "2020-01-22T21:55:40Z")

</div>

It looks like there is an archived copy here:

[https://barguide.com/games/zombie4/](https://barguide.com/games/zombie4/)

---

<div class="post-metadata">

**Author:** ![AnotherCrazyCanadian](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@AnotherCrazyCanadian](https://discourse.processing.org/u/AnotherCrazyCanadian)\
**Post date:** [October 14, 2020, 5:31am UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/14 "2020-10-14T05:31:29Z")

</div>

Gentlemen, I had to sign up just to express my thanks for this. I had all but given hope on playing this for years and it’s only by finding this place have I got the chance at this. I’m currently getting Java installed, thanks so much again everyone!  
EDIT: No such luck. Would anyone mind pointing me in the direction of what exactly I need to play this? I’m afraid I don’t know anything about personal file hosting for personal use.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 15, 2020, 5:39pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/15 "2020-10-15T17:39:14Z")

</div>

@AnotherCrazyCanadian – unfortunately modern web browsers no longer support Java applets. That bit of text advice to “install Java” referred to a browser Java plugin – but I don’t _think_ that is an option anymore.

**Does anyone else on the forum** have a suggestion for how to run a Processing sketch that was exported as a web applet in 2006? Could the jar be imported into a contemporary Processing sketch and run locally through PDE, for example?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 15, 2020, 9:45pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/16 "2020-10-15T21:45:21Z")

</div>

Although my browser warned my (false alarm??) the pde is still there

```auto

// Zombie Infection Simulation
// Kevan Davis, 16/8/03
// Modified by John Gilbertson 25/09/03
// just making zombies more dangerous, edited level creation code, increased max zombies, made zombies less likely to group etc...

int freeze;
int num=4000;
int speed=1;
int panic=5;
int human;
int panichuman;
int zombie;
int dead;
int wall;
int empty;
int clock=0;
int hit;
int ishuman=2;
int ispanichuman=4;
int iszombie=1;
int isdead=5;

Being[] beings;

void setup() 
{ 
  BFont f=loadFont("Univers65.vlw.gz");
  framerate(45);
  textFont(f,19);
  
  int x,y; 
  size(400,200); 
  human=color(200,0,200);
  panichuman=color(255,120,255);
  zombie=color(0,255,0);
  wall=color(50,50,60);
  empty=color(0,0,0);
  dead=color(128,30,30);
  hit=color(128,128,0);
  clock=0;
// noBackground(); 

  fill(wall);
  rect(0,0,width,height); 
  fill(wall);
  stroke(empty);
  for (int i=0; i<100; i++)
  {
      rect((int)random(width)-(width/8), (int)random(height)-(height/8),(int)random(width/4), (int)random(height/4)); 
  }
 
  fill(empty);
  stroke(empty);
  for (int i=0; i<45; i++)
  {
    rect((int)random(width-1)+1, (int)random(height-1)+1, (int)random(40)+10,(int)random(40)+10); 

    x=(int)random(width-1)+1;
    y=(int)random(height-1)+1;
  }

/* fill(wall);
  stroke(wall);
  rect(190,0,20,200);
  rect(0,90,400,20);*/

  fill(wall);
  noStroke();
  rect(0,height-30,width,height);
  fill(empty);
  stroke(wall);
  rect(0,height-30,width-2,height-2);
  beings = new Being[8000];        
  for(int i=0; i<num; i++)
  { beings[i] = new Being(); beings[i].position(); }

  beings[0].infect();
  beings[1].infect();
  beings[2].infect();
  beings[3].infect();
  freeze=0;
} 
 

void loop() 
{ 
  if (freeze==0)
  {
// background(empty);
    fill(wall);
    noStroke();
    rect(0,height-30,width,height);
    fill(empty);
    stroke(wall);
    rect(0,height-30,width-2,height-2);  
    
    for(int i=0; i<num; i++) 
    { 
      beings[i].move(); 
    } 
/* if (speed==2) { delay(20); }
    else if (speed==3) { delay(50); }
    else if (speed==4) { delay(100); }*/
    clock++;
    int numZombies=0;
    int numDead=0;
        
    for(int j=0;j<num;j++)
    {
      if(beings[j].type==iszombie)
      {
        numZombies++;
      }
      if(beings[j].type==isdead)
      {
        numDead++;
      }
    }
    fill(human);
    noStroke();
    String s="Humans:" + (num-(numDead+numZombies));
    text(s,2,height-10);
    
    fill(zombie);
    String s2="Zombies: " + numZombies;
    text(s2,width-120,height-10);
    
    fill(dead);
    String s3="Dead: " + numDead;
    text(s3,120,height-10);
  }
}

void mousePressed()
{
  int mx=mouseX;
  int my=mouseY;
  int radius=(int)random(10)+6;
  fill(empty);
  stroke(hit);
  ellipse(mx-radius,my-radius,radius*2,radius*2);
  for(int i=0;i<num;i++)
  {
    int dx=beings[i].xpos-mx;
    int dy=beings[i].ypos-my;
    int diff=(dx*dx)+(dy*dy);
    if(diff<(radius*radius))
    {
      beings[i].die();
    }
  }
}

int look(int x, int y,int d,int dist)
{
  for(int i=0; i<dist; i++)
  {
    if (d==1) { y--; }
    if (d==2) { x++; }
    if (d==3) { y++; }
    if (d==4) { x--; }

    if (x>width-1 || x<1 || y>height-30 || y<1)
    { return 3; }
    else if (get(x,y) == wall)
    { return 3; }
    else if (get(x,y) == panichuman)
    { return 4; }
    else if (get(x,y) == human)
    { return 2; }
    else if (get(x,y) == zombie)
    { return 1; }
    else if (get(x,y) == dead)
    { return 0; }
  }
  return 0;
}

void keyPressed() 
{ 
  if(key == ' ')
  {
    key='z';
  } 
  if(key == '+' && num < 8000) { num += 100; key='z'; }
  if(key == '-' && num > 4000) { num -= 100; key='z'; }
  if(key == 'z' || key == 'Z')
  {
    freeze=1;
    setup(); 
  }
}

class Being
{ 
  int xpos, ypos, dir;
  int type, active;
  int belief, maxBelief;
  int zombielife;
  int rest;

  Being()
  {
    dir = (int)random(4)+1;
    type = ishuman;
    active = 0;
    belief=500;
    maxBelief=500;
    zombielife=1300;
    rest=40;
  }

  void die()
  {
    type=5;
  }

  void position()
  {
    for (int ok=0; ok<100; ok++)
    {
      xpos = (int)random(width-1)+1; 
      ypos = (int)random(height-30)+1;
      if (get(xpos,ypos)==color(0,0,0)) { ok = 100; }
    }
  }

  void infect(int x, int y)
  {
    if (x==xpos && y==ypos)
    { 
      type = 1; 
    }
  }

  void infect()
  { type = 1; set(xpos, ypos, zombie); }

  void uninfect()
  { 
    type = ishuman; 
    active = 0;    
    zombielife=1000;
    belief=500;
  }

  void move()
  {
    if(type==5)
    {
      set(xpos,ypos,dead);
    }
    else
    {
      int r = (int)random(3);
      if ((type==ishuman && active>0) || r==1)
      {
        set(xpos, ypos, color(0,0,0));
        
        if(belief<=0)
        {
          active=0;
          maxBelief-=100;
          belief=0;
          rest=0;
        }
            
        if (look(xpos,ypos,dir,1)==0)
        {
          if (dir==1) { ypos--; }
          else if (dir==2) { xpos++; }
          else if (dir==3) { ypos++; }
          else if (dir==4) { xpos--; }
/* if(belief>0)
          {
            belief--;
          }*/
        }
        else
        {
          dir = (int)random(4)+1; 
        }

        if (type == 1)
        { set(xpos, ypos, zombie); }
        else if (active > 0)
        { set(xpos, ypos, panichuman); }
        else
        { set(xpos, ypos, human); }
        if (active>0) {active--;}
      }

      int target = look(xpos,ypos,dir,10);

      if (type==1)
      {
        zombielife--;
        if (target==2 || target==4) { active = 10;}
        else if (target==3)
        {
          if((int)random(8)==1)
          {
            if (dir==1) { set(xpos,ypos-1,empty); }
            else if (dir==2) { set(xpos+1,ypos,empty); }
            else if (dir==3) { set(xpos,ypos+1,empty); }
            else if (dir==4) { set(xpos-1,ypos,empty); }

          }
          if(look(xpos,ypos,dir,2)==iszombie)
          {
            dir=dir+1;
            if(dir>4) dir=1;
          }
        
        }

        else if (active==0 && target!=1) 
        { 
          if((int)random(6)>4)
          {
            if((int)random(2)==0)
              dir = dir+1;
            else
              dir = dir-1;
            if(dir==5)
              dir=1;
            if(dir==0)
              dir=4;
          }
          else
          {
            dir=dir;
          }
       
        }
 
        int victim = look(xpos,ypos,dir,1);
        if (victim == 2 || victim==4)
        {
          int ix = xpos; int iy = ypos;
          if (dir==1) { iy--; }
          if (dir==2) { ix++; }
          if (dir==3) { iy++; }
          if (dir==4) { ix--; }
          for(int i=0; i<num; i++)
          { 
            beings[i].infect(ix,iy); 
          }
        }  
        if(zombielife<=0)
        {
          die();
        }
      }
      else if (type==2)
      {
        if (target==1)
        {
          maxBelief=500;
          belief=500;
          active=10;
          rest=0;
        }
        if(target==4)
        { 
          active=10;
          if(belief>0)
          {
            belief--;
          }
          else if(belief==0 && maxBelief!=0 && rest>=40)
          {
            belief=maxBelief;
            rest=0;
          }
          else if(belief==0 && rest<40)
          {
            rest++;
          }
        }
        else if(target!=1 && target!=4 && active==0)
        {
          rest++;
        }
        else if (target==1)
        {       
          dir = dir + 2; if (dir>4) { dir = dir - 4; } 
        }
        if ((int)random(2)==1) { dir = (int)random(4)+1; }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 15, 2020, 11:43pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/17 "2020-10-15T23:43:46Z")

</div>

> [@jeremydouglass](#):
>
> … how to run a Processing sketch that was exported as a web applet in 2006?

Got [https://barguide.com/games/zombie4/zombie4.html](https://barguide.com/games/zombie4/zombie4.html) working on Waterfox Classic browser on my 64-bit Win8.1 laptop:

> **[Download](https://www.waterfox.net/download/)**
>
> Free and open source

I had to install the latest Java 8 patch 261: “jdk-8u261-windows-x64”

> **[Java Development Kit (64-bit)](https://www.filehorse.com/download-java-development-kit-64/52937/)**
>
> Java Development Kit (JDK) is a powerful software package designed for Java developers. It provides a comprehensive set of tools, libraries, and documentation necessary for developing,...

But I believe more recent Java major versions should work too, as long as it’s the latest patch for it.

Once it’s installed properly, you’ll need to find Java on the “Windows Control Panel”.

Go to its “Security” tab and click at “Edit Site List…” like the screenshot from the link below:

- [Unable to play sketches on OpenProcessing. Java Error. - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussion/17549/unable-to-play-sketches-on-openprocessing-java-error#Item_1)

Whitelist the zombie game site by adding this domain: [https://barguide.com](https://barguide.com)

On Waterfox classic browser, go to “Add-ons Manager” and check if “Java Deployment Toolkit” is there.

Make sure “Ask to Activate” option is enabled and you’re ready to visit the zombie link and have its Java applet load the game after we authorize some extra security popups.

Another great site to whitelist for lotsa Java applets is: [https://www.greenfoot.org](https://www.greenfoot.org)

We can run even its super old demo games:  
[https://www.Greenfoot.org/scenarios?sort\_by=updated&page=2117](https://www.Greenfoot.org/scenarios?sort_by=updated&page=2117)

---

<div class="post-metadata">

**Author:** ![AnotherCrazyCanadian](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@AnotherCrazyCanadian](https://discourse.processing.org/u/AnotherCrazyCanadian)\
**Post date:** [November 17, 2020, 3:28am UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/18 "2020-11-17T03:28:50Z")

</div>

Holy smokes, thanks for being super in depth, I was able to get it to work!  
Seriously guys, thanks again, I’ve been waiting over a decade to play this again and I would not be able to without your guys help. If anyone comes across the Winter Zombies applet, please let me know!

---

<div class="post-metadata">

**Author:** ![ArkhamBishop](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ArkhamBishop](https://discourse.processing.org/u/ArkhamBishop)\
**Post date:** [December 7, 2021, 8:51pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/19 "2021-12-07T20:51:28Z")

</div>

What if the “Java Deployment Toolkit” isn’t there? That’s the only snag I’m finding.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 7, 2021, 10:31pm UTC](https://discourse.processing.org/t/old-processing-zombie-game-by-kevan-davis-can-you-help-me-get-it-working/7178/20 "2021-12-07T22:31:17Z")

</div>

You need Waterfox Classic now:  
[Classic.Waterfox.net](http://Classic.Waterfox.net)

And grab Java 8:

> **[Java Development Kit (64-bit)](https://www.filehorse.com/download-java-development-kit-64/63537/)**
>
> Java Development Kit 64-bit (also known as JDK) contains the software and tools that you need to compile, debug, and run applets and applications that you've written using the...

That’s not latest patch though!

But you should be asked to upgrade to patch 311 when 1st trying to run a Java applet anyways.
