A related set of properties (height, colour, level) and methods (pick up item, jump, attack) that are used to describe an entity in the game.

learn more… | top users | synonyms

0
votes
0answers
40 views

How to implement something as shown in the picture [closed]

I am trying to make a game using libgdx framework problem: Initially screen is blank,then blue ball enters the screen from top, when blue ball reaches middle red ball enters,when blue ball reaches ...
0
votes
1answer
27 views

LibGDX destroy object when not used

I am developing a game where objects move in the screen. My object is instantiated in Y = 0 and I want to destroy this object when it goes under the screen Height. So if (positionY >= ScreenHeight) I ...
0
votes
1answer
36 views

Design Pattern for “Default Object”

I'm making a first person dungeon crawler like Eye of the Beholder. During execution, I have a Map object. It contains Cell objects. Anc each Cell contains, at most, four Wall objects. The Wall ...
1
vote
1answer
111 views

I can't drag'n'drop UI-Elements from the Scene-hierarchy into a public field (Unity 5)

I just watched this Video https://unity3d.com/learn/tutorials/projects/survival-shooter/player-health and tried to drag'n'drop the UI-Elements on the matching script, just like they did. But this is ...
14
votes
1answer
1k views

How to gain accurate results with Painter's algorithm?

A while ago I asked how to determine when a face is overlapping another. The advice was to use a Z-buffer. However, I cannot use a Z-buffer in my current project and hence I would like to use the ...
1
vote
2answers
69 views

Is it possible to control what script is active on what sprite/object in Unity?

I have 2 objects, and I have a script which makes the player change their characteristics. I applied the script to both, and as you'd expect, pressing X button does the color, size, translation change ...
0
votes
1answer
150 views

Help with understanding “transform.root.GetComponent<>” in Unity

I'm reading through a tutorial for making an RTS in Unity, and in certain scripts it wants you to make a Player field and then OnStart(){ transform.root.GetComponent}. I am not quite getting what that ...
0
votes
1answer
55 views

System.StackOverflowException error [closed]

Hi all! I have a one problem. I trying to create 2D cave generation system in C# with XNA game studio, but then I running program I getting "System.StackOverflowException". As you can see in this ...
1
vote
3answers
102 views

Handle many objects to draw in XNA

in my 2D engine - using XNA 4.0 - I´ve an issue with handling many objects. The way my engine works is that I only draw visible sprites (base objects) and ignore those sprites out of the current ...
1
vote
1answer
63 views

Rendering order for units behind objects?

Im developing a 2D game with some fake 3D effects (parallell projection). 2D-units are able to walk in front of buildings aswell as behind them, although themselves being just 2d-objects. This leads ...
2
votes
2answers
3k views

Retrieve the original prefab from a game object

How would one proceed to retrieve the original prefab used for instantiating an object? In the editor these two functions work : Debug.Log(PrefabUtility.GetPrefabParent(gameObject)); ...
1
vote
4answers
4k views

How to differentiate between instantiated objects in Unity?

I'm currently trying to solve a way to go about the following problem before I start writing any code (the old fashioned pen and paper way) but I'm not sure how I could achieve the following. I'm ...
1
vote
0answers
107 views

How do I avoid circular dependencies with game events in C++? [closed]

