Discuss Scratch

solo_2002
New Scratcher
3 posts

help with a maze

how can i get my sprite to complete a maze on its own using broadcast masages
ErnieParke
Scratcher
1000+ posts

help with a maze

Getting the sprite to complete your maze can be tricky, depending on what you do. You can either have your sprite continue turning left whenever needed or possible, or you could use a pathfinding AI, which is complicated. From those to options, I'd recommend having the sprite turn left whenever it can move left, or whenever it can't move forwards, since it's much simpler then the other method.

Once you get the code for that, you should be good. ;)

By the way, you'll probably need a turn left and a move forwards broadcast for this.

With regards,

ErnieParke

turkey3
Scratcher
1000+ posts

help with a maze

Using broadcasts might be tough, but here's another way, say the sprite comes to an intersection, and the maze is black. You can have it wait until it touches black, and then point either left, right, up, or down, and move from there.

solo_2002
New Scratcher
3 posts

help with a maze

i was trying to get it to broadcast but it seem to get so far and go all mad and go round and round
ErnieParke
Scratcher
1000+ posts

help with a maze

solo_2002 wrote:

i was trying to get it to broadcast but it seem to get so far and go all mad and go round and round
Could I maybe see your scripts? I might be able to fix things from there.

With regards,

ErnieParke

solo_2002
New Scratcher
3 posts

help with a maze

how do i do that
ErnieParke
Scratcher
1000+ posts

help with a maze

solo_2002 wrote:

how do i do that
You could type it, like this:

when gf clicked
forever
say for (2) secs

That, or you could share your project, or you could take a lot of pictures.

With regards,

ErnieParke

dawid123791
New Scratcher
1 post

help with a maze

New game coming out soon: looking for food. Great game, great fun. Look out for it

Powered by DjangoBB