Sculpting an Emoji
Adding an Emoji
If we want an interesting story, we need to have some characters.
These characters are going to be Emojis.
Add this code below
emoji1 = Emoji('laughing') newScene.addEmoji(emoji1)
Your code should now look like this:
This will add a laughing emoji to the Scene, but executing the code will not show anything. This is because there aren’t any Actions included in the Scene.
Moving Your Emoji
A Scene contains a series of Actions which are executed one-after-another. There are a few different Actions we’ll go over today, the first of which is
Let’s add an
ActionWaitto the Scene so we can see what’s happening (below
ActionWaitcauses the Scene to be paused for a bit.
Want to make the wait longer? Adjust the
ActionWait(1000)to another amount.
1000represents 1000 milliseconds, which is equivalent to 1 second. So, for example, if you wanted 1.5 seconds you could change
Each Emoji has their own position, (x,y) - how far along the x-axis it is, and how far along the y-axis it is.
When you create an Emoji, it starts at
(0,0)by default. We can change this by giving our own position:
emoji1 = Emoji('laughing', Vector2(100, 200))
The Emoji should now start at the position
The screen’s total size is
(480,480). This will be useful when moving Emojis!
Now we understand how to add one Emoji to our Scene, it’s easy to add more.
Add this below
emoji2 = Emoji('shocked', Vector2(300, 200)) newScene.addEmoji(emoji2)
You should now see a shocked emoji in the Scene as well.
There are a few different emojis included for you to use, including:
There’s a reference page here with the full list
Nothing working? Your code should look like this by now: