- Godot Engine Game Development Projects
- Chris Bradfield
- 183字
- 2021-06-18 18:51:32
Coin animation
When you created the Coin scene, you added an AnimatedSprite, but it isn't playing yet. The coin animation displays a shimmer effect traveling across the face of the coin. If all the coins display this at the same time, it will look too regular, so each coin needs a small random delay in its animation.
First, click on the AnimatedSprite and then on the Frames resource. Make sure Loop is set to Off and that Speed is set to 12.
Add a Timer node to the Coin scene, and add this code to _ready():
$Timer.wait_time = rand_range(3, 8)
$Timer.start()
Now, connect the timeout() signal from the Timer and add this:
func _on_Timer_timeout():
$AnimatedSprite.frame = 0
$AnimatedSprite.play()
Try running the game and watching for the coins to animate. It's a nice visual effect for a very small amount of effort. You'll notice a lot of effects like this in professional games. Though very subtle, the visual appeal makes for a much more pleasing experience.
The preceding Powerup object has a similar animation that you can add in the same manner.
- 繪制進(jìn)程圖:可視化D++語言(第1冊(cè))
- Instant Raspberry Pi Gaming
- Design for the Future
- 面向STEM的mBlock智能機(jī)器人創(chuàng)新課程
- Hands-On Artificial Intelligence on Amazon Web Services
- 人工免疫算法改進(jìn)及其應(yīng)用
- TIBCO Spotfire:A Comprehensive Primer(Second Edition)
- 小型電動(dòng)機(jī)實(shí)用設(shè)計(jì)手冊(cè)
- 人工智能與人工生命
- Nginx高性能Web服務(wù)器詳解
- 工業(yè)機(jī)器人運(yùn)動(dòng)仿真編程實(shí)踐:基于Android和OpenGL
- Windows Server 2003系統(tǒng)安全管理
- Photoshop行業(yè)應(yīng)用基礎(chǔ)
- Redash v5 Quick Start Guide
- 樂高創(chuàng)意機(jī)器人教程(中級(jí) 上冊(cè) 10~16歲) (青少年iCAN+創(chuàng)新創(chuàng)意實(shí)踐指導(dǎo)叢書)