**map edits are only permanent if you remix/download this** M toggles between Edit and Play mode the player can walk around in Play mode while in Edit mode.. L toggles between editing either layer 1 the ground or 2 map objects Up/down arrows change current draw pen while editing layer 2 (map objects) hold D to delete them
Credit to @RealCB06 for inspiring this tutorial Still a lot of things to add but here are the basics of what is happening.. each tile is 30x30 pixels the entire map is 16 tiles wide by 12 tiles tall or 192 tiles each tile's costume is stored as a list entry our map has 2 layers so we use 2 lists to store their tiles To draw (stamp) the game map we start in the top left corner and stamp tile 1, move right 30 pixels and stamp tile 2, etc till we get to the right side of the screen. Then we reset the X position to the left side and move down 30 pixels. Scratch does this so fast the whole map seems to just appear. Again, since we have 2 layers, after a tile is stamped the engine checks to see if there is an object on top of the ground. If so, it stamps it next. If Play mode is active it also checks to see if the tile currently being stamped is the player's location and if so stamps it last so it ends up on top. Moving the player in Play mode.. Since all tiles are stored by their costume number we can use a list called Blockers and add to it anything the player shouldn't be able to walk through or onto. When the player tries to move the engine checks both layer lists to make sure nothing is stopping them. If not we just change the variable storing the player's position and restamp the map. We only need to restamp when something moves or changes on the map. Map Editing.. With each map tile stored as list data map editing is as simple as replacing list entries. Granted this map system is more simplistic than it will become as in the future it will scroll in all directions. We will need a little more math but the basic system of using lists will not change. My current goals for the Tutorial project include many RPG basics.. party of switchable characters / character stats / quest / puzzles / enemies / combat / items / inventory / cut scenes / multiple map zooms levels (world map, town maps, interior maps) / boss fight / NPCs / dialogue / and maybe fog of war I'll be building the most basic versions of all that stuff and I may end up leaving some out, we'll see. Anyway, this engine will change drastically so I wanted to throw up this uber simple version just to highlight how the map is stored, stamped, edited, and played on. How so smooth? The player currently has a half second delay while moving so it doesn't look that fast but with no delay it would fly off the screen when you tried to move. The secret is the broadcast timing system in the Stage script. Look at it, it is tiny, almost nonexistent. That is it, that is the gold at the end of the rainbow as far as Scratch is concerned, Griffpatch's not-so-secret secret recipe to making the most complicated projects run as fast as possible. Oh yeah, in the tutorial we will start out with super simple costumes like these then I'll demonstrate how to move out of the visual blockiness and build maps that look and play well. I think for this project I will draw all the images using Scratch.