Integer value I think you mean.Karai17 wrote:You need to use math.floor to make sure you are translating and drawing to an internet value.
Simple Tiled Implementation - STI v1.2.3.0
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Simple Tiled Implementation - STI v0.14.1.13
Re: Simple Tiled Implementation - STI v0.14.1.13
Mobile phones tho
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.14.1.13
quick question, how can i, for example, make a door, or other interactive object on the map? Or how can i change the tile image for a tile that was inserted on an object layer? ty
edit: actually is there any way i can even update the proprieties of the layer/object layer?
edit: actually is there any way i can even update the proprieties of the layer/object layer?
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien
-Thorin Oakenshield, J.R.R. Tolkien
Re: Simple Tiled Implementation - STI v0.14.1.13
If you use the Box2D plugin, you can create a sensor object that performs some action when you collide with it. Set the properties collidable = true and sensor = true. If you use a different plugin, or your own collision code, you can code that in manually.
You can swap out a tile using Map:swapTile(current_tile_instance, new_tile_object)
You can swap out a tile using Map:swapTile(current_tile_instance, new_tile_object)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.14.1.13
ok thanks. So i cant change a propriety of a tile while running the program?
Edit: this is because i tried to change it while running, and it wont update... I added the map:update(), so idk why it wont change.
Edit: this is because i tried to change it while running, and it wont update... I added the map:update(), so idk why it wont change.
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien
-Thorin Oakenshield, J.R.R. Tolkien
Re: Simple Tiled Implementation - STI v0.14.1.13
Yes and no. You can't change the properties of an individual instance of a tile, but you can change the properties of a tile, and all of its instances. Map.tiles[gid].properties is what you're after.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.14.1.13
but if i have multiple doors, and i only want one to open, i cant use the way you told me now, it would change the properties of all the doors using that tile, no?
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien
-Thorin Oakenshield, J.R.R. Tolkien
Re: Simple Tiled Implementation - STI v0.14.1.13
You don't want to use tiles for such things. Use tile objects in Tiled to place individual door objects, and then update them individually in love.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.14.1.13
update them with Map.tiles[gid].properties?
or with swap? im so confused ;-;
or with swap? im so confused ;-;
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien
-Thorin Oakenshield, J.R.R. Tolkien
Re: Simple Tiled Implementation - STI v0.14.1.13
Map:swapTile is used to replace a tile in a layer with a different one. Map.tiles[gid] is a tile object that you can modify so that all tile instances will be updated (exept for the graphic, you need to use swapTile for that since sprite batching acts like a cache).
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Who is online
Users browsing this forum: No registered users and 1 guest