useflashpunk / FlashPunk

A free ActionScript 3 library designed for developing 2D Flash games. It provides you with a fast, clean framework to prototype and develop your games in. This means that most of the dirty work (timestep, animation, input, and collision to name a few) is already coded for you and ready to go, giving you more time and energy to concentrate on the design and testing of your game.
http://useflashpunk.net
MIT License
390 stars 134 forks source link

using 0 in Tilemap.createGrid() sets empty tiles as solid #136

Open jmickle66666666 opened 10 years ago

jmickle66666666 commented 10 years ago

NO COMMENT

zachwlewis commented 10 years ago

Since a Grid is a list of cells that are either solid or not solid, it expects a Boolean value. If there is no value, what should it set to?

On Mon, May 5, 2014 at 9:47 AM, jmickle1 notifications@github.com wrote:

NO COMMENT

Reply to this email directly or view it on GitHub: https://github.com/useflashpunk/FlashPunk/issues/136

jmickle66666666 commented 10 years ago

If the tile in the tilemap is empty, its more intuitive if the cell in the grid is set to false rather than true. On 5 May 2014 15:54, "Zachary Lewis" notifications@github.com wrote:

Since a Grid is a list of cells that are either solid or not solid, it expects a Boolean value. If there is no value, what should it set to?

On Mon, May 5, 2014 at 9:47 AM, jmickle1 notifications@github.com wrote:

NO COMMENT

Reply to this email directly or view it on GitHub: https://github.com/useflashpunk/FlashPunk/issues/136

— Reply to this email directly or view it on GitHubhttps://github.com/useflashpunk/FlashPunk/issues/136#issuecomment-42196134 .

zachwlewis commented 10 years ago

That's not always true. Consider the following two users.


Sarah is making a platformer. She creates a tilemap consisting of all the grass tiles for the player to run and jump on. She only wants the player to collide with the placed grass tiles.


Vince is making an RPG. He creates a tilemap of the rooms in a dungeon for the players to walk along. He only wants the player to be able to walk on the tiles he has placed.


Who is "more correct," Sarah or Vince? I'd argue that they are both correct and the functionality of the system should be looked at.

jmickle66666666 commented 10 years ago

OK that's fair, I agree that both situations are equal.

As regards the current functionality, if you supply 0 in the solidTiles array, all empty tiles are considered solid and if you don't supply 0, they are not solid. This inconsistency is the bug, and considering you are providing which tiles you DO want to be solid, the option of putting -1 into the array should probably have the effect of considering empty tiles as solid.

On 5 May 2014 17:17, Zachary Lewis notifications@github.com wrote:

That's not always true. Consider the following two users.

Sarah is making a platformer. She creates a tilemap consisting of all the grass tiles for the player to run and jump on. She only wants the player to collide with the placed grass tiles.


Vince is making an RPG. He creates a tilemap of the rooms in a dungeon for the players to walk along. He only wants the player to be able to walk on the tiles he has placed.


Who is "more correct," Sarah or Vince? I'd argue that they are both correct and the functionality of the system should be looked at.

— Reply to this email directly or view it on GitHubhttps://github.com/useflashpunk/FlashPunk/issues/136#issuecomment-42205729 .