IT-EDP118 Weeks • 3 Credit Units • Laboratory & Lecture

Event-Driven Programming with Godot Engine 4

A comprehensive collegiate curriculum exploring event-driven design patterns, game loops, scene trees, kinematic 2D physics, mobile viewport scaling, and GDScript 2.0 object-oriented game development.

Course Description & Architectural Focus

Event-Driven Programming (EDP) is the cornerstone of modern interactive software, graphical user interfaces (GUIs), and real-time game engines. Unlike traditional sequential programs that follow a rigid line-by-line flow from main entry to exit, event-driven architectures execute asynchronously in response to discrete internal or external stimuli—such as touchscreen taps, keyboard actuations, timer timeouts, network packets, or physical collision signals.

In this course, students utilize Godot Engine 4, an open-source, industry-standard 2D/3D game engine. Students learn how Godot's main loop synchronizes rendering cycles (_process) with deterministic, fixed-rate physics ticks (_physics_process at 60 Hz). Through structured laboratory assignments, students construct full 2D mobile platformer prototypes featuring custom kinematic physics, surface collision masks, animated sprites, and touch input emulation.

Semester Syllabus & Module Progression

Week 1 – 2: Core Foundations

Engine Setup, Viewport Stretch, & 2D Physics Layers

Project initialization, Vulkan Mobile vs Compatibility renderers, 1280×720 canvas_items stretch mode, touch emulation, StaticBody2D terrain, TextureRect tiling, CharacterBody2D assembly, and collision masks.

Week 3 – 4: GDScript Kinematics

Euler Gravity Integration & Kinematic Character Controllers

Frame-independent delta time, acceleration curves, jump impulse velocities, floor slope snapping, horizontal deceleration, and sprite animation state machines.

Week 5 – 7: Event Signals & Observer Pattern

Custom Signals, Area2D Trigger Volumes, & Collectibles

Decoupled system architecture via Godot signals. Connecting body_entered events, coin pickups, hazard death planes, and health UI meters without circular script dependencies.

Week 8 – 10: Mobile Touch Controls

Virtual Joysticks, Screen Touch Buttons, & Gesture Recognition

Designing on-screen virtual d-pads and jump buttons using TouchScreenButton, multi-touch event filtering, and responsive HUD anchoring across diverse smartphone aspect ratios.

Week 11 – 14: Game State & Data Persistence

Autoload Singletons, Scene Changing, & JSON File I/O

Managing global game state across levels using Autoloads, loading and saving high scores to user:// storage via FileAccess, and pause menus.

Week 15 – 18: Final Capstone Project

Complete 2D Mobile Game Deployment & Optimization

Texture atlas compression, audio bus management, particle effects, Android APK export templates, debug signing, and final academic project presentation.

Key Takeaway Engineering Concepts

Collision Layer vs Mask

Layer defines what channel an entity resides on. Mask defines what channels the entity actively queries. This 32-bit bitmask matrix avoids CPU-heavy collision false positives.

_physics_process vs _process

Graphics rendering fluctuates with monitor refresh rates (60, 120, 144Hz). Physics simulations must run at a fixed deterministic rate (60Hz) to prevent objects tunneling through walls.