Friday, October 7, 2016

L.A. 4.1 A Serious Look at Visual Coding

This week I expanded my understanding of coding with blocks by learning a few new commands, and the idea of stringing several commands together. You can really do some neat stuff by organizing and arranging some pretty basic commands in different ways.

This SNAP activity has you building what could be a mobile app. You create the basics, having Alonzo move when you click him, and you build and build until you're scoring points if you click him fast enough, losing points and jumping him around if you miss, he gets faster and faster and you can even challenge yourself with a high score.

The activity's great because they give you all the commands you need to complete each step (they even highlight the new ones you'll use in that step) but you have to come up with how you can use those, where you can put them, to achieve the goal.
The first step that stumped me was #4; the introduction of the forever command, which acted basically as a loop. I wanted Alonzo to move if I clicked him, but I also wanted him to move if I didn't click him fast enough.


Here you can see that I told Alonzo to talk and turn every time I clicked him.  However, I also wanted him to move around if one of two conditions were met; if I clicked him, or if a certain amount of time had passed.  (This screen shot is from a few steps later and you can see the score coming into play as well.)  This is a great command for putting some autonomy into a sprite.  

I also worked more in depth with variables than in my Scratch game.  I had a few modifiers for my score: increase with clicks, decrease with failed clicks, and don't go below 0.  This is an important feature for designing a game, and could be used in other applications:  If there's nothing to do this with, then don't do that.  This seems obvious, but programs don't do obvious, they do what you design, and they might find an interesting way of doing that thing anyway and really messing up your program.







No comments:

Post a Comment