hoho501
February 26th, 2009, 03:24 PM
can someone help me the ball goes through the walls sometimes and i dont know how to fix it heres the file
49272
cbeech
February 27th, 2009, 11:16 AM
well although I would restructure the codes here and remove them from the 'ball' attachment and place them on the timeline - the main issue is that you are using a shape based hitTest on the wall instance. as the ball's speed increases, it can essentially 'skip' right over the 10px wide wall and never trigger the hitTest. since your field is square, i would consider using a bounds based test rather than hitTest for this aspect of your game:
if(ball._x<0 || ball._x>Stage.width || ball._y<0 || ball._y>Stage.height) { ... }
additionally, i would place the balls registration point at center rather than uper left.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.