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

2

Stats

2,885 visits, 4,315 views

Tools

Translations

This tutorial hasn't been translated.

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.

Published on 30 Aug, 2015. Last updated 19 Feb, 2019

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: cybercode88mya@gmail.com Thank you!

  • 0 Comments

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