makron's Recent Forum Activity

  • No more hints? Is side scrolling so bad?

  • Reduced test-version to demonstrate the problem: https://www.dropbox.com/s/8lvi4avjevxw1 ... .capx?dl=0

    Some of the variants I tested:

    Variant 1a: platforms not immovable, modified by set x, items not modified

    -> Problem: items "slide" along platforms

    Variant 2: platforms not immovable, modified by set x, items modified by set x

    -> Problem: breaks physics

    Variant 3: platforms immovable, modified by set x,

    items modified by set x with physics disabled, enabled on collision

    -> Problem: best so far, but collision among items are unstable, "sleep" state is not enough to detect rested items

    Thanks for any hints,

    Marc

  • I cant open that project unfortunately, its a newer version (although I have 227 which is "latest stable")?

  • Hi there,

    thanks for the idea, I guess basically Im doing that when I disable/enable the physics behaviour on the item. As to the gravity idea: The manual says that "gravity applies to the whole "world". If you set gravity to 0 on one object, gravity is turned off for all objects", which wouldnt help me - is there an other way to do it?

    Edit: When using physics enable/disable I find that collision between items again makes the collisions pretty wild, so that isnt working well unfortunately.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi everyone,

    I am currently trying to do a simple side scroller in an infinite level by scrolling the items through the screen and respawning them on the right. The player basically only moves up and down. This seems a lot harder than I thought. FYI: Im a rather experienced programmer (mostly not in gaming) and new to Construct2. Now sidescrolling is a pretty simple thing, or so I thought, thus I am rather disappointed on how difficult it proves to be. The way I tried it, it breaks some profound assumptions of the physics behaviour, and I am very much interested to hear what others have to say to my current approach:

    I have solid physics objects, some immovable ones (ground+platforms) and other movable ones (player sprite+items). Whenever the player "moves", all non-player objects move to the left while the player remains stationary in X. I just used set object.x = object.x-velocityX for all of them. This "simple" position change of movable physics objects breaks the physics behaviour completely, they wobble around and motion after collision is completely wild. So instead of assigning the items' x positions I now disable the items' physics until a collision occurs, so they are glued to the platforms and bumped away on collision by physics.

    This looks reasonably well, but I face the next problem: When the items are bumped away and remain within the view, they should come to rest on the ground or a platform, and then of course move to the left again if the player continues to move. Now when they come to rest on a platform (solid and immovable) and the platform is moved away to the left due to the player moving forward, the items remain floating in mid-air. Probably the physics engine (rightfully) assumes that collisions need not be updated for an immovable object. So I triggered a "refresh" by enabling and disabling the physics behaviour of the platforms. You really shouldnt have to do that, should you? And of course, still, the items do not move with the platform to the left.

    Of course these are just hacks around the basic problem which is: How can I tell the physics engine that its "world" is moving to the left? Or cant I use the physics behaviour at all? I did some other experiments, such as using the physics properties to move the items instead of setting x positions directly, but without much success.

    Best regards,

    Marc

makron's avatar

makron

Member since 29 Apr, 2016

None one is following makron yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies