ball physics
![praj](https://images.v-cdn.net/banned_large.png)
since no one answered my previous post let me repost it.
i have problem with ball physics. the ball does not bounce off wall properly.
here is my rules-
Random initial velocity- speed 300. (250,290)
When collide with paddle, change attribute- self.motion.linear velocity x to self.motion.linear velocity x +1*(self.position x-game.mouse.position x) ------ this is iphone game so i made buttons to move left or right.
When attribute-self.motion.linear velocity y > -15
self.motion.linear velocity y <-15 then, change attribute self.motion.linear velocity.y to random(70,120)*(1)^(random(1,2))
Ball density-100
paddle density-1000
wall density-10000
PS. i have changed the values and densities but the problem is there or sometimes worse.
My problem is that the ball does not bounce off wall properly. many times when it hits a brick and bounces off and hits the wall, after 2 bounce or so it changes direction and goes back up without hitting the paddle. This problem is also there in the template in arcade. Can someone help me?
i have problem with ball physics. the ball does not bounce off wall properly.
here is my rules-
Random initial velocity- speed 300. (250,290)
When collide with paddle, change attribute- self.motion.linear velocity x to self.motion.linear velocity x +1*(self.position x-game.mouse.position x) ------ this is iphone game so i made buttons to move left or right.
When attribute-self.motion.linear velocity y > -15
self.motion.linear velocity y <-15 then, change attribute self.motion.linear velocity.y to random(70,120)*(1)^(random(1,2))
Ball density-100
paddle density-1000
wall density-10000
PS. i have changed the values and densities but the problem is there or sometimes worse.
My problem is that the ball does not bounce off wall properly. many times when it hits a brick and bounces off and hits the wall, after 2 bounce or so it changes direction and goes back up without hitting the paddle. This problem is also there in the template in arcade. Can someone help me?
Comments
http://forums.gamesalad.com/discussion/39807/the-perfect-ball-but-how
this is my problem. sorry for poor quality. hope you understand. just look at the bounce.