-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
40 changed files
with
7,090 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
# Lab 0.6: Self-portrait | ||
|
||
## It's all about you! @showdialog | ||
|
||
In this tutorial, you will continue your exploration of MakeCode Arcade, | ||
creating a simple "self-portrait" to introduce yourself to your instructors | ||
and your classmates. | ||
|
||
## Bell ringer @showdialog | ||
|
||
**How would you fill in this sentence? I am ______.** | ||
|
||
This could be answered in many ways: | ||
|
||
1. What you enjoy doing: I am *a musician*. | ||
1. Physically: I am *tall*. | ||
1. Personal characteristic: I am *funny*. | ||
1. Career aspirations: I am *an engineer*. | ||
1. Self-reflective: I am *a deep thinker*. | ||
1. As an athlete: I am *a runner*. | ||
|
||
Want some other ideas? | ||
|
||
**Complete this sentence: I like ______.** | ||
|
||
Take a few minutes to think who you are and what you like, | ||
and write down a few of them. | ||
You will use these descriptions shortly! | ||
|
||
## Set the scene! | ||
|
||
In this tutorial, you will be adding blocks to your | ||
``||loops(noclick):on start||`` | ||
container. | ||
|
||
- From the | ||
``||scene:Scene||`` | ||
drawer, set the background color. | ||
|
||
View the hint by selecting the light bulb below | ||
if you need to see an example of the code that you are building. | ||
|
||
```blocks | ||
scene.setBackgroundColor(7) | ||
``` | ||
|
||
## Here I am! | ||
|
||
Now, let's add your avatar. An **avatar** is an image that represents | ||
someone or something. | ||
|
||
1. From the | ||
``||sprites:Sprites||`` | ||
drawer, create a new sprite that represents you. | ||
1. Give your sprite an image that represents you. | ||
**Do not** use an existing image from the gallery. | ||
|
||
View the hint by selecting the light bulb below | ||
if you need to see an example of the code that you are building. | ||
|
||
```blocks | ||
scene.setBackgroundColor(7) | ||
// @highlight | ||
let mySprite = sprites.create(sprites.builtin.cat0, SpriteKind.Player) | ||
``` | ||
|
||
## You don't say! | ||
|
||
Now, let's have your avatar say some facts about you. | ||
|
||
- Using a block in the | ||
``||sprites:Sprites||`` | ||
drawer, make the sprite "say" several things about you, including: | ||
1. Your name and grade | ||
**Internet safety note**: When creating projects | ||
that may be shared on the Internet, | ||
**only** use your given (first) name. | ||
**Do not** use your first and last names. | ||
1. At least three things from the bell ringer activity. | ||
1. "Goodbye!" | ||
|
||
View the hint by selecting the light bulb below | ||
if you need to see an example of the code that you are building. | ||
|
||
```blocks | ||
scene.setBackgroundColor(7) | ||
let mySprite = sprites.create(img` | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . . . . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
`, SpriteKind.Player) | ||
mySprite.sayText("My name and grade") | ||
mySprite.sayText("Fact #1") | ||
mySprite.sayText("Fact #2") | ||
mySprite.sayText("Fact #3") | ||
mySprite.sayText("Goodbye!") | ||
``` | ||
|
||
## Too fast! | ||
|
||
Is the sprite saying your facts too quickly? | ||
|
||
- Add a | ||
``||loops:pause (100) ms||`` | ||
block after any | ||
``||sprites(noclick):say||`` | ||
block that goes too quickly. | ||
- Adjust the length of the pause by changing the value | ||
in the ``||loops(noclick):pause||`` block. | ||
|
||
```blocks | ||
scene.setBackgroundColor(7) | ||
let mySprite = sprites.create(img` | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . . . . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
`, SpriteKind.Player) | ||
mySprite.sayText("My name and grade") | ||
pause(1000) | ||
mySprite.sayText("Fact #1") | ||
pause(1000) | ||
mySprite.sayText("Fact #2") | ||
pause(1000) | ||
mySprite.sayText("Fact #3") | ||
pause(1000) | ||
mySprite.sayText("Goodbye!") | ||
``` | ||
|
||
## Whoops! Wrong spot! | ||
|
||
Let's move your avatar elsewhere on the screen. | ||
|
||
- Using the coordinate system that you learned in Lab 0.5, | ||
move the sprite to a different location on the screen. | ||
- Use a block in the ``||sprites:Sprites||`` drawer to do so. | ||
- Be sure to place the block in the correct place. | ||
Where does it need to go? | ||
|
||
View the hint by selecting the light bulb below | ||
if you need to see an example of the code that you are building. | ||
|
||
```blocks | ||
scene.setBackgroundColor(7) | ||
let mySprite = sprites.create(img` | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . 5 5 5 5 5 5 5 5 5 5 . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . 5 5 5 5 5 5 5 5 . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . 5 5 5 5 5 5 . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . 5 5 5 5 . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . . . . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
. . . . . . . 5 5 . . . . . . . | ||
`, SpriteKind.Player) | ||
// @highlight | ||
mySprite.setPosition(80, 60) | ||
mySprite.sayText("My name and grade") | ||
pause(1000) | ||
mySprite.sayText("Fact #1") | ||
pause(1000) | ||
mySprite.sayText("Fact #2") | ||
pause(1000) | ||
mySprite.sayText("Fact #3") | ||
pause(1000) | ||
mySprite.sayText("Goodbye!") | ||
``` | ||
|
||
## Congratulations! @showdialog | ||
|
||
If there is time left, you can add more actions to your program! | ||
|
||
Here are some ideas. | ||
|
||
- Instead of just appearing in a different position on the screen, | ||
have the sprite move smoothly. | ||
- Add a second sprite which also talks to the player. | ||
- Make the sprite only talk when the player hits a button. | ||
|
||
Follow your instructor's directions to submit your project. | ||
|
||
```ghost | ||
scene.setBackgroundColor(7) | ||
let mySprite = sprites.create(sprites.builtin.cat0, SpriteKind.Player) | ||
mySprite.sayText("My name and grade") | ||
mySprite.sayText("Fact #1") | ||
mySprite.sayText("Fact #2") | ||
mySprite.sayText("Fact #3") | ||
mySprite.sayText("Goodbye!") | ||
mySprite.setPosition(80, 60) | ||
``` |
Oops, something went wrong.