mrbrenlea

mrbrenlea

Sunday, October 11, 2015

Looking Deeper into Loops

This week in EDTECH 597, I had the opportunity to explore loops on a deeper level.  In prior units, I typically used the forever the block.  This week, I got to learn about the power of putting in an if/then block inside the forever block.  What this essentially does is allow a program to continually watch out for a certain condition to be met.  When this happens a new command or order can be initiated.

Take for example my work on the projectormodified.  In order have the ball hide, pen go up, score added, and target position changed, I needed to find a way so that when the ball sprite hit the target, the desired changes where implemented.  I did this by adding a new bit of code using a if/then block inside the forever block.   I used a similar idea for my dragon shooting game as well.

This is a powerful tool and a great concept to learn about as this makes triggering certain conditions that much easier.

No comments:

Post a Comment