ScratchData LogoScratchData
Back to BenjaminWins11Alt's profile

Basic Pathfinding

BEBenjaminWins11Alt•Created September 7, 2021
Basic Pathfinding
27
24
703 views
View on Scratch

Instructions

Click the flag and then click anywhere on the grid. Then watch the little purple dude walk over there. This isn't a game, it's just kinda cool. You can edit the walls on the grid by editing the costumes. The wall costume is picked randomly between 3 costumes. Don't bother asking me to help you add this to your game, it's way too complex to explain in comments. I did manage to complete this in only 500 blocks though, and if I trying to, it could probably go down to 400 or 350. Clicking a wall just makes it scan the entire grid, then give up.

Description

Loosely based on other pathfinding algorithms. I just read the Wikipedia on Pathfinding, watched a guy explain how A* Pathfinding works and made this. Code by me obviously, fantastic art by me too: @BenjaminWins11 Update: I've already made a far faster version of this, with more features, so this is already outdated after like 2 weeks. The new version I made is made in a way that it would be possible to have multiple things pathfinding at once. There's also an Accuracy slider, where lower levels make it reach the goal faster, but may not use the fastest route and make other mistakes, would be helpful for low-end devices though. Not much point talking about it here since you can't see it, but, just know that this Basic Pathfinding really is just 'Basic'. You can change the PathFinding Speed variable to change how many grid boxes are scanned each frame. 1 looks cool, and 999 is instant. This obviously isn't the best way to do pathfinding, but I only decided I wanted to learn how it works yesterday so what do you expect? This new-found knowledge may be used in future games, but don't count on it.

Project Details

Project ID567680559
CreatedSeptember 7, 2021
Last ModifiedFebruary 24, 2023
SharedSeptember 7, 2021
Visibilityvisible
CommentsAllowed