Math problem

Get help using Construct 2

Post » Tue May 01, 2012 8:41 pm

Ive spent some time over this with no result:

Its for a breakout type game. I want the player to be able to "aim" wich way the ball is gonna go by trying to make the ball hit the bat towards the edges, the further away from the center of the bat the sharper ( or wider) the angle of motion gets. I have made a breakout game before in GM but the formula I used then (bat.X - ball.X +90) doesnt seem to work, most likely because in GM 270 is down and 90 is up. All I found when searching the forum was suggestions that I change the collision polygons but I dont think thats a good sollution.. hard to make it exactly symetrical.

Any ideas? :)

Thanx
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Tue May 01, 2012 9:07 pm

Just tweak that formula you used in GM. Instead of +90 use -90 or 270 which is up in Construct.

[code](bat.X - ball.X -90)[/code]
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue May 01, 2012 9:33 pm

LoL!! the bouncing of walls is all messed up to. Nah, deleting the hole project.. something as simple as a breakout game isnt worth the time it takes to figure it out. *sigh*
B
21
S
7
G
4
Posts: 221
Reputation: 5,070


Return to How do I....?

Who is online

Users browsing this forum: LaroTaio and 2 guests