2015년 1월 1일 목요일

Operation Bounce cannot accept the arguments

I am trying to get a ball to bounce off any edge and a particular sprite (black rectangle) when the ball collides with it. The edge bounce works fine however I am getting a runtime error when the ball collides with the sprite and I am not sure how to resolve this:

The operation Bounce cannot accept the arguments: com.google.appinventor.components.runtime.ImageSprite@9487501
Note: You will not see another error reported for 5 seconds.

I have copied screen shots below to show the error, the blocks and the design. Thanks in advance for any help.






the Bounce block expects an edge, but not an image sprite



Bounce(number edge)

Makes this sprite bounce, as if off a wall. For normal bouncing, the edge argument should be the one returned by EdgeReached.

Edge here is represented as an integer that indicates one of eight directions north(1), northeast(2), east(3), southeast(4), south (-1), southwest(-2), west(-3), and northwest(-4).

what you can do is to modify the heading of the ball in the CollidedWith event instead



Thanks!


댓글 없음:

댓글 쓰기