Sonic. Move the boss.

Preface.

Surely, when you got to the boss in Simple Sonic Worlds, you were wondering what kind of objects they are?

Well, let’s find out.

Why do we need these tags?

These labels indicate the location to which the boss will move. The move is carried out due to the Easing Object set at the level.

Understanding the boss code.

Now, let’s look at the boss code. To do this, press Ctrl+L, and open the Boss 1 group.

And go down.

This line moves the boss to the coordinates of the orange label, for 60 frames. If you specify more frames, the movement will slow down.

The rest of the lines are responsible for the timer and for switching actions. They’re all similar, so I’ll briefly explain how they work.

How the timer works.

Each frame, increase the timer by 1 (timer is an integer variable).

If the timer is more than 60 (60 frames = 1 second), then reset the timer, and proceed to the next action (Action+ 1).

When the last action is performed, proceed to the initial action, thereby looping the process.

Now, let’s change the path of the standard boss by adding a 3rd label.

Change the way of the boss.

Let’s make it so that the boss moves not on the 2nd mark, but on the 3rd.

First, create a 3rd label by bending any other label, or by creating an active object.

Next, move the boss to a new label. To do this, make a duplicate of the Move Left group.

Since we have 3 labels, then the same 3 actions. Rewrite the code for our action, and move the boss to the green mark.

After the 3rd act there is the 1st.

It remains to change action 2.

Instead of returning to the first act, there is a transition to the 3rd.

Done, now the boss path is changed.

Conclusion.

In this article, I briefly talked about the Easing Object. Thanks to it, you can easily set the movement of objects on the stage. A similar object, I used extensively in my boss.

Final result.

Пожалуйста отключи блокировщик рекламы, или внеси сайт в белый список!

Please disable your adblocker or whitelist this site!