My Account Log in

1 option

Learning GDScript by Developing a Game with Godot 4 : A Fun Introduction to Programming in GDScript 2. 0 and Game Development Using the Godot Engine.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Vanhove, Sander, author.
Language:
English
Subjects (All):
Video games--Development.
Video games.
Video games--Programming.
Physical Description:
1 online resource (0 pages)
Edition:
1st ed.
Distribution:
London : Bloomsbury Publishing (UK), 2025.
Place of Publication:
Birmingham : Packt Publishing, 2024.
System Details:
text file HTML
Summary:
Learn the Godot 4 game engine and GDScript 2.0 as you build your own game and transform into a proficient programmer with this illustrated guide Key Features Learn the fundamentals of programming as you write GDScript 2.0 Explore the world of GDScript 2.0 with this comprehensive introduction to the language Work with Godot 4's robust features and built-in tools to create captivating 2D and 3D games, simulations, and interactive applications Purchase of the print or Kindle book includes a free PDF eBook Book Description In the digital landscape driven by interactive experiences, the demand for creative individuals with the skills to create captivating games has never been higher. Written by Sander Vanhove, a seasoned game developer with over 20 games to his credit, this book will serve as your entry point into game development, showing you how to leverage the powerful features of the open-source, versatile GDScript 2.0 to develop your ideas, from simple platformers to complex RPGs. Whether you're an aspiring game developer, a hobbyist seeking a creative outlet, or simply someone intrigued by the world of game programming, this book will guide you through the intricacies of the Godot 4 game engine. Starting with a primer on the fundamentals of programming, you'll cover everything from data to logic, while familiarizing yourself with Godot's built-in tools such as the physics engine, navigation, and cameras. As you progress, you'll unlock deeper insights into more advanced tools that will take your programming to the next level. Aided by easy-to-follow step-by-step tutorials, examples, exercises, and experiments, you'll seamlessly integrate this newfound knowledge to create a Vampire Survivor-like game from scratch. By the end of this book, you'll have become proficient in leveraging the Godot 4 game engine to bring your gaming visions to life. What you will learn Develop your GDScript 2.0 programming skills from basic to advanced, emphasizing code cleanliness Harness Godot 4's integrated physics engine to control and manipulate in-game objects Design a vibrant and immersive game world by seamlessly integrating a diverse array of assets Master the art of processing input from various sources for enhanced interactivity Extend the reach of your game by learning how to export it to multiple platforms Incorporate simple multiplayer functionality for a dynamic gaming experience Who this book is for This book is for programmers, game designers, game developers, and game artists who want to start creating games in Godot 4. If you're new to coding or game development, looking for a new creative outlet, and want to give Godot 4 and GDScript 2.0 a try, this book is for you. While no prior knowledge of programming or Godot is required, this book gradually introduces more complex concepts as you advance through the chapters.
Contents:
Cover
Title page
Copyright and credits
Dedication
Contributors
Table of Contents
Preface
Part 1: Learning How to Program
Chapter 1: Setting Up the Environment
Technical requirements
Godot game engine and open-source software
Some background on the engine
What is open-source software?
Getting and preparing Godot
Downloading the engine
Creating a new project
Light mode
Creating the main scene
A brief UI overview
Writing our first script
The Godot Engine Documentation
Join our community!
Summary
Quiz time
Chapter 2: Getting Familiar with Variables and Control Flow
What are variables?
Variables - Drawers in a filing cabinet full of data
Naming variables
Variables in GDScript
Printing out variables
Changing a variable's value
Mathematical operators
Other assignment operators
Data types - Integers, floats, and strings
Integers
Floats
Strings
What are constants?
Constants in GDScript
Magic numbers
Creating new scenes
Getting started with control flow
The if statement
The if-else statement
The elif statement
Commenting in code
Indentation
Boolean logic
The match statement
The ternary-if statement
Additional exercises - Sharpening the axe
Chapter 3: Grouping Information in Arrays, Loops, and Dictionaries
Arrays
Creating an array
Accessing values
Accessing elements backward
Changing the elements of an array
Data types in arrays
Strings are secretly arrays
Manipulating arrays
Don't be scared of errors or warnings
Loops
For loops
While loops
Continuing or breaking a loop
Dictionaries
Creating a dictionary
Data types in dictionaries
Accessing and changing values.
Creating a new key-value pair
Useful functions
Looping through dictionaries
Nested loops
Null
Chapter 4: Bringing Structure with Methods and Classes
Methods are reusable bits of code
What is a function?
Defining a function
Naming a function
The return keyword
The pass keyword
Optional parameters
Classes group code and data together
Defining a class
Instancing a class
Naming a class
Extending a class
Each script is a class!
When are certain variables available?
The scope of a function
Types help us to know how to use a variable
What is type hinting?
Type hinting variables
Type hinting arrays
Learning about the Variant type
Type hinting function parameters
Type hinting function returns
Using void as a function return
Inferred types
null can be any type
Autocompletion
Using type hinting for named classes
Performance
Editor adding type hints
OOP primer
Inheritance
Abstraction
Encapsulation
Polymorphism
Chapter 5: How and Why to Keep Your Code Clean
Back to naming things
Naming conventions
General naming tips
Public and private class members
Make short functions
DRY
Do one thing (KISS)
Defensive programming
Programming style guides
White spacing
Blank lines
Line length
Utilizing the documentation
Accessing a class's documentation
Directly accessing a function or variable's documentation
Going to the definition of a function or variable
Searching the documentation
Accessing the online documentation
Part 2: Making a Game in Godot Engine.
Chapter 6: Creating a World of Your Own in Godot
Game design
Genre
Mechanics
Story
Creating a player character
Adding a sprite
Displaying health
Manipulating nodes in the editor
Creating the player script
Referencing nodes in a script
Caching node references
Trying out the player script
Exporting variables to the editor
Setters and getters
Changing values while the game is running
Different types of exported variables
Creating a little world
Changing the background color
Adding Polygon2D boulders
Node drawing order
Creating an outer wall
Getting creative
Chapter 7: Making the Character Move
Vector math refresher
The 2D coordinate system
What is a vector?
Scaling vectors
Adding and subtracting vectors
More vector operations
Moving the player character
Changing the current player node
Applying forces to the player
Process and physics process functions
Mapping input
Using the input
Smoothing out the movement
Debugging a running game
Breakpoints
Remote tree
Chapter 8: Splitting and Reusing Scenes
Saving a branch as a new scene
Creating a separate player scene
The root node of a scene
Using saved scenes
Organizing scene files
Additional exercises - Sharepening the axe
Chapter 9: Cameras, Collisions, and Collectibles
Making a camera that follows the player
Setting up a basic camera
Adding drag margins
Making the camera look ahead
Smoothing out the look ahead
Collisions
The different physics bodies
The Area2D node.
Adding a collision shape to the player node
Creating static bodies for the boulders
Creating static bodies for the walls
Creating collectibles
Creating the base collectible scene
Inheriting from a base scene
Connecting to a signal
Writing the code for collectibles
Using collision layers and masks
Your turn!
Chapter 10: Creating Menus, Making Enemies, and Using Autoloads
Creating a menu
Control nodes
Creating a basic start menu
Setting the main scene
Making enemies
Constructing the base scene
Navigating enemies
Writing the enemy script
Damaging the player in a collision
Spawning enemies and collectibles
Making a Game Over screen
Shooting projectiles
Creating the base scene
Writing the logic of the projectile
Spawning projectiles
Storing highscores in autoloads
Using an autoload
Creating a HighscoreManager autoload
Autoloads in the remote tree
Adding a UI in the main menu and game scene
Using the highscore in the main menu
Chapter 11: Playing Together with Multiplayer
A crash course in computer networking
What is a Transport Layer?
What is an Application Layer?
Networking in Godot Engine
Learning about IP addresses
Using port numbers
Setting up the base networking code
Creating the client-server connection
Adding UI
Running multiple debug instances at the same time
Synchronizing different clients
Updating the player scene for multiplayer
Synchronizing EntitySpawner
Synchronizing the enemy and collectibles
Synchronizing the projectile
Fixing the timer and end game
Synchronizing the timer.
Synchronizing the end of the game
Running the game on multiple computers
Showing the IP address of the server
Connecting from another computer
Part 3: Deepening Our Knowledge
Chapter 12: Exporting to Multiple Platforms
Exporting for Windows, Mac, and Linux
Downloading the export template
Making the actual exports of the game
Uploading our game to Itch.io
What is Itch.io?
Exporting our game to the web
Uploading to Itch.io
Exporting our game to other platforms
Mobile platforms
Consoles
Chapter 13: OOP Continued and Advanced Topics
The super keyword
Static variables and functions
Enumerations
Lambda functions
Creating a lambda function
Where to use lambda functions
Passing parameters by value or reference
Passing by value
Passing by reference
The @tool annotation
Chapter 14: Advanced Programming Patterns
What are programming patterns?
Exploring the Event Bus
The problem
The solution
Understanding Object Pooling
Implementing the Object Pool in our game
Working with State Machines
An example state
Chapter 15: Using the File System
What is the file system?
File paths
User path
Creating a save system
Writing data to the disk
Reading data from disk
Preparing the save manager for use in the game
Adjusting the game to use the save manager
Having a look at the save file
Chapter 16: What Next?
Ideas for your next projects
Starting a new project.
Extending the survivor-like game.
ISBN:
9781801812498
1801812497
OCLC:
1430975485

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account