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

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:

主站蜘蛛池模板: 龙川县| 个旧市| 错那县| 安吉县| 礼泉县| 广德县| 黔西| 武川县| 蒙山县| 西林县| 星座| 清流县| 始兴县| 南丹县| 隆安县| 县级市| 巩留县| 武胜县| 驻马店市| 方城县| 呼和浩特市| 宁乡县| 诸暨市| 宁明县| 普兰县| 金溪县| 搜索| 淳安县| 邵武市| 长阳| 龙南县| 宁晋县| 温泉县| 墨玉县| 常宁市| 彭山县| 岳池县| 台湾省| 大冶市| 扎囊县| 年辖:市辖区|