Make an object bounce at layout end

Get help using Construct 2

Post » Sat Dec 24, 2011 11:49 pm

Basically I want to make a dodge game (like http://www.lewpen.com/game/).

Every time you "catch" a target, a red circle appears. When the circle is outside the layout, it should bounce off at a logical angle. I tried to do this in construct 2, but I've no idea how.

Anyone has any idea how this could be done?
B
21
S
6
G
5
Posts: 7
Reputation: 4,574

Post » Sun Dec 25, 2011 12:38 am

use bullet behavior with bounce off solid setting, you should probably add a bit of randomness to the angle, cause now its very predictable, but its a start
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Dec 25, 2011 1:18 pm

Should I add an invisible wall to the edges of the screen then?
B
21
S
6
G
5
Posts: 7
Reputation: 4,574

Post » Sun Dec 25, 2011 2:51 pm

I used the invisible walls now on the screen edges. Problem is that when the beetleship is at your mouse pointer it flashes.

You can test it at: http://wizard.mmotter.com/

Any suggestions?
B
21
S
6
G
5
Posts: 7
Reputation: 4,574

Post » Sun Dec 25, 2011 4:36 pm

only set the angle to mouse if the distance to mouse is greater then a certain distance

every tick
distance(player.x, player.y, mouse.x, mouse.y)
is greater then
100

set player angle of motion to mousevtrix2011-12-25 16:37:30
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Dec 25, 2011 9:38 pm

Maybe you could stop its movement when it overlap the mouse.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Dec 26, 2011 11:56 am

Ok, thanks, I did that
B
21
S
6
G
5
Posts: 7
Reputation: 4,574


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests