[Hands with you Godot game development] FlappyBird: 4.1 infinite ground of Godot Youth (AnimationPlayer) version

This section renderings

Here Insert Picture Description

Foreword

Why is this version called Godot version of it? Because if unity and other small engine to achieve this function, we may not choose its animation system, not to say that other engines can not, is too much trouble, I would prefer to write two lines of code to implement. The Godot Engine animation system is so convenient, so by the time Godot development of the game, we might as well take advantage of it.

step

Copy a "Floor" and the two "Floor" named "Floor_1" and "Floor_2"

Here Insert Picture Description

Add a AnimationPlayernote: "Floor_1" and "Floor_2" share a AnimationPlayercan.

Here Insert Picture Description
In the "AnimationPlayer" animation add a "scroll" called, and by the way "open loop 'and the total animation length tentatively 60, the process is slightly

Here Insert Picture Description

Interpolated frames

Then review the method of interpolation frame
cursor 1. First time axis to the desired position
2. In the scene tree selected nodes to the interpolation frame, the eyes move in the Properties panel on the attribute values require adjustment of the interpolated frame
3. Then click next to the property "key (interpolation frame) flag"

Here Insert Picture Description

The origin of 512.33 512.33 ≈ 530 - 530/30

Here Insert Picture Description

Note: "Floor_1" and "Floor_2" The two key frames from the far left to the far right of the jump to be set to "teleport"

Here Insert Picture Description
Then look to the results obtained in FIG.

Here Insert Picture Description

Published 351 original articles · won praise 635 · views 130 000 +

Guess you like

Origin blog.csdn.net/hello_tute/article/details/104709354