How do I pick the last object

Get help using Construct 2

Post » Sat Apr 22, 2017 3:32 pm

Hello. Im trying to pick the last created object but i can't seem to make it work.

I have a global variable Ballz. which is at 1 at startup, when the player clicks the ball is dropped and if the ball hits a ring, 1 is added to the Ballz variable, that way the player can keep going till he/she runs out of luck.

Question 1 is: how do i target the last dropped ball ?
Question 2 is: how do i detect when the ball isn't bouncing anymore ?
Hint: The game is over when the ball isn't bouncing anymore.
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Apr 22, 2017 4:44 pm

system condition: pick nth instance: ball.count-1
that will pick the last instance that was created.

To detect is ball isn't bouncing, depends how your bouncing is implemented. How is your bouncing implemented?
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949

Post » Sat Apr 22, 2017 7:45 pm

Prominent wrote:system condition: pick nth instance: ball.count-1
that will pick the last instance that was created.

To detect is ball isn't bouncing, depends how your bouncing is implemented. How is your bouncing implemented?


Using Physics on my ball with the Elasticity set to 0.8.
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Apr 22, 2017 8:38 pm

I don't use the default physics in construct, so I'm not sure. I checked and it looks like there isn't a simple method for detecting that.
If you use Chipmunk physics behavior, there are conditions and expressions for checking if an object is colliding, and other stuff, which would make it easier to determine what the object is doing.
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949

Post » Sat Apr 22, 2017 9:06 pm

Prominent wrote:I don't use the default physics in construct, so I'm not sure. I checked and it looks like there isn't a simple method for detecting that.
If you use Chipmunk physics behavior, there are conditions and expressions for checking if an object is colliding, and other stuff, which would make it easier to determine what the object is doing.


Allright. Thanks a bunch for the help. Much appreciated.
B
11
S
3
Posts: 31
Reputation: 814


Return to How do I....?

Who is online

Users browsing this forum: evillair, gamecorpstudio, jorgmaquoi, Yahoo [Bot] and 26 guests