To make sure that everything is working, press the Green Flag and then click on the Red Button. To do this, we will grab a 'Hide' block from the Looks menu. We will change the 1 to 0.5.įinally, we will have the button go away after the animation begins. To make sure there is enough time to see this effect, we will grab a 'Wait 1 Second' block from Control. Since we initially moved the block up by 2, we will now change the 10 to a -2 so that it goes back down. To do this, we will select a 'Change Y by 10' block from the Motion menu. Now, we need to move the button back down. In the 'Switch Costume to' drop down, we will select the 'Up' costume. Then, we will select a 'Switch Costume to' block from the Looks menu. We will change the constant from 1 to 0.75. Next, we will select a 'Wait 1 second' block from Control. Instead of 10, we will change the constant to the number 2 as we just want a slight movement of the button so that the user knows it has been depressed. From there, we will select a 'Change Y by 10' block from the Motion menu.
We will select new message and type 'Red Flower'. To do this, we will select a 'Broadcast new message' block from Events. Next, we will send a message to the flower sprite letting it know to begin the animation. In the 'Switch Costume to' drop down, we will select the 'Down' costume. Beneath, the 'When This Sprite Clicked', we will add a 'Switch Costume to' block from the Looks menu. To do this, we will grab a 'When This Sprite Clicked' from Events. Next, we will create an animation so that we know when the button is pressed. For my animation, the X coordinates are -202 and the Y coordinates are -165. If your button was placed correctly, you should not need to change the X: Y: coordinates. After the 'Show' block, we will add a 'Go to X: Y:' button from the Motion menu. Beneath 'When Green Flag Clicked', we will place a 'Show' block from the Looks menu.
#FLORAL DESIGN ANIMATION CODE#
To code the button, we will first get a 'When Green Flag Clicked' from the Events menu. Then in the costume tab of the button, we will name the first costume 'Up" and the second costume 'Down'.įrom there, we will place our Red button towards the bottom of the screen. On the duplicated button, we are going to make the color darker red (color = 0, saturation = 76, brightness = 85) so that we can visually see when the button is pressed. To do this, we are going to duplicate the button by right clicking on it and selecting 'duplicate'. Now, we need to create the effect that the button is being pressed. Next, we are going to add the word 'Red' on top of the button so that the user is clear that pressing this button will create a red flower. For this button, we are going to make the button color red (color = 0, saturation = 100, brightness = 100). Once we have selected the button sprite, we are going to make it the same color as flower.
For this tutorial, I’m going to select the button sprite. You can either draw your own character using the paint tool or select from the library of available characters. In Scratch, these characters are referred to as Sprites. To get started, we need to create a character button that when pressed will start the flower animation. But, instead try to get an understanding of what parts of the code you need to change in order to get the desired effect. For each subsequent flower, try not to just copy and paste the code. Once you have a firm understanding of these key parts, you should be able to create multiple flowers that are different colors. There are going to be 3 key parts to this project: button creation, flower petal animation creation, and flower stem animation creation.
#FLORAL DESIGN ANIMATION HOW TO#
This technology tutorial is a great opportunity for those who are curious in learning how to build with technology to work with the visual based programming language, Scratch, without getting tripped up on syntax and grammar that are typical challenges of text based languages. Below is a preview of the completed project: In this tutorial, we will go through how to create a flower animation in Scratch. However, there are times when you want to have an animation be the entire focal point of a project. Great animations can also be used to extend a project to create more realistic looking characters or action sequences. Animations are a great way to level up projects.