making a sprite dance barb ericson georgia tech june 2011

16
Making a Sprite Dance Making a Sprite Dance Barb Ericson Barb Ericson Georgia Tech Georgia Tech June 2011 June 2011

Upload: margaretmargaret-watts

Post on 18-Jan-2016

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Making a Sprite DanceMaking a Sprite DanceMaking a Sprite DanceMaking a Sprite DanceBarb EricsonBarb EricsonGeorgia TechGeorgia Tech

June 2011June 2011

Page 2: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Goals• Learn about

– Deleting a sprite– Adding a sprite with several costumes– Programming the sprite – creating scripts

• The typical way to start a script executing• Using a forever block to repeat execution of a set

of blocks• How to change the costume in a script• How to make build in an amount of time to wait

before executing the next block

Page 3: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Project Description• We will make a sprite with more than one

costume look like it is dancing by repeatedly changing costumes

Page 4: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Big Picture• Delete cat sprite• Add a sprite from

the people folder– Add multiple costumes

for the sprite

• Program the sprite to look like it is dancing– Start dancing when the

green flag is clicked

– Forever loop (repeat)• Change the costume to

the next costume• Wait for a short amount

of time

• Then try out some additional things like adding sound or movement

Page 5: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Delete cat sprite• To delete the cat

– Click the scissors– Click the cat

• Or right click on the cat and select delete

Page 6: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Add a Sprite• Add a sprite from

the "People" folder– Click on the star

with a folder under the stage view

– Select the People folder

Page 7: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Add a Sprite (continued)

• Scroll down to pictures of Cassy and select one of the costumes

• Then click "OK"

Page 8: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Add more costumes• Click on the

"Costumes" tab in the center area

• Click on "Import"• Select another

costume for the same sprite– Then add more

Page 9: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Program the sprite• Create a script for

the sprite– Click on "Scripts"

in center area– Click on "Control

on left"– Drag out a "when

green flag clicked"

Page 10: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Program the sprite -cont

• Drag out a forever block – From the Control

category– And connect it

under the "when green flag clicked"

• You will see a white line where it will connect

Page 11: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Program the sprite - cont

• Click on the Looks category – Purple– And drag out a

"next costume" block

– Put it inside the "forever" block

Page 12: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Program the sprite• Click on the

"Control" category– Drag out a "wait 1

secs" block and put it after the "next costume" block

– Inside the "forever" loop

Page 13: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Program the sprite• Change the wait

time to 0.25 seconds– Click on the 1 and

it will highlight– Type in 0.25– Hit return (enter)

Page 14: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Try it out• Click the green

flag to start the script– At the top right

corner

• Click the red stop sign to stop

Page 15: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Challenges• Play a drum when she changes

costume– See the "Sound" category

• Move her right and left as she dances– See the "Motion" category

Page 16: Making a Sprite Dance Barb Ericson Georgia Tech June 2011

Concept Summary• Sprites

– Can be added from a file– Can have multiple costumes– Can be programmed with scripts

• You can start a script– By clicking the green flag

• You can repeat a block of code– Using a forever loop– Or pause execution using wait