My question concerns three objects in my game: EnemyConfig (a derived class of Event - it's an event that concerns throwing enemies at the player and making her deal with them) and Enemy. The ...
3
votes
1answer
235 views

How and when to choose which objects to run collision tests on?

This might be problem with plenty of good solutions, but it's all not very clear to me, so I though I could ask and probably get some good hints. I'm having trouble figuring out how to handle ...
7
votes
4answers
6k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
0
votes
2answers
130 views

How do I connect my objects to my meshes?

I am creating a simple 3D engine and I've run into a problem. I have an array of objects [Camera, Player, Player, MonsterA, MonsterB, MonsterA] and a number of mesh files that I need to associate ...
2
votes
1answer
93 views

Space between randomly generated objects

Im not sure there is a going to be a simple answer for this question but Ill ask anyway. I am programming an endless scrolling game where the player's character is constantly "falling." As they fall ...
0
votes
1answer
1k views

Error when using GetComponent (Object reference not set to an instance of an object)

I'm using a textmesh to check variables in real time. Thing is if I use AddComponent within Update(), it obviously starts spamming and slows the game. If I try with GetComponent the error is the ...
3
votes
2answers
396 views

How should I design my classes in a game?

I'm stuck for ideas on classes in game programming. This is probably more of an opinion based question. I'm looking for information that is proving hard to find on the internet. Say I have a class ...
1
vote
1answer
91 views

Multiple concurrent Tweens

I'd like to be able to direct a game object to move to a new target position over a certain amount of time. There are lots of different easing functions available, but for now let's say I'm just ...
0
votes
1answer
123 views

When to use class/objects for graphics [closed]

I am fairly new to game development, but I have a good programming background with object oriented programming. But with games, I do not know when I should use an object (or class) for an entity on ...
0
votes
1answer
2k views

How to load and draw this *.obj correctly?

I have a loader class for *.obj files (called GLModel) which has 2 main methods - public GLModel(BufferedReader ref, boolean centerit, GL gl,Texture texture) which use for *.obj load , and ...
-1
votes
1answer
353 views

Detailed Modern Opengl Tutorial? [duplicate]

I am asking for a specific modern opengl tutorial. I need a tutorial that does not skip to explain any lines of code. It should also include different independent objects moving/rotating (most ...
3
votes
2answers
130 views

Circular Method Calls

The title may be a little wrong for what I am asking, but that was the closest I could think of. My problem is I am making a game that includes a World class and a WorldObject class. the World class ...
54
votes
9answers
5k views

How to avoid circular dependencies between Player and World?

I'm working on a 2D game where you can move up, down, left and right. I have essentially two game logic objects: Player: Has a position relative to the world World: Draws the map and the player So ...
1
vote
3answers
258 views

How should I handle the relationship between my Player and keyboard input classes?

Just a quick one really, as I can't find anything definative. Started developing in Java, to learn and take on a bit of Game Dev. Have a PHP background, and I'm a massive sucker for best practices, ...
0
votes
1answer
109 views

watching for changes in object state

I'd like to know what others do to watch for changes in object states while the game is running. Say you have an object and that object has a timer. The timer completes. What is the best way to know ...
1
vote
1answer
71 views

How can I show information from a variety of sources in my debug menu?

I'm creating a debug menu, and I want to be able to show a lot of information (variables) on that menu. This information will come from a lot of classes (instances). How can I show a lot of ...
6
votes
2answers
2k views

How can I handle inventory in an object-oriented way?

I'm trying to think of the best way to handle player inventory following an object oriented approach. For example, sword and axe are two different classes, both inheriting from weapon. Weapon and ...
15
votes
6answers
3k views

How object-oriented are videogames?

I've always wondered to what extent object orientation is used by videogames, especially huge 3D projects. I reckon it would be cool that both troll and werewolf inherited its attributes from enemy ...
0
votes
1answer
1k views

cocos2d-x - object creation and management in game design

How do others keep track of everything going on in their games? I am working on a new game and I am quickly realizing everything that I need to keep track of. Example: Maybe a layerManager that ...
3
votes
1answer
227 views

Mesh objects and a draw function

I'm currently working with a mesh class so I can easily create mesh objects. Now I want a draw function in my mesh class so when ever i want draw it to the screen I can just call it without any fuss. ...
0
votes
1answer
82 views

Object generation from an existing object in a game engine

To simplify, let's say in en engine I'm coding for a game, I have the Main class an Object class. In the Main class' update method, I loop through the array of all Objects in the game. I also have a ...
0
votes
1answer
108 views

Why does this LUA code not render any objects on the screen? [closed]

Did I mess up something somewhere? If i put a putsxy in the same box, it renders a string just fine, but for some reason this code hates objects. What this code is supposed to do is render a set of ...
3
votes
4answers
4k views

Multiple Key Presses in XNA?

I'm actually trying to do something fairly simple. I cannot get multiple key presses to work in XNA. I've tried the following pieces of code. else if (keyboardState.IsKeyDown(Keys.Down) && ...
-1
votes
1answer
304 views

Refering to an object from an array in Java [closed]

In my game, the whole thing is based off of grids. So the map is a dual dimensional array of 32 (32 x 32 grid map). Now what I want to be able to do is to grab a grid and be able to access it and ...
14
votes
5answers
3k views

An object twice as close appears twice as big?

So I was thinking about creating a 2D game where you can also move along the Z-axis, by changing in which layer you are. Depending on the depth I want to scale my 2D sprites. Once, someone had shown ...
18
votes
2answers
2k views

How to structure code for many unique weapons/spells/powers

I'm an inexperienced programmer creating a "roguelike-like" game in the vein of FTL, using Python (no PyGame as of yet as I'm still only concerned with text). My game will contain a large number of ...
0
votes
1answer
1k views

3D Paint tool in Maya

Hey everyone, could someone help me out on this question? When I am trying to texture objects in maya (for example a barrel) I want to texture it with a brush. When I try to use the 3D painting tool ...
2
votes
1answer
206 views

How do I gain access to objects in order to change their properties in Unity?

I have created a GUI text object named "GUIText" in the Unity editor, and I want to change what the text says via code (I'm using C#). How do I access GUIText1 to change its string properties? I want ...
1
vote
0answers
87 views

Collision detection code style [closed]

Not only there are two useful broad-phase algorithms and a lot of useful narrowphase algorithms, there are also multiple code styles. Arrays vs. calling Make an array of broadphase checks, then ...
0
votes
2answers
1k views

Foreach loop with 2d array of objects

I'm using a 2D array of objects to store data about tiles, or "blocks" in my gameworld. I initialise the array, fill it with data and then attempt to invoke the draw method of each object. foreach ...
1
vote
3answers
167 views

Level and Player objects - which should contain which?

I've been working on a several simple games, and I've always come to a decision point where I have to choose whether to have the Level object as an attribute of the Player class or the Player as an ...
0
votes
1answer
365 views

Problem creating levels using inherited classes/polymorphism

I'm trying to write my level classes by having a base class that each level class inherits from...The base class uses pure virtual functions. My base class is only going to be used as a vector ...
1
vote
1answer
411 views

How should I share variables between instances/classes?

I'm making a game using LOVE, so everything is programmed in Lua. I've been experimenting with using classes and object orientation recently. I've found out that a nice system to use is having most of ...
-3
votes
1answer
157 views

How are certain objects named in OpenGL?

I am a beginner in OpenGL, and I would like to know how to distinguish specific objects in an OpenGL game. For instance, the game world contains 3 gems of different colors, how can I know which one ...
0
votes
1answer
524 views

android basic Movement for array-objects

I was adviced to start a seperate question for this so here I go. Been stuck so long with this do if you can help, please do. Lets get to it! Im trying to set the speed for my bullets, but since Im ...
3
votes
2answers
2k views

Advice on a PHP RPG System

I am looking to make a php/mysql/javascript based rpg on a site. I am trying to figure out the best method when it comes to items, quests, etc. For instance should I make classes for each item type ...
1
vote
2answers
738 views

Is there any option other than Component Based for game architecture?

Having read a lot recently on Component Based systems (for games), i find it hard to go back to my earlier state of mind. If static object hierarchies fail to model "objects with a dynamic set of ...
7
votes
4answers
9k views

What is the most efficient container to store dynamic game objects in? [closed]

I am making a first person shooter and I know about about a lot of different container types but I would like to find the container that is the most efficient for storing dynamic objects that will be ...