Is it possible to make physics sprites stick together?

0 favourites
  • 8 posts
From the Asset Store
This is a twin stick shooter similar to Enter the gungeon,Nuclear Throne, Helldivers & Soul knight for the mobile device
  • Is it possible to make a game like Rovercraft, Bad Piggies, Reassembly and other similar games where you have multiple sprites co-operating as a single physics object? And if not, why is this not possible in construct 2 but possible in other game engines?

  • You can create those kinds of physics games on C2 but using physics is a more advanced game design technique and you need some background in physics math to make it all work and it takes practice working with the physics commands.

    Start working with the physics behaviors and you will find they can do some very amazing things.

    I have made several games using physics and nothing as complicated as some of those but the more you create using physics the better you get.

  • The general way to connect multiple physics object together is with joints, but they won't give absolute rigid results. The way to do that is merge multiple shapes to one object, but neither the physics or chipmunk behavior provide that capability.

    Why? Well the bundled physics is fairly simple what features it provides from the box2d library. With the chipmunk behavior I opted to keep things simpler by just keeping one shape per object because it's more useful in the general case.

    Possible solutions could be the just use a physics library directly with JavaScript run with the browser object, or a new physics behavior which just provides access to everything in the library. you'd have to deal with more errors.

  • A rigid joint is a pin behavior and you can use pins with physics in C2. Rotating joints can be made to stay together but you have to tweak the friction, mass and gravity to make it work. It is all possible in C2 just not that easy if you have not worked with physics math.

  • I am looking for the effect that pin has on construct but with it actually working, it is well known that pin and physics don't work together at all and just send objects that come in contact with the pined physics object flying across the layout. I worked with the physics behavior on construct 2 for 4 years and can not replicate the pin behavior on construct 2 with working/non-buggy physics no matter what I do.

  • I am looking for the effect that pin has on construct but with it actually working, it is well known that pin and physics don't work together at all and just send objects that come in contact with the pined physics object flying across the layout. I worked with the physics behavior on construct 2 for 4 years and can not replicate the pin behavior on construct 2 with working/non-buggy physics no matter what I do.

    They only go flying off the screen if you pin a physics object to another physics object.

    You can pin non-physics objects to physics objects and in your example those games use a combination of both.

    CAPX

    https://www.dropbox.com/s/43967wo8do2iegu/Pin%20Joint.capx?dl=0

    Those yellow sprites are non physics objects pinned to a physics objects and go ahead and whack them with the physics bat and try to get them to come apart.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, the physics behavior doesn't provide the features to do it.

    One idea that would work, and that I'm interested in, is to just deal with a physics library directly with JavaScript. The only disadvantage is it would be completely seperate from the behavior's and how they nicely mesh with c2's features. So everything would have to be done with events. A plugin would be better but that takes a lot more time to make and polish. I'll probably try the idea this weekend and see what comes of it.

  • Another option is to write your own physics engine with events. Using sprites, you could create your own physics rules for collision and object interaction.

    A third option is to have your sprites be pinned to invisible physics objects. When two objects collide, the two underlying physics objects could be replaced by a single larger physics object. Just re-pin the two sprites to the larger physics object, and compute the new size of the collider based on the combined size of the two sprites. This might give you a close enough approximation of the behavior you are looking for.

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