This site requires JavaScript, please enable it in your browser!
Greenfoot back
Anne2403
Anne2403 wrote ...

2014/11/21

Please Help Me. I don't really know what to do. -_-

Anne2403 Anne2403

2014/11/21

#
Hello.! I'm new at this, I have to do a project but I don't know what to do to make my game. I tried all that I can. I want to make a game of,. a cat that is shooting other animals to save her Kittens and the cat is shooting a LIGHTNING and animals are shooting FIRE and there is a time limit. The cat only have 180 seconds to save the kittens if thecat didn't save the cat the game will be over. How can I do this?? I HOPE YOU CAN HELP ME.
danpost danpost

2014/11/21

#
So, what have you tried? What classes did you create? etc.
Erdrag1 Erdrag1

2014/11/22

#
Check the tutorials here on the site to learn some basics, they are good. or go on youtube and search on "Joy of code" from greenfoot. and if you follow those you will learn to code a little, and that might help
Anne2403 Anne2403

2014/11/22

#
@danpost here are those.. Shooting public class enemy extends Actor { /** * Act - do whatever the enemy wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act () { moveAround(); } public void moveAround () { move(4); if (Greenfoot.getRandomNumber(100) < 10) { turn(Greenfoot.getRandomNumber(90) - 45); } if (getX() <= 5 || getY() >= getWorld().getWidth() -5) { turn(180); } if (getY() <= 5 || getY() >= getWorld().getHeight() - 5) { turn(180); } } } player1: public class person extends Actor { /** * Act - do whatever the person wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(-4); if (Greenfoot.isKeyDown("left")) { turn(-3); } if (Greenfoot.isKeyDown("right")) { turn(3); } // Add your action code here. } } No_avatar WatchPatronus 2012/8/19 oops i forgot to include my code... enemy: public class enemy extends Actor { /** * Act - do whatever the enemy wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act () { moveAround(); } public void moveAround () { move(4); if (Greenfoot.getRandomNumber(100) < 10) { turn(Greenfoot.getRandomNumber(90) - 45); } if (getX() <= 5 || getY() >= getWorld().getWidth() -5) { turn(180); } if (getY() <= 5 || getY() >= getWorld().getHeight() - 5) { turn(180); } } } player1: public class person extends Actor { /** * Act - do whatever the person wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(-4); if (Greenfoot.isKeyDown("left")) { turn(-3); } if (Greenfoot.isKeyDown("right")) { turn(3); } // Add your action code here. } } up until now I am searching for the code can help to make my game but everytime I copy it, there is error or it wouldn't work. Actually, the code above, I got here. even now still searching for code/s that might work for my game. I am finding a code in every actors, etc. that will make my game possible. -_-
Anne2403 Anne2403

2014/11/22

#
@Erdrag1 Thanks for the suggestion. I will watch it but if u have some other possible codes or other tips that can help me, can u please say to me?? If u have other thing/s that will make my work go easier? If it's okay to you? Please let me know.. Thank you so much.
danpost danpost

2014/11/22

#
Ok. Well, I guess that 'person' is the cat that casts lightning and 'enemy' is the fire thrower. However, there is zero code in either of those classes that do anything as far as shooting. You should also have a Lightning and a Fire class and some condition is the above classes that determines when to create a shot object. I would assume that 'person' will have a keyboard key to trigger the shot and the enemy will be either shooting randomly or be on a cyclic timing system. Can you do anything with that?
Anne2403 Anne2403

2014/11/22

#
That is exactly I want to happen with my game. U asked me if I can do anything with that?? Well, yes and No is the answer.. Yes because Nothing's impossible but No because how am I going to do that? That's is my problem actually. -_- Do you have any code or any code that u know to do what you've already mention?? If you are not busy brother, Please help me. I badly need to do this game because if I will not do this, I am not going to pass our programming subjects.
davmac davmac

2014/11/22

#
The problem is that your question is way too broad. It seems essentially like you are asking for someone to write the whole program for you. That's not going to happen. Start by breaking your problem into small pieces and tackle them one at a time. For instance, you could start with having your cat that shoots lightning (no other animals or anything else at this stage). Have a go at creating this, and if you run into any specific problems, then ask about them here. Once you've got it working, you can add in the other animals, and later add the timer.
Anne2403 Anne2403

2014/11/23

#
@davmac hehe. I'm sorry about it. and thank you I will do what you said. I will take your advice. Sorry for the disturbance and also with @danpost aand @Erdrag1. Thank you and sorry again brothers.
You need to login to post a reply.