Tagged Questions

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.

learn more… | top users | synonyms

1
vote
1answer
117 views

OOP design, keeping track of entities

First, I would like to say that I have no experience with this and am still getting my head around OOP, so if something is really obvious, just point it out :) I am designing a game and I am not sure ...
1
vote
1answer
124 views

Architecture to draw many different objects in OpenGL

I have some objects that I want to draw. I am not sure how I can create my architecture in a way where I can draw everything as fast as possible. As example: class MyObject { float[] vertices; ...
1
vote
2answers
77 views

Command Interface design for RTS

Commands may have different target type; like NONE, COORD, UNIT. Some example commands may be: Attack (target UNIT), Move (target COORD), AttackMove (target COORD), Stop (target NONE), UseAbility ...
1
vote
2answers
88 views

OOP Question for Team System

I'm not quite sure right how I should create my "Team System". Lets say I have 2 teams with 4 players in there. The teams are Team Blue and Team Red. A team knows the amount of its members, the amount ...
1
vote
1answer
140 views

Game development for high-school with C++ and OpenGL [closed]

I've been teaching high-school students (12th grade) game programming in the last 2 years. The way I did this till now, was first to give them "half made" classes (for Point, Polygon, etc.) and ...
0
votes
2answers
31 views

GameLogic Model as Property or Constants with lookup in other Models?

Basically imagine a game where the Player has a Weapon which has a BulletType/type of Bullet. Now Player, Weapon and Bullet are Models having properties and they would represent Instances in the ...
2
votes
2answers
95 views

Decoupling the entity from whatever controls it

In a lot of games the player can choose whether an entity will be controlled by the AI or by the player. For example in the game Little Fighter 2, the player can choose how many of a maximum of 8 ...
1
vote
2answers
123 views

Is it acceptable to mix simple physics logic with gameplay logic?

In my 2D game I have a PhysicsEngine class. It currently does two things: Called every frame to apply global forces on all entities (e.g. gravity). Called by the CollisionDetector to do the physics ...
3
votes
0answers
250 views

Why are god objects so common in game programming? [closed]

This is a bit of a philosophical question. Excuse me if it's out of place here. Most modern games developed in C++ use (or at least purport to use) an object-oriented approach. A common axiom of ...
0
votes
1answer
54 views

How to modify Game1.cs out of an object it contains? [closed]

Assuming I Have a List<SomeClass> myList; in my Game1-class. It also contains an object of SomeOtherClass otherClass;. How would I modify myList (Add/Remove) out of the otherClass's logic? Or in ...
3
votes
2answers
108 views

Should entities store other other entities that they spawned?

How should a game entity add another game entity to the game world? For example, an entity shooting a missile (which is another entity), means the new Missile will need to be added to the entities ...
5
votes
2answers
319 views

How to handle collisions without ugly conditionals and type checking?

(I asked a similar question, but this one is far more specific). How can I handle collisions without having to do a lot of type checking and if statements? People here suggested that when spotting a ...
-2
votes
2answers
110 views

How to avoid tons of `instanceof` in collision detection? [duplicate]

Consider a simple game with 4 kinds of entities: Robots, Dogs, Missiles, Walls. Here's a simple collision-detection mechanism in psuedocode: (I know, O(n^2). Irrelevant for this question). ...
0
votes
2answers
126 views

Updating entities in response to collisions - should this be in the collision-detection class or in the entity-updater class?

In a game I'm working on, there's a class responsible for collision detection. It's method detectCollisions(List<Entity> entities) is called from the main gameloop. The code to update the ...
1
vote
1answer
41 views

How should I handle a modelview stack with multiple shader programs involved?

I'm building a framework where each object has an associated program and each object has a 'draw' method. What is the best choice, to have a single modelview stack handled by a Renderer class or to ...
0
votes
1answer
90 views

How to store and use different AI behaviours

I'm coding a space shooter on three.js (WebGL) and since the game I'm doing is rather simple, plus I want to keep controll of the structure, I'm not using a game engine. I'm using oop classes and ...
0
votes
0answers
146 views

Big game in Flash - how to create levels structure

I'm building a game in Flash similar to the structure of Angry Birds or Cut the Rope (where there are a number of "rooms" and unique levels created within each "room"). The user gets through the game ...
0
votes
0answers
21 views

Component systems: No inheritance hierarchy at all, or a basic one? [duplicate]

(I asked a similar question, but it had more questions inside it and I feel it wasn't clear enough, so I'm opening a new one). Until recently I implemented all my games using an inheritance ...
7
votes
3answers
250 views

How do AI agents access information about their environment?

This might be kind of a trivial question, but I am having trouble understanding this. Would very much appreciate your help. In game development using object oriented design, I want to understand how ...
2
votes
2answers
74 views

What is the advantage of wrapping D3D in a class versus a namespace?

Almost all the tutorials and books use a class wrapper for Direct3D. But I haven't found any scenario in which using more than one instance of Direct3D system (the "device" and state, et cetera) is ...
13
votes
6answers
2k views

OOP architecture for Hero with many attributes

I'm about to start a simple browser text RPG, with characters that can (passively) fight other people. This involves a list of about 10 skills like strength, dexterity and so on, with additional ...
0
votes
1answer
77 views

QuadTree treeNode design question

I'm a programming newbie. I have a Quadtree. I created a TreeNode class that the Quadtree will use as nodes. I have spriteNode that inherits from TreeNode. However, I also have several sprite ...
2
votes
4answers
950 views

How to make a game without OOP? [closed]

I am currenty studying game development and practicing making games. I use a lot of OOP in my games. For example, each missile that is shot is an instance of a Missile object, and added to a list of ...
0
votes
3answers
80 views

Getting entity type object [closed]

I have a custom entity class and what it does is create a SQUARE object. public class Entity { Rectangle rect; public Entity() { this.rect = new Rectangle(20,20); rect.relocate(200,200); ...
0
votes
1answer
576 views

Superclassing RPG Game Entities [closed]

I am in the design process of an RPG game and I have no experience at all in game dev. This question is about how I should approach entity management using OOP classes. My train of thought is as ...
1
vote
2answers
1k views

C++ OOP Implementation of a game [closed]

I've been recently trying to get into Object Oriented Programming by porting a game I've made in C to C++. The problem is, even though my implementation works, I don't know if is the best approach. ...
1
vote
1answer
536 views

Best Practices for class usage and game architecture

I'm making a 2D game similar to mario in Java. I have some questions about class organization and proper method usage. I have the following classes: Main: runs the game in a JFrame GamePanel: ...
2
votes
1answer
537 views

Multiplayer in a game. How to design it object wise?

I was suggested on StackOverflow to ask this question here. I'm working on a simple game and I was thinking of adding multiplayer feature but I'm a bit stuck. I'm not sure what approach should I ...
4
votes
2answers
1k views

Allocating Entities within an Entity System

I'm quite unsure how I should allocate/resemble my entities within my entity system. I have various options, but most of them seem to have cons associated with them. In all cases entities are ...
-2
votes
1answer
92 views

good struct for making items in game [closed]

i am trying to make a java game. i have a spaceShip(player) on left. you can go up and down, and shoot bullets. from right side enemy keep on coming and shoot bullets. you have to avoid them and kill ...
-6
votes
1answer
182 views

Generic Class Name for RTS [closed]

Hopefully this will be a nice easy question :- I am building an RTS as a way of learning OOP techniques. Currently the code has the following classes Class MustInherit GameUnit Class MustInherit ...
1
vote
1answer
271 views

Bullet Manager Class

I'm making a game in AS3, and it's a rather simple shooting game because I'm original. Anyway, probably the most subjective question here yet: what is the best way to implement bullets in my game? ...
1
vote
1answer
359 views

Entity Component Systems with Model View Controller

Can the Model View Controller design pattern be used with non-OOP coding style, specifically with Entity Component System?
2
votes
7answers
838 views

is ECS a kind of (or vs) OOP? [closed]

Is Entity Component System (ECS) considered a part of OOP or is it a completely different concept?
2
votes
1answer
2k views

HTML5 point and click adventure game code structure with CreateJS

I'm a programming beginner. I made a tiny one scene point and click adventure game to try to understand simple game logic and came up with this: CreateJS features prototypes for creating bitmap ...
1
vote
4answers
612 views

Non-object-oriented game tutorials

I've been tasked with writing an essay extolling the virtues of object oriented programming and creating an accompanying game to demonstrate them. My initial idea is to find a tutorial for a simple ...
0
votes
4answers
237 views

Actor and Sprite, who should own these properties?

I'm writing sort of a 2D game engine for making the process of creating games easier. It has two classes, Actor and Sprite. Actor is used for interactive elements (the player, enemies, bullets, a ...
5
votes
3answers
2k views

What's a good entity hierarchy for a 2D game?

I'm in the process of building a new 2D game out of some code I wrote a while ago. The object hierarchy for entities is like this: Scene (e.g. MainMenu): Contains multiple entities and delegates ...
2
votes
3answers
271 views

OOP in cocos2d for ios

I have been pulling my hair out trying to make an object in cocos 2d that is a CCSprite (with an image) and a CCLabelBMFont. I tried making a CCNode object and I tried making a custom CCSprite object ...
-3
votes
1answer
295 views

Why it is C++? [duplicate]

Possible Duplicate: Why has the industry switched from C to C++? Since many organizations have demonstarated Object orientation in C and we all know its ABI compatibility that C++ lacks, ...
1
vote
1answer
377 views

Implicity of “Objects” in component based design

For a while, I have mostly been using "standard OOP" (inheritance heavy, tree structure, etc.) styled designs for my Game Development needs. However, for my current project I am trying to shift over ...
10
votes
3answers
3k views

Composition heavy OOP vs pure entity component systems? [closed]

I admit, I have made the sin of overusing, and even abusing inheritance. The first (text) game project that I made when I was taking my OOP course went as far as "Locked door" and "unlocked door" from ...
0
votes
1answer
264 views

Structuring various game states and unique levels

I have a game design 'structure' question that I'd like to throw out there. This question is about various ways of designing game 'states', and specifically a system of 'levels'. Specifically, what is ...
8
votes
2answers
742 views

Doesn't multiple inheritance solve all problems that entity systems do?

The question is pretty self explaining: doesn't multiple inheritance solve all the problems that entity systems also solve? I just remembered a term called "multiple inheritance", and that seems to ...