官术网_书友最值得收藏!

Node setup

Click Scene | New Scene and add the following nodes. Don't forget to set the children to not be selected, like you did with the Player scene:

  • Area2D (named Coin)
  • AnimatedSprite
  • CollisionShape2D

Make sure to save the scene once you've added the nodes.

Set up the AnimatedSprite like you did in the Player scene. This time, you only have one animation: a shine/sparkle effect that makes the coin look less flat and boring. Add all the frames and set the Speed (FPS) to 12. The images are a little too large, so set the Scale of AnimatedSprite to (0.5, 0.5). In the CollisionShape2D, use a CircleShape2D and size it to cover the coin image. Don't forget: never use the scale handles when sizing a collision shape. The circle shape has a single handle that adjusts the circle's radius.

主站蜘蛛池模板: 阜平县| 彭泽县| 白河县| 南通市| 江西省| 新竹市| 蓬莱市| 益阳市| 辽中县| 马边| 龙胜| 赤峰市| 青铜峡市| 襄汾县| 柳州市| 洞口县| 黑山县| 连平县| 怀化市| 晋宁县| 吴川市| 井冈山市| 商洛市| 浙江省| 长治县| 峨眉山市| 漳州市| 尼勒克县| 漳平市| 江源县| 屏东县| 福建省| 湟源县| 团风县| 昭平县| 双江| 五指山市| 上高县| 类乌齐县| 富平县| 班玛县|