The triangulated rock now stays as one solid unit: one body with many pairs of shape & fixture.
Simple Tiled Implementation - STI v1.2.3.0
Re: Simple Tiled Implementation - STI v1.2.3.0
Are you tinkering with the box2d plugin or working on an hc plugin? it look slike the box2d plugin got borked at some point and i didn't notice. i haven't really looked at this code in quite a while and have been relying on pull requests for patches any time someone needs a new feature or found a bug.
either way, i'd ask that you update or add new test maps to the repo if/when you submit a pull request so that it can be shown that the plugin is functioning as expected.
either way, i'd ask that you update or add new test maps to the repo if/when you submit a pull request so that it can be shown that the plugin is functioning as expected.
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 v1.2.3.0
I have made substantial changes to the Box2D plugin init function: moved triangulation from one function to the other, changed the order of operations so a new body is available sooner, and changed the main loop to step through the instances table. Next steps: look at layers, find how offset is added twice, attach image to body.
Any hints about that last one are appreciated.
Any hints about that last one are appreciated.
Re: Simple Tiled Implementation - STI v1.2.3.0
Here is the game with the small test map.
- Attachments
-
- bulldozer-0.14.zip
- (2.68 MiB) Downloaded 1985 times
Re: Simple Tiled Implementation - STI v1.2.3.0
How are object positions updated in response to physics engine updates? I do not know how to establish that link.
Re: Simple Tiled Implementation - STI v1.2.3.0
You would need to pull the positional data from the physics object and apply it to the graphical 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 v1.2.3.0
There are two options.
1) Replace the position and orientation entries in the STI table with references to the LÖVE2D physics engine values. They idea being that they refer to the same location in memory; that way the physics engine updates the values and STI uses them to draw.
2) Create a map:box2d_update function which finds the dynamic objects in the object layer and updates the position and orientation values from the physics engine values. The map table would need references to the physics objects.
The first one requires no extra work a run time. I need to confirm that Lua tables support this sort of thing.
1) Replace the position and orientation entries in the STI table with references to the LÖVE2D physics engine values. They idea being that they refer to the same location in memory; that way the physics engine updates the values and STI uses them to draw.
2) Create a map:box2d_update function which finds the dynamic objects in the object layer and updates the position and orientation values from the physics engine values. The map table would need references to the physics objects.
The first one requires no extra work a run time. I need to confirm that Lua tables support this sort of thing.
Re: Simple Tiled Implementation - STI v1.2.3.0
Only tables and functions are stored as references. I think it would be better to have an update function, that way it can be overridden if needed.
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 v1.2.3.0
Agreed! I will create a new function.
Code: Select all
-- Update dynamic objects. It must be called after the physics
-- update has run and before calling the STI draw function.
--
box2d_update = function(map)
-- One way to do this:
-- - go through instances
-- - find those on the object layer
-- - find dynamic objects
-- - copy position and orientation from the body
-- to the object
-- Is there a more direct way to find all dynamic objects?
-- I could use the collision table.
-- A collision table entry contains { object, body, shape, fixture, }
-- - find dynamic objects
-- - copy position and orientation from the body
-- to the object
end
Re: Simple Tiled Implementation - STI v1.2.3.0
Hi,
I am a new user trying out Love, I have issues getting my tiled maps to show via sti (only get a black screen) so I tried the above example game (bulldozer-0.14). It hangs after pressing the space bar on my M1 Max MacBook Pro.
Extracting the tile maps to my project works (they are displayed), trying to find the differences to my tile maps.
I attached my world.map which only displays a black screen.
I am a new user trying out Love, I have issues getting my tiled maps to show via sti (only get a black screen) so I tried the above example game (bulldozer-0.14). It hangs after pressing the space bar on my M1 Max MacBook Pro.
Extracting the tile maps to my project works (they are displayed), trying to find the differences to my tile maps.
I attached my world.map which only displays a black screen.
- Attachments
-
- Archive.zip
- (2.32 MiB) Downloaded 1907 times
Who is online
Users browsing this forum: No registered users and 8 guests