2014년 12월 29일 월요일

Balls colliding and changing size as a result

OVERVIEW OF APP:
My app is similar to the IOS game, Osmos, where the user controls a ball, and the point of the game is to "absorb" other balls of varying sizes (radius). The catch is that if the user ball touches a ball larger, than it, the ball will decrease in size, and if it collides with a ball smaller than it, it will increase in size. 

ISSUE(S) I NEED HELP WITH:
1.      How can I have the "absorbtion" function work, with all balls able to be absorbed if the user ball doesn't decrease in size during that play through? 



Reading these articles may give you some inspiration:

http://www.appinventor.org/Chapter17   which discusses animation;

http://www.appinventor.org/Chapter18   which discusses programming logic.

For #1, you will need an If..then block with some code related to the sprite's current 'size'    and making comparisons.     You probably will make use of  the   and   and  or   logic statement blocks (you can test for multiple conditions if you use them with a single If..then condition).

Try some blocks and have fun.    If you have a specific question related to your blocks, post a screen capture (jpg or png) and someone might have some suggestions.



You will also need to use the ANY Ball blocks located
at the end of the Blocks pallete, to get at the ball radius
of the target ball.


댓글 없음:

댓글 쓰기