[Request] Box Behavior (Platform Stripped).

0 favourites
  • 3 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • Hi Everybody,

    So I just spent my whole day trying to create a 'box behavior' which is essentially a solid that can't pass through other solids but without using physics. (Since physics and solids don't work with each other and solids and solids are also pass through. Plus using physics on every object would be tolling to the end game and cause undesirable results)

    I figured since the only good way we have for creating a push-able/ pull-able box is to use a platform behavior on it then disable the default control and simulate controls and then do this for every object. It had a lot of issues foremost was issues when the player is bigger than the box. After a lot of experimentation and an old game maker tutorial on this subject I found an easier way of doing this without simulating controls or pinning or using physics but I still have to use the platform behavior for it to collide seamlessly to other solids.

    Then I thought why not just strip down the platform behavior to just 2 settings: the gravity/fall rate and it's ability to collide with solids (removing all the unnecessary controls and parameters). This way I could easily use the more leaner behavior across various levels and games without rewriting a collision for each object and share the result here for others to use.

    So, I copied the platform behavior folder named it 'BoxX' and started to delete lines which I though were unnecessary to this new behavior and disabled others I didn't understand by making them into a comment line. Needless to say I failed miserably which wasn't a shock as this was the first time I have ever seen a java script this up close.

    I got the parameters stripped and I don't get any error on loading construct but the object with this behavior disappears on game load. And I get an error if I have dy of a certain block turned on after which the game doesn't load at all.

    Anyway, If anybody could help me with this I'll be very grateful. I've the damaged files if anyone needs it. It's just a copy of the platform behavior.

    Thank you.

    (If this is the wrong way to request a function from the community please let me know and direct me to the right direction.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You might try this behavior

  • Hi rexrainbow,

    Thanks for the reply (and all your great plugins and behaviors).

    There is a couple of problems with that particular behavior.

    1: it doesn't have gravity control and doesn't fall down by default. (which can be coded with event sheet)

    2: I got some issues when you keep pushing the object to a vertical solid, if i keep going it starts moving up in Y axis. Like this:

    Sample Capx:

    [edit: file got removed since I've not got 300 reputation]

    It doesn't happen if the box has a platform behavior.

    Also if I keep using platformer behaviour for the box will it strain the system? (since if would process unnecessary code and functions).

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