-
Notifications
You must be signed in to change notification settings - Fork 0
Project Setup
The project is built upon the Godot engine, version 4.3, available here. We cannot use the .NET version to export the game into web support (required for the project's submission on itch.io.
Since we C# is not supported on the standard version of Godot, scripts will be written using the engine's own language, GDscript. The language is heavily inspired by C#, but is tailored for the engine's features and game development.
However, its syntax looks a bit more like what we find in Python programming. That said, here's a quick style guide for how variables, functions and properties are named and declared.
Snakecases is the convention for coding when using Godot (in GDScript, but in C# as well).
# DECLARATIONS ------------------------------------------------------
class_name StateMachine
extends Node
signal state_changed(previous, new)
# @export makes the variable visible in the inspector
@export var initial_state: Node
# For variables declaration, var is used instead of types
var my_float = 0.0
var my_int = 0
var my_bool = false
# However, we can force a type for a variable like this
var my_float: float = 0.0
# We can even make it less wordy
var my_float := 0.0
# @onready is similar to the .GetComponent<>() function in Unity
@onready var my_camera: Camera3D = $MainCamera
# FUNCTIONS ---------------------------------------------------------
# This triggers before the _ready function
func _enter_tree():
print("hello")
# This triggers when the scene is launched
func _ready():
state_changed.connect(_on_state_changed)
_state.enter()
# Called every frame
func _process(delta):
_state.unhandled_input(event)
# Like _process, but for physics manipulation
func _physics_process(delta):
_state.physics_process(delta)
# Custom function
func set_state(value):
_state = value
_state_name = _state.nameFor the complete styling guide for GDScript, please refer to the online documentation available here.
The play screen must submit to the game jam’s guidelines. Since the theme is inspired by original GameBoy games, the resolution must fit the same screen as the vintage device.
From the rules: Keep the original GameBoy screen resolution of 160px x 144px. You are allowed to scale the viewport, but must keep the aspect ratio and square pixels.
Inside Godot, some changes were made in the project settings to ensure our game viewport respect the rules. All of those modifications take place in under the Display / Window tab.

Here’s the list of all properties that have been changed and what their effects on the game’s viewport:
| Properties | Description |
|---|---|
| Size / Viewport width | Width of the game’s screen. This matches the 160px width implies by the jam’s rules. |
| Size / Viewport Height | Height of the game’s screen. This matches the 144px height implies by the jam’s rules. |
| Size / Window Width Override | Width of the user’s windows. Advanced settings that force the window’s width by stretching the viewport. |
| Size / Window Height Override | Height of the user’s windows. Advanced settings that force the window’s height by stretching the viewport. |
| Stretch / Mode | Set viewport to always match the viewport’s initial resolution. |
| Stretch / Scale Mode | Set to integer since we are working with pixel arts. Pixels are using whole numbers. |
GBJAM-12-WIKI