Tilengine - The 2D retro graphics engine forum
Collision with tiles position and sprite not aligning correctly - Printable Version

+- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum)
+-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7)
+--- Thread: Collision with tiles position and sprite not aligning correctly (/showthread.php?tid=2300)



Collision with tiles position and sprite not aligning correctly - RootBeerKing - 09-03-2023

Hello again, I've been struggling with getting collision detection to work correctly. I'm *almost* certain I got the math/code right, however it seems there is an issue with the offset of the map and tiles not being rendered where they should be? I've linked the project, if you could check it out and see what I'm doing wrong here it would be a great help as I've been stuck on this problem for days now and I just don't know what I'm doing wrong here:

*removed link*

Thank you very much.


RE: Collision with tiles position and sprite not aligning correctly - megamarc - 09-04-2023

Hi,

I've tried to build the project to see how it runs, but I think mi install of mingw32 is quite old as it isn't compatible with the supplied dlls. I'll try to update it and chek it. I'm not familiar with the flecs library so it may take a while


RE: Collision with tiles position and sprite not aligning correctly - RootBeerKing - 09-04-2023

Oh yeah, you'll need a newer mingw, I believe I'm using msys64. flecs is an ECS library, it's pretty straight forward if you're at all familiar with ECS. Thanks for checking it out for me. I'm so confused as to what I could be doing wrong. Hopefully you can see something I'm missing.


RE: Collision with tiles position and sprite not aligning correctly - megamarc - 09-04-2023

Hi,

I've updated my install of mingw to mingw64 to last one available (13.2.0) but I when building I get many instances of this error:

Code:
src/Include/tweeny.h: In member function 'tweeny::tween<T>& tweeny::tween<T>::via(const int&, Fs ...)':
src/Include/tweeny.h:2315:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
2315 |        if (easing == "stepped") return via(easing::stepped, vs...);
     |            ~~~~~~~^~~~~~~~~~~~

It makes sense, the code is trying to compare an enumerated type with a string using the equal operator. So I cannot build it. What version of mingw are you using?


RE: Collision with tiles position and sprite not aligning correctly - RootBeerKing - 09-05-2023

(09-04-2023, 03:44 PM)megamarc Wrote: Hi,

I've updated my install of mingw to mingw64 to last one available (13.2.0) but I when building I get many instances of this error:

Code:
src/Include/tweeny.h: In member function 'tweeny::tween<T>& tweeny::tween<T>::via(const int&, Fs ...)':
src/Include/tweeny.h:2315:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
2315 |        if (easing == "stepped") return via(easing::stepped, vs...);
     |            ~~~~~~~^~~~~~~~~~~~

It makes sense, the code is trying to compare an enumerated type with a string using the equal operator. So I cannot build it. What version of mingw are you using?

Take out the include for tweeny. It's not being used anyways. Hopefully that fixes it for you. I'm using mingw64 1.4.0.0


RE: Collision with tiles position and sprite not aligning correctly - RootBeerKing - 09-19-2023

Hey Marc, Did you get a chance to download the link from the previous post?


RE: Collision with tiles position and sprite not aligning correctly - megamarc - 09-22-2023

Hi,

I've finally managed to build and debug the sample using VS2022 Community. Now I can check what it does and where's the problem.

Regards,


RE: Collision with tiles position and sprite not aligning correctly - RootBeerKing - 09-24-2023

(09-22-2023, 12:24 AM)megamarc Wrote: Hi,

I've finally managed to build and debug the sample using VS2022 Community. Now I can check what it does and where's the problem.

Regards,

Awesome, thank you so much. Hopefully it's nothing too hard to figure out