Skip to main content

Questions tagged [oop]

Object-oriented programming. A paradigm using objects (instances of a class consisting of properties and methods) to design games. Techniques may include data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

What is the neatest way in a strict OOP language (c++ say) to avoid the following circular dependency. Imagine I create a character class and a world class. A character requests data from the world to ...
BadUsername's user avatar
0 votes
0 answers
89 views

I have created a dynamic library that contains all the tools I want my game executable to have. Additionally, I want to create a world editor/tools for my engine to be more user-friendly. I'm ...
Benzait Sofiane's user avatar
1 vote
0 answers
144 views

I am learning about networking for game development and need some insight. My knowledge of Unreal Engine is that it uses RPCs and replicated variables for actors. I also know that Unity has Networked ...
Gus Funder's user avatar
0 votes
0 answers
89 views

If I'm making a small library for handling 2D shapes, should polymorphism generally be avoided? I know that it can worsen performance but it's not like polymorphism is never used in game development ...
JensB's user avatar
  • 157
0 votes
2 answers
114 views

I have three classes Location, Item, Character. Every ...
Michael Moreno's user avatar
1 vote
1 answer
406 views

It does not seem like a good idea to include this functionality in the game logic like that even if the concrete implementation of the sound or graphics effect is abstracted away. Ideally, the game ...
codymanix's user avatar
  • 394
0 votes
1 answer
113 views

I want to be able to render sf::CircleShape (representing pointwise charges) when pressing mouse buttons on the window. The problem is easy enough, however the ...
user avatar
0 votes
1 answer
200 views

i have made this bullet class but i have a problem with the firerate. Sometimes i'm not able to shoot even when the little delay (700ms) between the two shots has ended. I guess it's due to the ...
Salem's user avatar
  • 226
0 votes
1 answer
87 views

I'm making this 2d collecting game in Unity where you collect fish. However I can't get them to face the direction they are going. I've asked on some Discords and got no answer. Thanks in advance. ...
Ratman's user avatar
  • 1
0 votes
2 answers
693 views

If I have a class called Enemy: // Simplified version class Enemy { float xPosition_; float yPosition_; int hp_; }; Should this class also contain the ...
JensB's user avatar
  • 157
0 votes
0 answers
92 views

I'm trying to make different behaviours for workers of different buildings, let's say an agricultural worker would need to sow wheat seed and collect the wheat grain when it's grown. let's call that <...
MilitaryG's user avatar
2 votes
0 answers
171 views

I'm writing a simple physics based game in C++ using SFML. I want to trigger a scene change when my playerCharacter collides with a door. Since C++ does not have any native Event Sender/Listener ...
john_shreds's user avatar
0 votes
1 answer
105 views

I have three types of UI buttons that go on a cooldown bar: A traditional cooldown bar button where once the corresponding key is pressed, a timer shows over the button and dims the texture. A button ...
Thisisstackoverflow's user avatar
0 votes
0 answers
53 views

I've been stuck doing this in a very inefficient way and really want to know if there's some design pattern that solves this because it seems like a pretty common problem to have. I have a system ...
Taceo's user avatar
  • 1
1 vote
0 answers
649 views

I'm developing a small Java digital card game project. In my game, players can perform skills when using cards. Each skill does different things, like deal damage, heal etc.. I'm looking for a way to ...
uchi23's user avatar
  • 11
0 votes
1 answer
2k views

I am making a game with SDL and C++. I am trying to render simple image to the screen but I can't. I am not getting any error but I see only black screen. I think because the renderer in ...
younlok's user avatar
  • 19
2 votes
2 answers
4k views

I’m writing a render, there is a class that shaders should store, something like a shader manager. These shaders are stored as ...
Денис Ковешников's user avatar
0 votes
2 answers
106 views

I am coding an interaction system in Unity that does things based on whether the player taps interaction, or holds interaction. Each object holds their own scripts of how a player can interact with ...
Visulth's user avatar
  • 107
2 votes
1 answer
164 views

So I've been making a 2D grid and pathfinder using SFML. Now I ran into a problem. I've been making a vector for the path nodes. ...
Yamarai Akizuki's user avatar
0 votes
1 answer
2k views

Im trying to figure out how to use pointers to make a single instance of an object that in this example will just change direction on x-axis. Splav.h (eng. Paddle.h) ...
Marko Petričević's user avatar
38 votes
8 answers
19k views

I prefer OOP features when developing games with Unity. I usually create a base class (mostly abstracted) and use object inheritance to share the same functionality to the various other objects. ...
modernator's user avatar
  • 1,223
0 votes
1 answer
2k views

I have some hard question for me... I have a nice EventManager, who handle multiple arguments. (no argument, one int, one bool, a GameObject and a bool... but for each sort, I have to create a special ...
Ugo Hed's user avatar
  • 281
1 vote
1 answer
431 views

In a class called Sprite.h my teacher asked this question which I don't fully understand. A generic interface has to include an engine specific header in order to expose different sprites. This ...
Steffen Jorgensen's user avatar
1 vote
1 answer
1k views

I have two classes Circle and Square which derive from an abstract base class Shape. A <...
Edward's user avatar
  • 63
1 vote
0 answers
50 views

Hi I have a serious problem here, When I generate my tile map from an array with numbers [0,4, ...] (0 > for air, 4 for solid) inside of generateWorld()... the ...
vincent thorpe's user avatar