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

  • 5 favourites

Stats

1,231 visits, 1,869 views

Translations

This tutorial hasn't been translated.

Tools

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

  • 0 Comments

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