Statement

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Statement

A statement is a unit of code that represents an instruction or an action for the computer to perform. For example, in GDScript, a line defining a variable or a function is a statement. A line that creates an if block is a statement, and so is a line that calls a function.

It's different from expressions, which are units of code that output a value. A statement is a more generic concept.

In the GDScript code below, each line is a statement:

var health := 100
func heal():
    health += 10
    if health > 100:
        health = 100

So, when you read something like "an if statement" or "a return statement", the author is talking about a specific type of instruction or action. Respectively, if condition: and return in the example above.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!