3D - An Alien Dance Party (Difficulty: 1)
-
Key Topics Covered
- Initializing 3D scenes
- Using avatars
- Avatar animations
- Camera configuration
- Copying Objects
- Playing drums
- Updating object color
Introduction
In this tutorial, we’ll have some fun playing with dancing aliens:
Step 1 - Initialize A “Grass Land” Scene with 3D Axes
Please create a new project, and remove the dog sprite. In the “Empty1” sprite, add the green-flag block, the “initialize 3D scene” block, and the “add 3D axis” block. Note that you need to click the input box and choose the “Grass Land” scene. This is a lightweight scene with a large grassland and a blue sky.
As shown, the X-axis points to the right, the Y-axis points forward (into the screen), and the Z-axis points up. You can drag your mouse on the stage to rotate the camera around it:
Step 2 - Add an alien avatar
Avatars are human-like models that can perform various kinds of animations. Here is how to add an alien avatar:
Step 3 - Teach the alien to dance
The alien avatar only knows how to “idle”. We need to “teach” it how to do some dancing animations by “adding animations” to it. Here is how to browse through the animations and add the “Breakdance Ready Dance” animation.
Step 4 - Start the dance
Now after adding the dance animation, we can start the animation at any time. By default, the animation will restart after it completes one round, so it will keep going repeatedly.
Step 5 - Better position for the camera
Since the alien is facing forward and it is quite small, we can move the camera to watch in front of the alien. We can set the distance and angle of the camera using this block:
Step 6 - Copy and Move
Next, let’s add another alien avatar. We can make a copy of it, and choose to share the data between these 2 avatars. This will make your program run faster, since all the avatars will reuse the same color and animation data.
We also need to move the copied avatar to a different position, otherwise, it will overlap with the original avatar.
Now we have 2 avatars that are dancing side by side:
Step 7 - A Third Alien
Next, can you try to add another alien like this?
Here is one way to do it. We just need to set its X to -100 instead of 100.
Step 8 - Dancing Beats
Our dance party is still missing some dancing beats. We can add some drum beats to match the alien’s movement:
Step 9 - Change Eye Colors
Lastly, let’s make the aliens blink with red eyes:
To make the eyes change color, you need to use the “update color” block, and select the “second” area, which represents the eyes of the avatars.
In the forever loop, we can switch the eye color between black and red in between the drum beats:
Here is the final program for your reference.
Creative Ideas
There are many ways you can extend this project. Here are some ideas for your inspiration:
-
Changing Body Colors: you can try to change the alien’s body color randomly on each step.
-
More Aliens: you can try to add much more avatars, and move/rotate them to form an interesting formation.
-
Make a New Scene: you can switch to a new scene and create something more interesting. For example, this scene looks like the 2 aliens are arguing about whether to eat pizza:
-
-
@info-creaticode you should play ultrakill