How to make Mouse Erase Tile from a Tilemap in Game.

1
  • 5 favourites

Stats

2,010 visits, 3,022 views

Translations

This tutorial hasn't been translated.

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Alright so you want to have the player remove a tile or change a tile to another one.

To Remove Tiles

On LMB Clicked >> Tilemap >> Erase Tile >>

X | Tilemap.PositionToTileX(Mouse.X)

Y | Tilemap.PositionToTileY(Mouse.Y)

To Change Tiles

On LMB Clicked >> Tilemap >> set tile >>

X | Tilemap.PositionToTileX(Mouse.X)

Y | Tilemap.PositionToTileY(Mouse.Y)

Value |3

Tilemap. <- Is the name of the tilemap

.PositionToTileY(Mouse.Y) <- is the command part of the code.

NOTE: Inventoryitems in the picture is what I renamed the tilemap to, for you it should be tilemap. Sorry for the confusion.

Experiment with this till it works how you would like. I wish you the best of luck in creating your game. There was no other place I could find this information so your welcome LOL

Now go create good games.

Tips: paypal: cybercode88sww@gmail.com Thank you!

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!