Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Beginner] 2d Tile Map Editor + source  (Read 6890 times)

0 Members and 1 Guest are viewing this topic.

OutlawLee

  • Jr. Member
  • **
  • Posts: 50
  • This is my personal text. Dont read it.
    • View Profile
    • Email
[Beginner] 2d Tile Map Editor + source
« 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

--------------- 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
« Last Edit: December 30, 2013, 03:43:04 pm by OutlawLee »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: [Beginner] Map Editor
« Reply #1 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!
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

OutlawLee

  • Jr. Member
  • **
  • Posts: 50
  • This is my personal text. Dont read it.
    • View Profile
    • Email
Re: [Beginner] 2d Tile Map Editor + source
« Reply #2 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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: [Beginner] 2d Tile Map Editor + source
« Reply #3 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).  ;)
« Last Edit: December 30, 2013, 07:53:22 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor