B
Barney
Guest
Hello everyone!
I have tried for a couple of weeks now to get my platformer collisions to work properly in GMS2.
I have followed both Mike Dailly's and Shaun Spaldings tutorial on the matter but they only ever create the floor Collision for sloped tiles,
I need the ceiling tiles to work much the same way, since my player interacts with them relatively frequently.
It is so important, in fact, that I have contemplated switching back to Unity's engine, even though I run into other problems there. (Notably the worst possible way to handle frame based animation known to civilization)
I could get it to work with my Raycasting Engine there.
So what's my exact problem then...?
I tried to follow what has been said in both Tutorials, the common ground there, being that we take a screenshot of the collision tile map and fill an array with the amount of pixels on the y-axis for each pixel on the x-axis.
So I quickly figured out, we need to reverse the pixel-counting logic to get the same number of pixels for the ceiling tiles. (Counting from the bottom upwards).
I got that to work quite nicely as I checked my arrays in the console.
I then foolishly thought I could re-use much of the code that handles the bottom slope tiles, to no avail.
My problem here is that I apparently don't know where to place the character based on the collision that has happened and spent my last 2 weeks trying to figure this out.
I calculated with example collisions to figure out where my math went wrong and got rid of the bouncing, however once I reversed the gravity back to normal (pointing downwards, had it upwards to test the ceiling)
I get stuck the slopes once I collide with them.
I move nicely along them... I just stop falling down, even though Gravity is accelerating me constantly, which I also checked for.
I hope anyone can give me at least a couple pointers to this problem, as the floor tiles work very nicely now.
However that is not enough in a 2D Metroidvania, as you might imagine.
I have tried for a couple of weeks now to get my platformer collisions to work properly in GMS2.
I have followed both Mike Dailly's and Shaun Spaldings tutorial on the matter but they only ever create the floor Collision for sloped tiles,
I need the ceiling tiles to work much the same way, since my player interacts with them relatively frequently.
It is so important, in fact, that I have contemplated switching back to Unity's engine, even though I run into other problems there. (Notably the worst possible way to handle frame based animation known to civilization)
I could get it to work with my Raycasting Engine there.
So what's my exact problem then...?
I tried to follow what has been said in both Tutorials, the common ground there, being that we take a screenshot of the collision tile map and fill an array with the amount of pixels on the y-axis for each pixel on the x-axis.
So I quickly figured out, we need to reverse the pixel-counting logic to get the same number of pixels for the ceiling tiles. (Counting from the bottom upwards).
I got that to work quite nicely as I checked my arrays in the console.
I then foolishly thought I could re-use much of the code that handles the bottom slope tiles, to no avail.
My problem here is that I apparently don't know where to place the character based on the collision that has happened and spent my last 2 weeks trying to figure this out.
I calculated with example collisions to figure out where my math went wrong and got rid of the bouncing, however once I reversed the gravity back to normal (pointing downwards, had it upwards to test the ceiling)
I get stuck the slopes once I collide with them.
I move nicely along them... I just stop falling down, even though Gravity is accelerating me constantly, which I also checked for.
I hope anyone can give me at least a couple pointers to this problem, as the floor tiles work very nicely now.
However that is not enough in a 2D Metroidvania, as you might imagine.