Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
42 views

Read access violation, pointer was nullprt

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) ...
0
votes
1answer
31 views

Sprite/Object/Room limits in GameMaker 8.1?

I know about GameMaker Studio’s limitations for sprites, objects, rooms, and other assets (https://help.yoyogames.com/hc/en-us/articles/230407528-GameMaker-Studio-2-Trial-Limitations), but I can’t ...
1
vote
1answer
90 views

Unity2D: Vector3.Lerp - smooth movement

I have a script that randomly chooses a position to move a game object every 5 seconds, however instead of moving my object smoothly, my script make my object jumps, which is not desirable! How would ...
0
votes
0answers
26 views

Make a object render behind/trough another but make hide it if its behind some other object

So first of all sorry for this strange title... I know it may sounds worse and a bit complicated... But heres my problem : My player belongs to the "Player" layer. He stands somewhere on my map, ...
0
votes
0answers
16 views

Syncing animations across different objects

In my game I have the player object which is made up of separate objects to allow for part swapping. Each general part has it's own animator and the overal object has an animator. Let me explain, the ...
0
votes
0answers
8 views

Accesing (Scriptable)Objects without referencing them in every script

I have a ScriptableObject named Item. Let's say I've made three items with this object. I want to have a way of accessing these three items without referencing them in every script. My idea was to ...
0
votes
2answers
44 views

Equal objects with independent variables in Game Maker?

Think of a situation with two distinct runners with different speeds. They will have to walk a circuit in a straight line with two obstacles (police). Below is an illustration of the situation: The ...
0
votes
1answer
142 views

LIBGDX - group as child of an actor?

I've looked in forums, the doc, and the code, and I'm thinking this isn't currently possible, but maybe I'm missing something, so just to be sure: is there a way to set a group as child of and actor? ...
0
votes
1answer
78 views

Difference between Object.Destroy() and GameObject.Destroy() in Unity

What is the difference between using Object.Destroy() and GameObject.Destroy() in Unity? I found the following info about that: ...
0
votes
1answer
41 views

Make character move behind object

I used Tiled Editor for making maps for my own game, I do not run any engine or anything. I have separated terrain layer and object layer in TiledEditor. However I have problem with trees I want to ...
0
votes
1answer
60 views

Evenly distribution of 2 or more shapes given their x and y points inside a bounding box

I have a set of dynamically shaped objects, How do I distribute them evenly either Horizontally or Vertically.The objects are surrounded by a bounding box and the objects are placed at x,y as shown. ...
0
votes
1answer
252 views

Cannot implicitly convert type object[] to UnityEngine.GameObject[]

So, I cannot implicitly convert type object[] to UnityEngine.GameObject[]. But why? As far I know, are all types a inheritanced types of object. So, for my logic, I could put a GameObject array in a ...
0
votes
0answers
50 views

Best strategy to track object hierarchy using groups and obj files

I am making a 3D game in OpenGL from scratch. In this game I have a ship with stuff inside it. How can I attach the stuff to the ship in the CAD program and maintain that hierarchy in my own game? ...
2
votes
0answers
169 views

How to make sure two Tiles not overlap each other?

I'm trying to make a Grid who will be easily convertible between 2D and 3D and I'm having a problem with overlapping prefabs in the case of the 3D generation. The thing is, the DataObjects (Tiles) ...
-1
votes
1answer
38 views

How to detect when object A In point B place

i have object which is moving to points in the screen each time the point ( call it B) is moving to different place and object A follow its direction . Im using Linear interpolation and simple ...
1
vote
1answer
333 views

How to prevent clicking through object in GameMaker

I've been making my first, simple game in Game Maker. You have to click a moving ball (obj_ball), each time you click it, it wil start moving faster. I wanted to add a way to lose the game: if you ...
0
votes
1answer
70 views

A logic error. canvas: balls physics, bounce

Hi I was making a program that simulate a bunch of balls bouncing, but the problem is some balls got stuck to the floor. Since it's a logic error, it is kind of difficult to find. Can someone help, I ...
0
votes
1answer
47 views

Tree of objects in 2D space - children relative to parent

Question How do we track the position of child objects, relative to a parent? Context I have a simple structure that keeps track of a point in space, along with zero or more children: ...
0
votes
1answer
77 views
0
votes
1answer
186 views

How to add a JSON object / model into your whitestorm world / scene?

I am loading the object from my json file. ...
0
votes
2answers
69 views

How do I pass my objects to the update method?

I've had formal education in Java for around half a year now, and as a hobby I would like to attempt game development. I've downloaded the Slick2d library to help with this. I've run into a problem ...
0
votes
1answer
2k views

How to have random and different colors on multiple objects with one material?

I want to have one material applied to multiple objects that has a random color on each object. How can I achieve this so that I don't need to use a different material for every object? This is in ...
1
vote
1answer
2k views

GameStudio : How to remove object after delay

When you pick an item in the inventory and drop it to obj_item_ground, this item is send to the ground. That's fine. I want to add a delay to this item to destroy ...
0
votes
2answers
1k views

C++ Instantiating objects as function arguments / parameters (base and derived classes)

I've noticed with some functions in C++ that accept objects (e.g. constructors), you can actually create the object within the function argument e.g. (this example uses an SDL_Point as the main ...
1
vote
2answers
82 views

Change parent object on instantiation

I'm making a game in which I have different weapons. One of them is a hand grenade. Well, the question is: I made an animation with mecanim (I don't know if is the correct way) with the grenade being ...
6
votes
1answer
288 views

How to randomly place entities that don't overlap?

I am creating a randomly-generated environment for a game I'm developing. I am using OpenGL and coding in Java. I am trying to ...
1
vote
1answer
410 views

Game asset “objects” consisting of several meshes vs continuous mesh

When building game objects in a 3D modeler like Blender I'm finding it's easier to get greater detail and still have fewer vertices if I separate certain elements. For example, I need to make cuts ...
2
votes
0answers
71 views

What is the most efficient way to determine collision path

I am trying to create a game in which I need to know if two objects will collide in the future, and when. I have both object's position, radius (they are circles) and velocity. A specific example of ...
3
votes
1answer
752 views

Creating HTML5 Canvas Objects in Javascript [closed]

I'm currently trying to learn how to make HTML5 Canvas games with JavaScript. I would like to use object oriented JavaScript to manage the elements of the game, but i'm having trouble. I've done a lot ...
-1
votes
1answer
214 views

How is the relationship between Scripts and Objects in Unity?

If I don't attach the Script to the Object, will be the code able to "see" the object? When I need to manipulate (such as enabled() or a transform()) two or more Objects, do I need to attach the ...
0
votes
1answer
440 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
97 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 ...
3
votes
1answer
2k 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 ...
1
vote
2answers
134 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
1k 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
141 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
1answer
98 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 ...
3
votes
1answer
326 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 ...
2
votes
1answer
115 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
3k 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 ...
6
votes
2answers
12k 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 : ...
3
votes
2answers
527 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
139 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
177 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 ...
1
vote
1answer
5k views

How to load and draw this *.obj correctly?

I have a loader class for *.obj files (called GLModel) which has 2 main methods - ...
-1
votes
1answer
680 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
167 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 ...
1
vote
3answers
476 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
180 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
77 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 ...