Have you ever made a game where a map needs to be scrolled, but when you're playing, your AI players have scrolled off to another part of the map without you? Well, that will be a piece of cake to be coded in Scratch, but what if you have not realised what happens if the AI player collides with a wall and you have never noticed because that player was not in your sight? That is surely a problem to code in Scratch. However, have no fear as I have finally devised an idea to solve the problem! The reason why this is a problem is because the wall where an AI player collides is not in your sights, and it is hard to even determine where the AI player is, and which wall it has collided with. Scanning a whole map and tracking the AI player's position is a good idea, but it takes far too much mental power to code it up (unless you are @griffpatch). Hence, I came up with another idea. Note that it is not too easy to understand this, but I hope you will after my explanation. =) The pure idea is that other than the original AI players and the map, I have duplicated an identical set of AI players and the map. This time, the duplicated set is not supposed to be scrolled, just like a mini-map in your game. We would just enter the AI player's scrolling x and y coordinates into a list. We would also enter its velocity (speed). Meanwhile, once the non-scrolling AI player has gathered all the data, it gets into its position on the non-scrolling map and moves at the velocity given. If it collides with the non-scrolling map, it means that the AI player (scrolling) has collided with the map, and we have to stop it from advancing. Otherwise, it has not collided and it can proceed. The non-scrolling AI player would then send the new x and y coordinates the scrolling AI player has to be positioned in. This process, then, of course, repeats. =)
Unfortunately, I can't find where I got the Among Us Walking GIF because I got it a LONG time ago :(