SFML community forums

General => SFML projects => Topic started by: OutlawLee on December 30, 2013, 03:31:00 pm

Title: [Beginner] 2d Tile Map Editor + source
Post by: OutlawLee on December 30, 2013, 03:31:00 pm
Hello, i made a simple map editor that i wanted to share. Im a beginner in c++, and programming in general, so thats why i wanted a opinion on this code i wrote.

I attached a rar so u can download the program. And i attached another one with the code.

If you want to the code, you are free to use it as you wish.

I had to upload the rar with exe on other site since its too big for attachment.
http://speedy.sh/GkzyH/map-editor.rar (http://speedy.sh/GkzyH/map-editor.rar)

--------------- GENERAL: HOW TO USE ----------------------

FEATURES:

Keybinds:

R - Create Layer
T - Delete layer
Q - Previous Layer
E - Next Layer

C - Set Tile Collision
X - Hide Tile Collision Indicators

G - Hide Tile (Set visibility)
H - Hide Layer (Set layer visibility)

L - Save Map

W A S D - move through palette
UP DOWN LEFT RIGHT - navigate through map

Map Editor

Good practices, avoiding bugs or unexpected behavior:

- Map size (x and y) should be dividable with the tile size.
- Saving often is advisible, and it only takes a fraction of a second.
- Found a bug ? Write/Report it immediatly.


Notes:

- You can create unlimited number of tiles.
- All tiles in a newly created layer will be transparent but VISIBLE. (Transparent tile from tileset)
- You can only delete the last layer unlike creating, and the active layer has to be that one also.
- Hidden layer, hidden transparent tile might at first look can seem like something is bugged, but likely is not.
- Its save to close anyway once you save the map.


Known bugs:
- None found.


To-Do (top->down priority):

- Fix new bugs if found.
- Make it more exepction-safe. (e.g. typing the map name with space inbetween will not crash the editor
- New brushes for faster editing. (Rectangle 2x2 and bigger sizes)
 

Pls try to explain the mistakes i made, tell me if i made some grave mistakes that i should fix.

im also having trouble finding the right coding style (cant decide if i should put an underscore in parameters and similar)

code can crash if u do something you re not supposed, or type random stuff in console when asked something else.

THX
Title: Re: [Beginner] Map Editor
Post by: Nexus on December 30, 2013, 04:36:11 pm
I don't like downloading whole archives just to look at the code, but in the past I've made several suggestions, a lot of which address typical C++ mistakes and bad code style. You could have a look at some of them, it's likely that you encounter suggestions that apply to your project as well ;)
I've also stated my opinion regarding various C++- and design-related topics. If you want to know more about a specific topic, the following list can be useful, too:
I should have made that list already long ago :)

Sometimes there is a whole discussion, it can be interesting to read also other people's opinion to get a better overview. Furthermore, don't hesitate to search the forum, there are many users that gave helpful advice. And ask questions if you encounter specific problems!
Title: Re: [Beginner] 2d Tile Map Editor + source
Post by: OutlawLee on December 30, 2013, 07:19:29 pm
Hi, thanks for the feedback, i will check those links now :)

What could i use instead of those .rar archives ?

Thanks.
Title: Re: [Beginner] 2d Tile Map Editor + source
Post by: zsbzsb on December 30, 2013, 07:50:13 pm
What could i use instead of those .rar archives ?

Source control, preferably git + a hosing site (BitBucket or Github).  ;)