How do I fix the hanging on edges?

0 favourites
  • 13 posts
From the Asset Store
On the Edge is a puzzle game where you have 40 levels to have fun with.
  • Hello.

    I have a Question to the Rotate feature of C2.

    I already have create a Circle with a collision Polygon, so that i can move the Player inside the Circle (The Player is a Circle too). But now at this point, my problem starts.

    I have use the Platform Behavior for the Player and set the Acceleration and the Deceleration to 0, so the Player only can Jump.

    Next at the Circle i have use the Rotation behavior, which is rotating left or right when i press the Left or Right Key on my Keyboard. That all works great, but when i insert some platforms , the player hanging on the edges and don´t falling down or slide down bevels when the Circle is rotating.. then i test it with the Physics Behavior AND then i get a Errormessage

    Uncaught node.js Error

    Assertion failed: 3 <= count && count <= 8, at: Box2D_v2.2.1/Box2D/Collision/Shapes/b2PolygonShape.cpp,122,void b2PolygonShape::Set(const b2Vec2 *, int32) at Error

    at Error (native)

    at x.___assert_func (http://localhost:50000/Physics_behavior.js:233:28)

    at dc (http://localhost:50000/Physics_behavior.js:213:73440)

    at nQ (http://localhost:50000/Physics_behavior.js:214:142833)

    at Q.Set (http://localhost:50000/Physics_behavior.js:482:367)

    at createPolygonShape (http://localhost:50000/Physics_behavior.js:568:11)

    at behinstProto.createBody (http://localhost:50000/Physics_behavior.js:1469:24)

    at behinstProto.postCreate (http://localhost:50000/Physics_behavior.js:1083:8)

    at Runtime.createInstanceFromInit (http://localhost:50000/preview.js:2839:28)

    at Layer.createInitialInstances (http://localhost:50000/layout.js:1316:25)

    How i can fix the hanging on edges?

    Here a Picture of the Problem:

    s14.directupload.net/images/140720/jdxn2vye.jpg (Ball is not falling down.. it is hanging there)

  • Why are you using physics and platformer? They are not compatible

  • I only have tested with Physics, because the Ball hanging on Edges.

  • Sorry, your english is kinda weird, but reading a second time I think I see what is that you're doing. The rotation behavior might be causing the collision polygons to move inside each other, screwing up the physics simulation... if you post the .capx we can take a look at it instead of just guessing

  • Sorry for my english, i´m from Germany <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    Here is the CAPX to view.

    dropbox.com/s/3ja3w6aftwgfyx2/BPM.rar

    If you start the CAPX, you see what i mean. The Ball is not in the middle of the Screen and it hanging on edges. To steer the Ball use the Left or Right Arrow on your Keyboard - Jump = Up-Arrow.

  • I've downloaded, but what the heck, 19MB?

    I'm not sure what it is you are expecting to happen and what it is that is happening, so could youe xplain more clearly?

    What do you mean by hanging and what are the edges you are talking about?

    Also you are using a very big round thing with Way too many colisionpoints,but that is your choice..

    I guess one of the issues is the 1000 collisionchecks per second when reaching the platforms..

  • I just checked and your player has around 70 collision-points and the way to big circle-sprite has around 180..

    It's just a bit too much..

  • 19MB = Maybe the Music at the Mainscreen. The Collision Points are needed for the round thing, if there are to less collision points, the ball move not on the inner edges of the round thing (you know).

    Okay, how i can lower the collisionchecks? Or do you have a idea how i can make this concept (move inner the round thing) in other ways? Is here at the Forum a CAPX for some similar projects? I search for a Video to show you, what i want to make.

  • Okay... so -- do you know Super Mario Galaxy? Here Mario move above the Planet, but i want to make a game where "Mario" is movin in the Circle. I hope you understand now what i mean.

    Here a example on a draw:

    s1.directupload.net/images/140720/zjfur9jo.jpg

  • I understand..

    You should create the circle out of smaller parts..

    a 3840 by 3840 pixels sprite is never a good idea, one that needs 180 collisionpoints is even worse..

    create a part copy it, turn it and copy that part and turn it, untill you have a circle..

    This will take much less memory and won't demand near the processingpower you need now..

  • Yes you´re be right, thats a good idea. So i have more Parts, but i save much of resources... okay i will do it. If the problems are

    continue, i will come back ^^

  • If your player has the physics behavior, you can change the collision mask to "circle" instead. It'll set its physics collision to a circle that has the width of the object. The original collision box is still used for collision events

  • Try Construct 3

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

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

    Im trying to do something similar (another thread). So basically the only way to make a "barrel of monkeys" is to create the barrel in segments as you suggest.

    I tried this but am having trouble getting each 'beam' to PIN to each other and rotate the barrel from the center. I made a CAPX example on this thread and

    not sure how to make the circle..well, i do..if i create a 1/6th of a curve sprite and make 6 pieces and join them together but i tried this and the segment will

    definitely need more then the 8 points to be a smooth edge..i think that's what Edelplastic was getting at.

    I wondered if chipmunk physics would have something to solve this with. I'm surprised, i can think of many things that would be handy to have a sprite freely

    moving in another polygon shape (besides a square which is obviously easy).

    But anyway...This post to say thanks for that last tip...i couldn't remember reading that but it will help with something else.

    Cheers,

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)