Platformer and set to X, Self.X+/-speed*dt

Bugs will be moved here once resolved.

Post » Wed Nov 02, 2016 8:32 am

Problem Description
here's the setup, we have the basic template of platforming of C2 modified to fulfill the needs of this bug report, J moves the sprite to the left while K moves it to the right, not with vector X actions though, but with set X to self.X + or - 300*dt, and we can see things if we smash into a wall, not the same if going left or right

Attach a Capx
https://1drv.ms/u/s!AjkoCSebIn9JizU1_14PLQcGmACF

Description of Capx
keep the J or K keys down to see the effects

Steps to Reproduce Bug
  • start previewing
  • keep J pressed and see the sprite randomly jumps against the wall, by using the debugger, you can see it alters the Vector Y value
  • Let's try with K, it clips into the wall a little and also is slightly above the ground, press J again to see it does not fall back into the ground
  • press left or right to use the normal platforming movement, where this does not happen, and it'll fall back to the ground

Observed Result
jumps when hitting the wall on the left, clips and moes slightly upwards when going to the right in the wall

Expected Result
to stops right at the wall without jumping or elevating itself

Affected Browsers
  • Opera: YES
  • FireFox: YES
  • Edge: YES

Operating System and Service Pack
Windows 10

Construct 2 Version ID
r239, unsure if this happens on previous versions

live preview of the bug:

http://c2-bug-platformer-set-x.bitballoon.com


This bug was not actully discovered by me, but by someone else, I suggested to use the Vector X action instead, but I still think it should be reported.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Nov 14, 2016 5:14 pm

Closing as won't fix. If you set the position directly instead of simulating controls, you effectively teleport the object to somewhere it isn't expecting to be, which breaks the platform behavior's stepping algorithms.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests