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

Node setup

Create a new scene and add a node named Main. To add the player to the scene, click the Instance button and select your saved Player.tscn:

Now, add the following nodes as children of Main, naming them as follows:

  • TextureRect (named Background)—for the background image
  • Node (named CoinContainer)—to hold all the coins
  • Position2D (named PlayerStart)—to mark the starting position of the Player
  • Timer (named GameTimer)—to track the time limit

Make sure Background is the first child node. Nodes are drawn in the order shown, so the background will be behind the player in this case. Add an image to the Background node by dragging the grass.jpg image from the assets folder into the Texture property. Change the Stretch Mode to Tile and then click Layout | Full Rect to size the frame to the size of the screen, as shown in the following screenshot:

Set the Position of the PlayerStart node to (240, 350).

Your scene layout should look like this:

主站蜘蛛池模板: 新绛县| 方正县| 湘潭市| 紫阳县| 柘城县| 琼中| 确山县| 永靖县| 闻喜县| 繁昌县| 军事| 昌乐县| 石屏县| 鄂托克旗| 射洪县| 崇文区| 靖宇县| 平湖市| 大悟县| 攀枝花市| 石嘴山市| 连云港市| 万州区| 静安区| 砀山县| 利辛县| 九台市| 仁化县| 屏南县| 龙海市| 宜兰市| 桂平市| 昌邑市| 博客| 安化县| 绥芬河市| 偏关县| 镇巴县| 集贤县| 手游| 济宁市|