No more crapping ants! New version includes:
guns!!
Zombies!
soundtrack!
BOOM! sounds!
awesomeness!
(yes, I helped make this game too!)
A new version of this scenario was uploaded on Sat Jul 02 22:01:25 UTC 2011
-Survival mode added
-all levels added
-more weapons added
-help in-game
-engine improvements
-added sound effects
-added menu
A new version of this scenario was uploaded on Sat Jul 02 22:12:05 UTC 2011
-Survival mode added
-all levels added
-more weapons added
-help in-game
-engine improvements
-added sound effects
-added menu
A new version of this scenario was uploaded on Sat Jul 02 22:35:50 UTC 2011
No more bugs in level 6
A new version of this scenario was uploaded on Mon Jul 04 00:00:42 UTC 2011
-Survival mode with more zombies
-Player and zombies now appear over the status bar
I like guns!! I like killing zombies!! Therefore I like this game!!
A new version of this scenario was uploaded on Tue Jul 05 17:21:28 UTC 2011
-Zombie Blood!!!
-Reload Sound taking the Bullets
-Gas Gallon image changed
A new version of this scenario was uploaded on Tue Jul 05 18:38:36 UTC 2011
-Mouse shooting solved
-Zombie Blood now appears under all objects
-Reload sound for the guns
A new version of this scenario was uploaded on Wed Jul 06 20:13:47 UTC 2011
-Air plane's bug solved
A new version of this scenario was uploaded on Fri Jul 08 21:11:06 UTC 2011
-Now you can pause the songs by pressing "p" key.
Wow, you are better than me!! hahahaha
I'm going to change the Zombie Rate in the survival, because its not so dynamic yet.
I'm glad you have liked it, thanks!! xD
A new version of this scenario was uploaded on Sat Jul 09 19:16:03 UTC 2011
Survival mode now has Health items and Zombie Rate updating. xD
A new version of this scenario was uploaded on Tue Jul 12 15:02:31 UTC 2011
-Level 6 changed (harder) !!
What code (If you're willing to share) did you use to make it so the zombies move towards you? I've tried a few ways to make them calculate the angle between you and them, but can't seem to get it right.
In this game:
-The zombie class has access to the position x and y of the player.
-So I did this in the act method of Zombie class:
if(manIsLive)
move();
In the move() method, we have:
deltaX=XPlayer-getX();
deltaY=YPlayer-getY();
if(deltaY<0)
moveY=-1;
else
moveY=1;
if(deltaX==0)
moveX=0;
else
{
beta = (int) (Math.toDegrees(Math.atan(deltaY/deltaX)));
if(deltaX<0)
{
moveX=-1;
setRotation(beta+180);
}
else
{
moveX=1;
setRotation(beta);
}
}
setLocation(getX()+moveX , getY()+moveY);
Enjoy and good luck, thanks for playing! xD
Actually I should write: beta = (int) (0.5 + (Math.toDegr.... )
Because it would decrease the chance of bad rounding.
But anyway, it's always good to know other ways of doing the same thing, thanks, @newacct !
@09blackn
from the top of my head im thinking the code would be somewhat like this:
[code]private boolean dead; // default is false
public void act()
{
checkDeath();
if(!dead) {
//other codes like movement and that.
}
}
private void checkDeath()
{
if(!dead)
{
if(getOneIntersectingObject(Bullet.class)) //returns true if the zombie is hit by a bullet.
{
dead=true;
Greenfoot.setImage("Blood.png");
}
}
}[/code]
the checkDeath() could also just be part of the act, not a seperate "void".
hey @gusbus123, thanks for your comments xD
For the blood, i created a class named "ZombieBlood" that just puts an image in the position that the zombie died. I create 150 objects of blood every level. When i don't have 150 bloods yet, i create; when i do have, i only call setPosition of the first ones. At the moment the bullet hits the zombie, both are removed.
When i made this game, i had a version before "Greenfoot 2.1.0 (8. June 2011)", so the turn methods in Actor weren't built yet. (http://www.greenfoot.org/version_history). That's why i didn't use the turnTowards().
This were a one month project of Computer Science 101. Also, i didn't know anything about programming before. Sorry if my English is not great, and I hope you understand I was "a pretty bad programmer", because I was just learning at that time :D
Thank you all for the feedback!
[]'s
@09blackn
What I did it's not the best thing, but it was:
I call the method setPosition of the Actors if: the booleans are like: trying to move up and wallTop == false, trying to move down and wallBottom == false, trying to move left and wallLeft == false, trying to move right and wallRight== false.
To set this booleans, i used the method getOneObjectAtOffset(actor.getX() + dx, actor.getY() + dy, Wall.class), where dx and dy depend on the position of the wall you want to compare.
That's the idea of how I did when I made this game! :)
2011/6/18
2011/6/18
2011/6/18
2011/6/18
2011/6/20
2011/6/21
2011/7/2
2011/7/4
2011/7/4
2011/7/4
2011/7/9
2011/7/9
2011/9/10
2011/9/10
2011/11/5
2011/11/5
2011/11/6
2011/12/4
2011/12/4
2012/1/2
2012/1/2
2012/3/28
2012/8/8
2012/8/8
2012/8/8
2012/8/8
2012/8/8
2012/8/9
2012/8/9
2012/8/15
2012/8/15
2012/8/15
2012/8/17