Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Maze movement
- MrEsch
- Scratcher
13 posts
Maze movement
Hello
I am looking for someone who can make a solution for my maze game. There doesn't seem to be much out there about this topic. I want to create a pacman style game where by the ghosts can move randomly around the maze and have the intelligence to recognize where there is a turning.
So far, my game just turns in a random direction if it hits a wall! There must be a simple way! My students would be very grateful if anyone can come up with a solution!
http://scratch.mit.edu/projects/10181896/
I am looking for someone who can make a solution for my maze game. There doesn't seem to be much out there about this topic. I want to create a pacman style game where by the ghosts can move randomly around the maze and have the intelligence to recognize where there is a turning.
So far, my game just turns in a random direction if it hits a wall! There must be a simple way! My students would be very grateful if anyone can come up with a solution!
http://scratch.mit.edu/projects/10181896/
- scratchkid45555
- Scratcher
100+ posts
Maze movement
You could do
glide (1) secs to x: (x position of Player) y: (y position of Player)But if you mean with turns, I'm not too sure.
(the
([y(x) position v] of [Player v])
Last edited by scratchkid45555 (Feb. 22, 2019 20:43:17)
when green flag clicked
forever
if <key [do something cool v] pressed?> then
scroll DOWN my friend :: motion
end
end
- Dragonlord767
- Scratcher
1000+ posts
Maze movement
define turn checkWith wall check being run with screen refresh.
repeat (4)
turn cw (90) degrees
move (...) steps
if <touching [wall v] ?> then
move (-...) steps
end
no signature plz
- Flipped_
- Scratcher
500+ posts
Maze movement
I have had a similar problem before, it doesn't seem to be possible since the ghost will have a bias that makes it turn the opposite way at certain turns. deck26 was the one to help me with that, so here's his project with turn detection: https://scratch.mit.edu/projects/274811178/ Maybe you could build from there.
☄️ Hey! I'm Flipped_. ☄️
Here, you can sit down in that chair over there. No no, that one. The other
one is reserved for my pet coelacanth.
I guess we wait now. Feel free to drink some orange juice
in the meantime.
———————————————
Here, you can sit down in that chair over there. No no, that one. The other
one is reserved for my pet coelacanth.
I guess we wait now. Feel free to drink some orange juice
in the meantime.
———————————————
- deck26
- Scratcher
1000+ posts
Maze movement
I've just added a sprite to that project that does a bit more but if you want progress in one direction it needs something else.
- Discussion Forums
- » Help with Scripts
- » Maze movement