I am working on a game where you are in a maze and there are evil baddies. Seems simple, but the problem is that I don't know how to make them wander around the maze trying to get you! I understand that you can use the 'set course' method, that is, the baddies repeat a set course. But they do not really move to get you, they just wander around in the same old way. Is there a way for getting the baddies to try and get you in the maze?
Last edited by Jonathanpb (2009-06-23 01:54:23)
Offline
Add this to the hero sprite
When flag clicked forever | if <<touching [badguy_1]> or <touching [badguy_2]>> | | broadcast [endgame] | | _ |_
Except that you have to add < < > or < > > block for every enemy you add... You can also use torchlight as a trigger - then use <touching colour [ ]> block. 
Offline
I made a game where the enemy chases you around, but it's not a maze. Look at the code for Cat Chase--it might give you some ideas.
http://scratch.mit.edu/projects/daydreamgirl/575932
Last edited by daydreamgirl (2009-06-19 16:36:49)
Offline
Try looking at this project
http://scratch.mit.edu/projects/bigB/15121
What you want to do is put sprites at every turn in the maze and when an enemy touches one of these sprites it determines where to move next.
There is no tutorial for this and scratch and the above advice doesn't seem like it will help much.
Offline
filo5 wrote:
Add this to the hero sprite
Code:
When flag clicked forever | if <<touching [badguy_1]> or <touching [badguy_2]>> | | broadcast [endgame] | | _ |_Except that you have to add < < > or < > > block for every enemy you add... You can also use torchlight as a trigger - then use <touching colour [ ]> block. http://planetsmilies.net/dwarf-smiley-5130.gif
I don't think you understand... the trouble is getting the baddies to move around the maze trying to get you. Not about them touching the good guy and ending the game.
__________________________________________
Even if the internet dies, Scratch shall not.
Last edited by Jonathanpb (2009-06-21 02:52:58)
Offline
archmage wrote:
Try looking at this project
http://scratch.mit.edu/projects/bigB/15121
What you want to do is put sprites at every turn in the maze and when an enemy touches one of these sprites it determines where to move next.
There is no tutorial for this and scratch and the above advice doesn't seem like it will help much.
I think that works! Why didn't I think of that?
So what I'll do is I'll have a sprite that covers all of the points in the maze where you turn, and then the baddies will decide which way to go to get the good guy. Thanks again Archmage!
__________________________________________
Even if the internet dies, Scratch shall not.
Offline