I think you can drag the block that says the location col/row into the red location ellipse. Next, you can remove the if statement. I’m not sure, thins is just a guess.
You can use the location object from the function to check if it matches a tile using that collision block under scene. Feeling like there should be a tile at… block so that you can pull the coordinates from the location object.
Using the extension:
The moment I want to compare two locations, it doesn`t seem to work. I assume that it’s because it is missing the “tile at” when trying to pull from the tilemap.
I am not completely sure how Javacript compares objects, so I am assuming the comparison you are trying to make might point to the same tile in the game, but are two separate objects. Being two separates objects that may not be equal, even though conceptually they point to the same tile in the game.
This is going to be a better comparison, as it compares to numbers.
So explain my previous point (this is true with C#, so I’m assuming it’s the same in Javascript) two class instances are never equal, unless the class implements comparison methods (via interface or Equals methods, etc). So:
Tile a = new Tile(0,0)
Tile b = new Tile(0,0)
a != b (true)
a==b (false)
This is C# syntax, but I guess the same is true in Javascript.