Loco's tile-based 04.04

See inside

2014 Update: This is an old project. I am making a completely re-written, much improved version.

Notes and Credits

Use Turbo

(you may wanna copy this note to a text file and print it out)

EXPLORE MODE: Move around the game world using the arrow keys.
"w" lets you warp to maps (note: there are currently 50 maps and most are blank. You cannot walk off a blank map. The player starts on map 1) (note: this will put you on a random but unblocked tile. For this reason, when mapping, be sure to block ALL tiles where players cannot go)
"q" exits Play mode to the main menu
"e" switches to map editing mode
"c" displays the current map#

MAP EDITING MODE: Use the mouse to draw on the map using the tiles to the right (click on a tile to switch to it.)
Up/Down Arrow Keys/Mouse Wheel change selectable tiles window
Click and drag to place multiple tiles.
To place a single tile, click once, move your mouse away (if you want to rotate the tile), then click again to place it on the map.
"spacebar" copies the tile beneath the cursor
"q" switches to Play mode
"c" lets you change maps (while drawing maps, I usually switch to Play mode and walk between maps to make sure that walls, creeks, etc are lining up propery)
"p" opens the map properties editing. Each map has these, you use them to set where you go when you walk off the side of a map. This links all your maps together into the game world.
"b" switches to edit Blocking mode. This lets you decide where players can and cannot walk. (note: changing a blocked tile to unblocked is currently kinda slow, sorry!) Press "q" to go back to normal editing mode.

NOTE: unless you change any scripting, it is NOT necessary to save this project after editing maps. Map data is stored in lists which are auto-saved by Scratch. But if you do re-save this project, be prepared to wait as it takes my pc a full 2 minutes just to finish saving the project! (because of huge lists)

"What the heck is this thing?!?"
This is a tile-based RPG world editor. It has 2 modes, map editing and explore mode. You can easily switch back and forth between the modes to try out maps as a player would while you draw them.

As for "tile-based", a tile is a small image such as grass, water, dirt, trees, rocks, or whatever! Each game map is stored as a data list of how all the tiles are arranged. When a map loads, it is drawn according to that data.

The tile-based system is great for Scratch because you can make games with a ton of maps! This version comes with 50 maps yet the actual project file is less than 1M!

"Where is the game?!?!" This is not the game player, this is the app to make the game world with. Your world's map data is stored in big lists. I have not coded the game player yet but when finished, you will be able to simply create your map in this app, export the list data, import the data into the game player app, and then add all the details, quests, monsters, items, etc.

"So what do I do first?"
1) start it and enter Explore Mode, run around and explore the little world I made.
2) enter Map Edit mode
press "c" and change to map 50 (which is currently not being used
3) experiment with drawing by using the tiles on the right (see drawing nfo at top of project notes) Use arrow keys or mouse wheel to change selectable tiles display
4) in Map Edit mode, connect your map to a new one...
A) press "p" to edit the map properties
B) enter "r" at the 1st prompt and "51" at the 2nd (so that anyone walking right off the edge of the map will walk onto map 51)
C) press "c" to change to map 51 (or press "q" to quit Editing mode and enter Play mode, then walk off map 50 to the right)
D) Once on the blank map 51, repeat steps A and B except set it so you can walk left onto map 50
E) press "q" to switch to Play mode and walk back and forth between your two newly connected maps.
F) In Map Edit mode, add detail to your maps. Things to remember include making walls, water, etc continue from one map into the other. If a person can't walk off a side of a map, there should be a wall or some other visual indicator to a player why not. Remember to set your Blocking on each new map. Make sure that you can't walk onto any blocked tiles when walking across maps. For instance, if you make a wall with a doorway in it on one map, the other room must have a similar wall (or some kind of "thing in the way") and doorway.
G) Now, if you've made it this far, keep going! Make your own world. Feel free to overwrite my maps.
I'd erase them all by making a repeating script block that would set..
-Ground data to 1
-Ground Directions to 90
-Blocking to 2 ("1" means blocked and "2" means not blocked)
-Properties to 0, 0, 0, 0, unnamed, safe (although technically the properties Name and Status aren't currently being used)

Yeah, I know the graphics are pretty simple. Improve them! Make the player sprite animate. Replace my plain grass tile with a new one. The real pain of that is that to do so, you must replace the costume not ony in the edit Pen sprite but also for all 100 screen stamping sprites -BIGTIMEFUN-!!! Hey, I'll end up doing that multiple times when I write the full version. Hmmm... I'm thinking an AutoHotkey macro may be future ticket to that.
When I do a lot of work in Scratch, I start working on stuff in my sleep! It's weird?!? But I come up with new ideas and solutions to problems then then next day, I do em. Crazy! Anyway, last night it dawned on me that by using moving stamps, I could make the entire game scroll instead of jumping from map to map. Awesome! I don't know if Scratch can handle moving the 100+ sprites and stamping fast enough but for this type of game, it doesn't have to be invisibly fast. Hmmm, lol.

more nfo:
-tiles are sized 32x32 pixels
-the game map is 10 tiles wide x 10 tall
-the game map is drawn by stamping by 100 sprites, so each sprite has a copy of all the tiles (note: in Scratch, if multiple sprites use the same costume, there is still only one copy of the image in the project file - thanks for the tip Archmage!!)
-some of the current tiles (trees, sign, items, etc) show up on maps with a black background. That is because maps are currently drawn using only one layer with the player sprite moving on top of that. In a full version, depending on Scratch system limits, there would be multiple map layers stamped on top of each other... a Ground layer on bottom, followed by a few more layers. Layering layers lets you create maps with objects the player can walk behind (such as a big tree), and animations (such as running water).
-in Scratch, I'd use additional sprites as monsters, villagers, etc. Currently, the player is just a sprite running around on top of all the stamped tiles. Once a layering system is in place, the player and creature sprites would be used to stamp inbetween the Ground Layer and higher layers, allowing objects to appear to move behind objects on the screen.

The whole point of all the layering is to let you create maps that look and feel interesting. A brown rectangle CAN function as a bridge in your rpg but a nicely drawn stone bridge with railings the player can walk behind and a splashing stream underneath makes for a much better game.

If you can find an old version of PlayerWorlds (a complete, free, and working standalone system that I based this project on) such as verson 1.4.2 you can see what I am talking about. In fact, you can generate an entire distributable client/server game, if you can get a host for it :) (note: I am doubtful that PW still runs on Vista or Win7 but am not sure)

-all data is stored in a few BIG lists. At the top of the Stage scripts is a block to add a new blank map. It is set to repeat 0 times in case you accidently click it. To add new maps (and increase the list sizes) change the zero to however many new maps you want to add and click the script once. It may take a while but you'll know when it is done because as it runs, that script block will be outlined. When it finishes, the outline will go away. (change it back to zero after it finishes) IMPORTANT: lastly, change the Total Maps variable setting (near the top of the Stage scripts) to match how many maps there are now. If you are unsure, look at the Ground list and divide its size by 100.

all scripting by Locomule 2011
most images are old ripped snes/nes tiles

...dedicated to the memory of DragonSpires, Elancia, Delrith Online, and all the cool people I met... I was known as Pain btw...

-add "spin/no spin" toggle button for use during map editing"

current coding status..
top layer added
barely started signs in blockpen sprite
began adding tile rips

Shared: 28 Mar 2012 Modified: 27 Nov 2014
Favorite this project 9
Love this project 9
Total views 658
View the remix tree  2
More projects by Locomule