- Godot Engine Game Development Projects
- Chris Bradfield
- 246字
- 2021-06-18 18:51:26
Sprite animation
With Area2D, you can detect when other objects overlap or run into the player, but Area2D doesn't have an appearance on its own, so click on the Player node and add an AnimatedSprite node as a child. The AnimatedSprite will handle the appearance and animations for your player. Note that there is a warning symbol next to the node. An AnimatedSprite requires a SpriteFrames resource, which contains the animation(s) it can display. To create one, find the Frames property in the Inspector and click <null> | New SpriteFrames:

Next, in the same location, click <SpriteFrames> to open the SpriteFrames panel:

On the left is a list of animations. Click the default one and rename it to run. Then, click the Add button and create a second animation named idle and a third named hurt.
In the FileSystem dock on the left, find the run, idle, and hurt player images and drag them into the corresponding animations:

Each animation has a default speed setting of 5 frames per second. This is a little too slow, so click on each of the animations and set the Speed (FPS) setting to 8. In the Inspector, check On next to the Playing property and choose an Animation to see the animations in action:

Later, you'll write code to select between these animations, depending on what the player is doing. But first, you need to finish setting up the player's nodes.
- Hadoop 2.x Administration Cookbook
- 機器人智能運動規劃技術
- 電腦上網直通車
- Security Automation with Ansible 2
- 大數據挑戰與NoSQL數據庫技術
- 現代機械運動控制技術
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 西門子變頻器技術入門及實踐
- LMMS:A Complete Guide to Dance Music Production Beginner's Guide
- 數字多媒體技術基礎
- 深度學習原理與 TensorFlow實踐
- Practical AWS Networking
- 從機器學習到無人駕駛
- 單片機硬件接口電路及實例解析
- 亮劍.NET:圖解ASP.NET網站開發實戰