Top-down fake 3d physics

Get help using Construct 2

Post » Mon Mar 18, 2013 5:24 am

Imagine you want to drop a load of coins on the ground in a top-down, 2d world using 2d physics. How would you do it?

Attached is a capx showing several attempts I've made to bounce an object a set amount of times on an arbitrary Y coordinate.

The advantage to setting Y coordinates as collision axis is that you can create 5 coins that randomize where this Y collision will be and each bounces in a unique place. If you tried to do this with invisible immovable physics objects, you would not get the desired FX.

bouncingObject.capx

Tips: try increasing and decreasing the bounceStrength instance variable of the green physics ball. The blue ball is just a graphic that is pinned. In a real game you'd probably make the physics object invisible.
B
9
S
2
Posts: 25
Reputation: 1,050

Post » Mon Mar 18, 2013 6:58 am

Here is less complex way (and you wont need to use physics objects!): Bouncy Ballsvee412013-03-18 06:58:41
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Mon Mar 18, 2013 3:39 pm

Well, ideally I want to avoid using collision objects in favor of randomly generated Y coordinates as the bouncing axis for an arbitrary # of items.

However, I might be able to borrow the bullet idea if I decide to go the route of creating 3-4 invisible sprites at slightly randomized Y locations about the base of the enemy's sprite. Then I'd have to ensure that different items only bounce against specified sprites.

Which method do you think has more performance overhead?Asmodeus2013-03-19 03:24:56
B
9
S
2
Posts: 25
Reputation: 1,050

Post » Tue Mar 19, 2013 6:41 am

Your design has motivated me to try an alternative using the bullet behavior as described above and it seems to be working somewhat so far.

B
9
S
2
Posts: 25
Reputation: 1,050

Post » Sun Apr 07, 2013 11:16 pm

Alright, so if I spawn an "itemdrop" object that keeps track of 4 "bouncepad" objects every time a monster is killed, the game performance grinds to a halt after about 10 itemdrops are on the screen.

The "bouncepad" object is basically just an invisible sprite object that the items are registered to bounce off of, so it makes it look like you have 3d physics. Each bouncepad receives a random Y position near the enemy's last x,y coord.

There's got to be a way to optimize this.
B
9
S
2
Posts: 25
Reputation: 1,050


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, SpartCrafter, Yahoo [Bot] and 24 guests