Alternative Ball behavior

For questions about using Classic.

Post » Wed Mar 31, 2010 10:44 am

I suppose it must have crashed because I'm using a later version of Construct (I'm on 0.99.84).

Here's the same file as an EXE. If the movement seems okay to you, it would be very easy to reproduce - just use the settings I mentioned earlier for the ball, plus you need physics objects with 'immovable' ticked surrounding the layout to prevent the balls flying off into space. Also, I used literally one event - at start of layout, add force 1500 to get the objects moving.

http://dl.dropbox.com/u/906550/Construct/physics.exe
B
5
S
2
G
4
Posts: 113
Reputation: 2,101

Post » Wed Mar 31, 2010 11:03 am

[quote="Ashley":1tq0rzxg]Have you tried the latest build? I did slightly change the ball bounce algorithm in that, and I've improved it again for the next build - it actually seems much more reliable in the next build, so watch out for that and give it a try.[/quote:1tq0rzxg]
No, I have not tried 99.84, because I had read that you forgot to include David's fixes and other changes, so I decided to wait updated build with all fixes and more stable.
B
3
S
2
G
3
Posts: 146
Reputation: 1,567

Post » Mon Apr 11, 2011 2:38 pm

Has this problem been solved?
I find a similar problem between a plateform behavior sprite with a rectangle shape and a ball behavior sprite with a circle shape.
The circle (ball behavior) sprite will kick another outside the screen.

here is my test case:
http://dl.dropbox.com/u/5779181/collision_problem.zip

Wait a moment, you will see the black sprite gone.

(environment: construct 0.99.97 in winXP)
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Mon Apr 11, 2011 4:02 pm

Couple of tutorials about game physics, collisions, elasticity, gravity etc.

[url:1jj5bl26]http://dl.dropbox.com/u/22173473/Collisions.rar[/url:1jj5bl26]

Might be usefull ?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Tue Apr 12, 2011 9:28 pm

[quote="rexrainbow":385aymam]Has this problem been solved?
I find a similar problem between a plateform behavior sprite with a rectangle shape and a ball behavior sprite with a circle shape.
The circle (ball behavior) sprite will kick another outside the screen.

here is my test case:
http://dl.dropbox.com/u/5779181/collision_problem.zip

Wait a moment, you will see the black sprite gone.

(environment: construct 0.99.97 in winXP)[/quote:385aymam]



I had a quick look at your cap, and noticed that your 'walls' are made out of box objects with a 'transparent' fill ? Thats why the player and wall collision isnt working. The box object's outline is not thick enough(pixels) for it to register a collision.

Here's the cap file with the walls made out of a normal solid sprite.

[url:385aymam]http://dl.dropbox.com/u/22173473/colisionprob2.cap[/url:385aymam]

The black sprite now has something to stop it leaving the screen.

Hope this helps.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Apr 13, 2011 1:40 am

Thanks for this infomation about using sprite object to replace box object to make a boundary.
Another question, where to use box object?

In your cap, when black sprite idle(no keyboard pressed), it
had not been push when ball sprite hit it. It looks like a wall to block the ball. How to do that?
In my cap, the black sprite will be push back until ouside the window. I see the position x of black sprite is less then 0 in debug mode.

If black sprite will not move whe ball hit it, it will not been push ouside the window. That is a good solution. :D
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Wed Apr 13, 2011 2:20 am

[quote="rexrainbow":1ymv1kf5]Thanks for this infomation about using sprite object to replace box object to make a boundary.
Another question, where to use box object?

In your cap, when black sprite idle(no keyboard pressed), it
had not been push when ball sprite hit it. It looks like a wall to block the ball. How to do that?
In my cap, the black sprite will be push back until ouside the window. I see the position x of black sprite is less then 0 in debug mode.

If black sprite will not move whe ball hit it, it will not been push ouside the window. That is a good solution. :D[/quote:1ymv1kf5]




1, You could still use the box objects for the walls and floor, but you need to fill it with a colour (untick its 'use' transparent attribute for the fill colour)

2, To stop the black sprite moving when the ball collides : Give the black sprite a 'solid' attribute (tick the box that makes it solid)
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests