Stop bouncing off sides?

Get help using Construct 2

Post » Thu Oct 20, 2011 1:01 am

The player is a continuous bouncing ball which can be moved left & right over platforms (think Mario Bros.) using the Bullet behaviour but I'm having a slight problem that the ball bounces off the sides of the platforms and speeds of the screen, I'm using the Solid behaviour for the platforms.

How can I just bounce of the top of the platform and not bounce off the sides?

Here's the .capx - http://www.mediafire.com/?5pzve04orz4onpn

And here's what I mean: http://dl.dropbox.com/u/2485349/Bounder/index.htmlNickydude2011-10-20 01:11:58
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Thu Oct 20, 2011 5:30 am

Hi Nickydude

You could give your player sprite a bound to layout behavior. That will keep it from bouncing out of the layout area. Or just make some walls, give them a solid behavior, and in the properties window set the initial visibility to invisible. Either way should work.

Wink2011-10-20 05:31:22
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Thu Oct 20, 2011 1:14 pm

Thanks Wink but that's not quite what I mean. I want to stop the player bouncing off the sides of the platforms, not the edges of the layout as it will be a big level which the player can bounce around.

Have a go here http://dl.dropbox.com/u/2485349/Bounder/index.html and try to bounce up the steps and you'll see what I mean. :)Nickydude2011-10-20 13:16:10
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Thu Oct 20, 2011 3:37 pm

Hey Nickydude,

Im not an expert but i had a quick look.

What i would try is to add an event:

(ball) on collision with (block) = (ball) bounce upward.

I have only just started using Construct myself so i dont know how to get the ball to go up off the top of my head but there is a "force push" behaviour or something along those lines that would work nicely, its in the C2 examples.GenkiGenga2011-10-20 15:42:40
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Thu Oct 20, 2011 4:21 pm

Another way would be using platform behaviour.

Example
capx
B
79
S
32
G
23
Posts: 119
Reputation: 14,937

Post » Thu Oct 20, 2011 4:28 pm

Brilliant kastas, that's exactly what I was after! Thanks.
B
72
S
25
G
9
Posts: 382
Reputation: 10,649


Return to How do I....?

Who is online

Users browsing this forum: imothep85, LeFuji, makkancs, Marxally, Virpoja and 23 guests