How do I keep my apples in the basket?

Get help using Construct 2

Post » Mon Sep 25, 2017 12:54 am

link to capx:!AobC4q3rBlr6jqZIaTMFeTmozpwXZA

I'm not sure if there's a way to set the physics, or what I want can't be done.

The "basket" moves left and right (you have to touch the bottom to drag).

Basically, I want to catch the apples, which works. But when the user quickly moves the "basket" back and forth, the apples come out of the sides.
Is there a way to keep them in? If not, I guess I'll have to destroy them, but it was cool to see them accumulate.
Posts: 65
Reputation: 819

Post » Mon Sep 25, 2017 6:24 am

Official tutorial says "Avoid crushing/trapping objects with Solids"

I don't have much experience with physics engine, so maybe there is a better solution, but I came up with this: Clone basket! ... .capx?dl=0

Basically when an apple collides with the inside of the basket, I create a clone apple in a clone basket which doesn't move. And then I adjust position of the original apple based on its clone's position on every tick.

There still may be issues when there are too many apples in the basket or if you move mouse vigorously enough. Maybe you should somehow limit the speed of your basket.

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
Posts: 2,027
Reputation: 77,135

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests