Object-Oriented Programming Role-Playing Game Winning Nakov's Handshake Svetlin Nakov Technical Trainer www.nakov.com Software University http://softuni.bg Table of Contents 1. What's an RPG game? 2. Game components Game Objects Game Engine Drawing Engine 2 What's a Role-Playing Game? Role-Playing Game A Role-Playing Game (RPG) is a game where the player assumes control of a character in a fantasy world Characters in the world interact with one another in several ways E.g. talking, fighting, casting spells, doing quests There are various other objects such as items, buildings, computer-controlled units (NPCs) Players aim to level up, acquire items, complete quests, etc. Game Components Game Object Hierarchy Game Object Hierarchy A hierarchy that models the object world of the game Classes represent game objects Each object holds its own data and behavior Exists independently from any other game components (engine, UI, Input interface, etc.) 6 Class Structure – Example 7 Game Engine The game engine processes the game flow What game flow? Processing player input Creating objects (players, enemies, items, events, etc.) Handling object interactions, collision and other game logic In order to do all this, the game engine enters the so called "game loop" Infinite loop with a set interval between each iteration Updates the state of the game 8 Drawing Engine (UI) Draws graphics to the user interface Knows only how to draw on the screen Adding objects Removing objects Redrawing existing objects Is not concerned with any game logic Called by the game engine when drawing needs to be done Collects the user input (mouse / keyboard / joystick / touch) 9 Creating an RPG from Scratch Live Demo Role-Playing Game ? https://softuni.bg/trainings/coursesinstances/details/8 License This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons AttributionNonCommercial-ShareAlike 4.0 International" license Attribution: this work may contain portions from "OOP" course by Telerik Academy under CC-BY-NC-SA license 12 SoftUni Diamond Partners Free Trainings @ Software University Software University Foundation – softuni.org Software University – High-Quality Education, Profession and Job for Software Developers softuni.bg Software University @ Facebook facebook.com/SoftwareUniversity Software University @ YouTube youtube.com/SoftwareUniversity Software University Forums – forum.softuni.bg
© Copyright 2026 Paperzz