Web
Analytics
Log In  

0

Cart [#57362#] | Copy | Code | 2018-10-01 | Link
0

While I don't have any immediate plans for a mapper myself, a great many of you out there do. And that's construction work that could be made easier with this cart.

For this is not only a mapper creator and editor, it also has an in-board function quite similar to the MAP() routine - with the unique exception instead of reading the mapper memory, it reads a single string which contains the size of the map its edges, bits of other data, and the actual mapper data itself.

use import {image}.png to import your own 256-character tile/sprite set to use in the mapper.

Commands follow:

Hold (Z) key to bypass logo.

If you are creating a new map, you will have a very small input routine active.

Use the LEFT and RIGHT arrow keys to navigate by 1-character.
Use the UP and DOWN arrow keys to navigate by 3-characters.
Press (O) to type that character.
Press (X) or have the key select on "<" to erase the last typed character.
Have the key select on ">" to accept that input.

At this time NAME OF MAP is not being used or even recorded. I just put it there to test the input routine, you can skip it by selecting the ">" key.

In editor, tap (X) to do three things. One, change keyboard mode to four. Nice delays and speed, no increase with repeat. Two is select the tile beneath the cursor. Three is you will have an option of selecting any of the 256-sprites to draw on the map, but the cursor initially starts on the last tile you had highlighted back in the editor.

Press (O) to select that sprite/tile. (X) to cancel.

In editor, tap (O) to plot that tile/sprite.

Use arrow keys to scroll. If you choose an area that is bigger than the screen, it will scroll to reveal it.

Press both LEFT and RIGHT to see a demo of the Map-player. Use arrow keys to navigate. Use this function, DRAWMAP() in your code.

The function DRAWMAP() can be used directly in your own code. These are the arguments for it.

DRAWMAP (T,H,V,X,Y,DX,DY)
  T ... ( Map itself, a text string created from this program ,
  H ... the horizontal position to plot on the screen ,
  V ... the vertical position to plot on the screen ,
  X ... the size across to plot the map on the screen ,
  Y ... the size down to plot the map on the screen ,
 DX ... the starting position (top-left LEFT corner) of the map contents to draw ,
 DY ... the starting position (top-left TOP corner) of the map contents to draw )

As the actual code does not draw the entire cropped map, only the visible part, it should be plenty fast for you.

Back to the editor, press both (O) and (X) to save your map as a string to the clipboard.
Replace with the MAPP line near the top of the code to both save and continue working on your code.

Feel free to make changes or updates, especially optimizing code, these are always welcome !

If you have any questions or suggestions for improving the code, please let me know !

P#57363 2018-10-01 18:24 ( Edited 2018-10-01 18:31)

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-10-16 02:09 | 0.234s | 1835k | Q:17