EDIT. SOLVED thanks to Magistross and retrodude and newt:
.capx
dl.dropbox.com/u/28087823/Construct%20Examples/pixel-perfect%20engine%20with%20loops%20-%20no%20slope/jumpy3.capx
playable here:
dl.dropbox.com/u/28087823/Construct%20Examples/pixel-perfect%20engine%20with%20loops%20-%20no%20slope/index.html
____________________________
Hi everyone!
I'm Christina. Long time lurker, first time posting.
I've been disappointed with the lack of pixel-perfect controls in Construct2, since I have my sights on making a simple metroidvania as practice, and I really need to save time by using small pixelart sprites.
This (http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=1095) custom platform engine by Kayin is awesome , but when translated into C2, it suffers from the 1-pixel inaccuracy problem (http://www.scirra.com/forum/platform-object-sinks-into-solid-ground-bug_topic57004.html)
I managed to find an old trustworthy MMF2 method by Damian (http://damiansgames.com/post/6923285368/making-a-platformer-in-multimedia-fusion-2-or-games) and successfully ported it into C2.
I had to make the player sprite's bounding box one pixel smaller on each side (player sprite is 25x25px, player bounding box is 23x23px), but other than that it works great. I'm sure I could clean it up a little, especially those "direction" variables.
If anyone wants to take a look, the project is here
dl.dropbox.com/u/28087823/Construct%20Examples/pixel-perfect%20engine%20with%20loops%20-%20no%20slope/index.html
and .capx is here
dl.dropbox.com/u/28087823/Construct%20Examples/pixel-perfect%20engine%20with%20loops%20-%20no%20slope/test%20movement%20with%20actual%20loop.capx
So!
1st Question: is there any way to implement slopes in an engine like this? I mean small, 1-pixel steps, that the player sprite can climb, like Kayin's. Check the .capx , that small pixel-high bump on the floor is enough to completely stop the player sprite - which is good, it means pixel-perfect collisions are working. I tried using a slopeDetector sprite, but it kept thinking the walls were slopes. Perhaps I'm missing something.
2nd question: does anyone know why this engine won't play nice with dt? I tried introducing 60*dt instead of 1px steps and movement immediately becomes erratic. Jump strength becomes random as well. Does using pixel-perfect collision loops come at a price?
Glad to be here :)