181x Filetype PDF File size 1.00 MB Source: www.brightonk12.com
Introduction to Snap! Computer Programming Tutorial 1: Sprite By: Matthew Jourden Brighton High School Brighton, MI Snap! Is a drag and drop Function Block computer language compiler. This software will allow the user to create both graphical images (I.E games) and allow the user to communicate with a Finch robot. This tutorial will introduce the basic concepts of creating a program with graphics using basic commands. 1. Open Google Chrome > Open App Bird Brain Robot Server > Pop Menu will Appear > Choose Level 4: Regular Snap! > Select Open Snap! Note: The screen will say No Finch Connected. This is ok for now since we will not be communicating to the Finch Robot. When writing a program that you want to talk to the Finch then it should say Finch connected. Programming Categories Snap! User Interface Standard tools: New, Save, Sprite visual box (Stage). Shows the output Open, etc. Programming Script from the program including movement, text, Categories. input, etc. Sprites: Avatars for Programming Area: In graphical output. May Programming Commands: The this area the user will add other sprites by commands will change based drag/drop commands to dragging and dropping a .gif or .jpeg in this area upon the Programming create and order a Categories. program Programming Categories 1. Motion- has commands that will allow the Sprite (onscreen) or Finch (robot) to move specified distances or directions 2. Looks- has commands that will have the Sprite (onscreen) or Finch (robot) to change colors and say/think text output. 3. Sound- has commands that will have the Sprite (onscreen) or Finch (robot) to apply audio commands 4. Pen- has commands that only works with the sprite on screen. Pen commands draws the motion of the sprite on screen. 5. Control- has commands that start a program or subroutine and has command loops and various types of if statements 6. Sensing- has commands that will use the sensor son the Finch robot. I.E collision detection, temperature sensing, etc 7. Operators- has commands that have Boolean and mathematical operations 8. Variables- has commands to create individual variables and blocks that create subroutine programs Create a Sprite a. For this tutorial we will use the Default Sprite b. Select the Arrow shown in the image below > This will create a new sprite that our program will be connected too. Select Arrow to use default Sprite Camera allows user to import images New Sprite Added NOTE: Icon labeled Sprite is the default program when Snap! Is first stated up Starting a Program 1. First task is to tell the compiler when to start. a. Select Control Menu b. Drag and Drop When “space” is pressed Note: another option would be to use the When (Select key pressed “Mouse button or when Green Flag is clicked) key pressed to begin the program. We will use this later to check certain options. Select Control Menu Drag and Drop Sprite Looks 1. Sprite Talks: Using Say and Think commands will have the sprite say the words typed in the text box of the code. These commands will not allow a user to input data with. That command would be in the Sensing Menu > ask command a. Goto Looks categories > drag and drop the Say “ “ for “ “ secs below the When green flag is checked > change the saying to Hello World!! Note the pieces should fit together like a puzzle piece. Select Looks Menu Drag and Drop > Change Message to Hello World b. Select the Spacebar on the Keyboard to test the program. Hello World will appear above the Sprite for 2 seconds Program lights up with halo glow when running
no reviews yet
Please Login to review.