Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Works-In-Progress (http://www.alice.org/community/forumdisplay.php?f=14)
-   -   Game problem (http://www.alice.org/community/showthread.php?t=6797)

Silent Adonis 06-20-2011 02:31 AM

Game problem
 
Hey There
I have a game that Im doing about a wolf and a bunny. Its very short and simple but there is one part that Im struggling with and have not been able to do. The bunny is always in his hole and when the world starts he moves down the hole automatically .35 of a meter. the wolf then moves using the arrows as events and when he gets 4 meters directly in front of the bunny, the bunny should move down .5 of a meter. then when the wolf is at a safe distance the bunny should move back up to .35 when the wolf is 4 meters away from him. The wolf sneaks behind the bunny and eats him which I have done but I cant get the move down and move up part to work. the bunny just keeps going down and down and down when I press the up arrow to move forward. I hope it makes sense.

any help would be awesome thanks

room14 06-20-2011 02:33 AM

post the world. that will help.

Silent Adonis 06-20-2011 02:35 AM

World
 
1 Attachment(s)
[attach]5049[/attach]

Silent Adonis 06-20-2011 02:39 AM

I cant use variables, loops, user written functions or method parameters. I can only use ‘when the world starts’ and ‘when a key is pressed/typed.

room14 06-20-2011 02:41 AM

umm.. you have not connected the bunny's method to the events section

Silent Adonis 06-20-2011 02:46 AM

Yeah I took it out.

It looked like this though.

Method Bunny Down.

If both (wolfs foot) distance to (bunny's whiskers) < 4 and (Wolfs foot) is in front of (bunnys Whiskers)

Then, Bunny Move down .5

else
do nothing.

The bunny Up was similiar of course.

Cheers

room14 06-20-2011 02:47 AM

that means that the world does not play the method.

room14 06-20-2011 02:49 AM

okay so you are not allowed to use loop? but are you allowed to use the while world is running?

Silent Adonis 06-20-2011 02:51 AM

Yeah I took it out on purpose haha sorry I should of kept there.

The world first can be used but not loops.

Silent Adonis 06-20-2011 05:46 AM

I have tried everything I was told, its so frustrating! thanks heaps for your help. Let me know if you have any ideas.


Thanks


All times are GMT -5. The time now is 07:47 PM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.