@the_true_odst said in Maybe Creaticode knows the issue::
point towards mouse-pointer” is a bit buggy
We’ll look into that.
Forum wide moderators
@the_true_odst said in Maybe Creaticode knows the issue::
point towards mouse-pointer” is a bit buggy
We’ll look into that.
In that case, you can skip that whole process when you debug the issue since it is unrelated to the issue, right?
@attractive-milk @The_True_Odst
Thanks for the feedback. It appears to be an issue related to computer speed and network latency between the 2 of you.
We will give it more tests and try to improve the performance.
Can you pinpoint which block should trigger the “faded version” to appear? And does that block get to run or not?
You can try to use the “print to console” block at a few critical points to help you track the program flow.
Also, it is not clear why this project takes so long to load. Maybe you can make a copy of it, delete all sprites/code unrelated to the hanger, so that you can start it quickly as you debug.
How about increasing or decreasing the value with the scrolling wheel on the mouse?
Please try again. The issue should be resolved now.
The Sun is the center of the solar system, but many people do not know that the Sun itself is traveling across space at a very fast speed (about 137 miles per second!).
In this tutorial, you will learn to build a simulation of the solar system as it moves in space. It will be a good practice on a few key techniques, such as parenting, transformer node, glow layer and trail mesh.
Log into the CreatiCode playground, and create a new project. Remove the “Sprite1”, and rename the “Empty1” sprite to “Scene”. This sprite will be used as the starting point.
There is no 3D scene for the space. However, we can achieve that in 2 steps:
We can also add a 3D axis temporarily as we develop the program.
Here is the code:
This is what the stage looks like.
Note that the 3D axis looks quite small for now, since when the sky type is set to the starfield, the camera is zoomed out by default. This won’t be an issue, since we will add a new camera to replace it later.
The rest of the program will take 3 steps:
We can easily sequence these events using 3 messages like this:
Make sure you use “broadcast and wait” for the first 2 messages, so these 3 steps are taken one at a time.
Next, add a new empty sprite, and rename it to “Sun”. In that sprite, when it receives the “add sun” message, add a yellow sphere to represent the Sun:
Note that we are giving it the name of “sun”, so that we can select it later.
Since the Sun will be moving in the scene, we will use a “follow camera” to follow the Sun:
You can adjust the distance and angle of the camera as you wish. Set its direction lock to “free” so that the user can drag the pointer to change the view angle.
To make the Sun glow some yellow lights, we need to set its emission color to yellow (by default, it is black), and then add it to a “glow layer”.:
Now there is some glowing yellow light around the Sun:
To clearly show that the Sun is moving, we will give it a “tail” using the trail mesh:
The trail has the same color, and it is added to the default glow layer as well. We will see its effect once the Sun starts to move.
To test what we have so far, we can make the Sun move forward when it receives the “start” message. Don’t worry about the planets for now. Add this to the Sun sprite:
Note that we need to select the “sun” object first before setting it speed. This is because the active “sprite object” in this sprite is the trail of the sun, not the sun object, as we added the trail object after adding the sun object.
After this step, the Sun will be moving when we run the project, leaving a trail behind it:
Now let’s work on the Earth. Add a new sprite and name it “Earth”. In this sprite, when it receives the “add planets” message, add a smaller blue sphere and move it to the right along the X axis for 200 units:
Now we arrive at the most challenging question of the project: how to make the Earth moves together with the Sun, and also orbit around it?
An immediate answer is to use parenting. If we make the sun object the parent of the earth object, then as the sun moves, the earth object will move as well. Also, if we make the sun object spin around itself, the earth object will orbit around it.
However, there is one issue with this solution: the orbit speed of the earth object is determined by the spinning speed of the sun, so if we add the Mars later, it would orbit around the sun at the same speed.
The solution is to add another intermediate object to help with the orbiting movement. Let’s call it “earthparent”. So the “sun” will be the parent of “earthparent”, and “earthparent” will be the parent of the “earth” object:
After this step, the sun will make the earthparent and the earth move with it (we will add the orbiting behavior later).
We will apply the same code as the sun to make the earth object glow and add a trail to it:
Now we can clearly see both of the sun and the earth moving:
To make the earth object orbit, we just need to rotate the “earthparent” object:
Note that they are moving along the Y axis, so the rotation should be around the Y axis as well:
Since the code for Mars will be very similar, we will first duplicate the Earth sprite to a new sprite named “Mars”. Then we have to make a few changes:
With all these changes, now we have a complete simulation:
For some extra practice, here are some ideas to enhance this project:
We will investigate now. thanks for the heads up.
Maybe you can try these ideas?