Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Godot Engine Game Development Projects

You're reading from   Godot Engine Game Development Projects Build five cross-platform 2D and 3D games with Godot 3.0

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781788831505
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Chris Bradfield Chris Bradfield
Author Profile Icon Chris Bradfield
Chris Bradfield
Arrow right icon
View More author details
Toc

Part 3 – Main scene

The Main scene is what ties all the pieces of the game together. It will manage the player, the coins, the timer, and the other pieces of the game.

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...

You have been reading a chapter from
Godot Engine Game Development Projects
Published in: Jun 2018
Publisher: Packt
ISBN-13: 9781788831505
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime