|
Post by johnno56 on Jan 17, 2024 14:39:50 GMT -6
Many moons ago (pre-rcbasic) I made a simple 3-level platform game but it took a lot of time to actually place the right tiles in the right place... probably why there were on 3 levels... lol
Long story short... I have drawn inspiration (stop chuckling...) from a Pygame platform game editor and threw together a prototype to create a level "map" editor.
It is VERY rough; Fixed tileset (32x32 pixels); Fixed background; No scrolling(yet); No layers (but will handle multiple levels of 20x15 tiles - 640x480)
Mouse is used to select from a limited number of tiles; Draw (LMB) and remove (RMB) tiles from the "Grid"; Operate buttons.
The program will produce simple ASCII "map(s)" - mainly because 'json' files, for me anyway, are too 'complicated' to look at... lol
ps: This is a work-in-progress. At the moment, this program, can create, load and save level maps. It has not been tested in my game as yet... However, I remain cautiously optimistic... lol If anyone is interested, and not afraid of "visual eyesore" coding, then let me know and I will post a... (what comes before and "alpha" release? ) copy of the program.
|
|
|
Post by n00b on Jan 17, 2024 15:44:04 GMT -6
I think this is awesome. Sometimes its good to keep things simple. Its also probably a good idea to stay away from json and just keep a simple ASCII format. I actually use a simple ASCII format for rcbasic studio's project files and it works pretty well.
|
|
|
Post by johnno56 on Jan 17, 2024 17:43:56 GMT -6
I prefer 'simple' as well... unfortunately, that concept, seems to go astray when I start coding... lol
|
|
|
Post by n00b on Jan 18, 2024 14:06:06 GMT -6
I prefer 'simple' as well... unfortunately, that concept, seems to go astray when I start coding... lol For me it usually helps to just use simple paper and pencil when outlining my program. I draw out the UI and write notes on what each feature I want is supposed to do. After that I just tackle each item one step at a time. A lot of people can probably just start out coding without giving anything much thought but I tend to get quickly overwhelmed.
|
|
|
Post by tbird on Jan 18, 2024 14:37:44 GMT -6
I prefer 'simple' as well... unfortunately, that concept, seems to go astray when I start coding... lol For me it usually helps to just use simple paper and pencil when outlining my program. I draw out the UI and write notes on what each feature I want is supposed to do. After that I just tackle each item one step at a time. A lot of people can probably just start out coding without giving anything much thought but I tend to get quickly overwhelmed. I just start coding and let the chips fall where they may, and get overwhelmed and all sorts of fun, planning is a great idea haha. johnno56, Great project!
|
|
|
Post by johnno56 on Jan 18, 2024 15:40:57 GMT -6
Ok. This is my first attempt... Of course, this program is totally useless, without a game to load the levels... lol
At the moment there are 3 levels included with the program.
Instructions:
Select a level number from 1 upwards using the up and down arrow keys.
Load: if the level file exists it will load. Save: Will create a file based on the level number (will overwrite existing file) New: Creates a blank canvas. Select a level number. Grid: Will switch on / off the canvas grid. BG: Will switch on / off the fixed background QUIT: Hmm... (also 'esc')
Create a level:
Select a sprite (LMB) from the right hand panel then place it on the canvas (LMB) Holding down the LMB will "paint" the selected sprite within each canvas "cell". Remove a sprite from the canvas using the RMB
When finished click SAVE and the program will create an ascii "map" of the level.
ps: This program is crude at best... It works but it is ugly and needs optimizing. As always I am open to any and all suggestions.
|
|
|
Post by n00b on Jan 19, 2024 12:19:45 GMT -6
I think the main thing you should probably work on is adding the ability to save levels to different files and load from different files. Other than that, I think this is a pretty solid editor.
|
|
|
Post by johnno56 on Jan 19, 2024 12:49:09 GMT -6
Hmm... I had given 'filenames' a thought but had not come up with a method of displaying already saved files... you know, like you would do with a GUI... File, Save as etc I have not experimented with 'system' commands yet. I had thought of a crazy idea of using the system command to list level files to a text file. Then parser the file and store the level file names into an array, display the filenames etc... In the meantime, I figured that, using the level number as a filename would be simpler... If I can figure this out I could apply the same method for selecting backgrounds and tilesets... Any advice would be appreciated. Thank you.
|
|
|
Post by johnno56 on Jan 19, 2024 13:10:42 GMT -6
Update: Managed to use the system command 'system("ls *.dat > files.txt") to create a file with the level filenames. It should not be too difficult to read and display the filenames... fingers crossed..
|
|
|
Post by n00b on Jan 19, 2024 16:40:42 GMT -6
RCBasic has a built-in way of getting files in a directory.
fileName$ = DirFirst$()
While fileName$ <> "" Print fileName$ fileName$ = DirNext$() wend
You can change the current directory with ChangeDir("/new/directory").
|
|
|
Post by johnno56 on Jan 19, 2024 20:08:06 GMT -6
Cool... I will also give that a try as well... Thank you.
|
|