Questions tagged [objects]

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.

Filter by
Sorted by
Tagged with
7
votes
2answers
17k 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 : ...
1
vote
1answer
55 views

Painter's theorem inside and outside test

I have read from Hearn and Baker computer graphics book. I read the test#2 painter's theorem which image is given below. This image showing surface S is completely behind the surface S', by checking ...
0
votes
1answer
88 views
0
votes
1answer
54 views

Prevent Wall Clipping with Bouncing Shape

I'm currently working on a demo-type program involving bouncing objects. Currently, I have a rectangle that can bounce around the screen. When the rectangle bounces against one of the walls ...
1
vote
1answer
35 views

Calculate coordinates of boundaries containing group of objects

I would like to understand how to calculate coordinates of boundaries group of objects as a parallelepiped in 3D game? Let's say for simplicity we have spheres randomly slowly moving in 3d space some ...
1
vote
3answers
548 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
64 views

How to deal with data that needs to be accessed by all objects?

I have a World class that currently only has one instance. It has data and methods that need to be accessed by all other game objects. Right now I'm hardcoding a ...
3
votes
2answers
99 views

Given a base class and many derived classes with additional features, what's the best practice for accessing those features?

This might sound strange, but let me explain. Say I want to write a safari program. In this safari there is an object pool of 10 animals (Animal*): 2 ostrich, 5 ...
1
vote
1answer
83 views

Wonky perlin noise

I am quite new to the wondrous world of "Procedural Textures", and I am trying to create a double precission perlin noise algorithm. I am almost done with it except for the fact that the coordinates ...
0
votes
1answer
44 views

Ideal way to instantiate abilities in a class give a dynamic list of abilities to use?

I have a PlayerClass class that is used to set my Player's class. For instance, this will make him a warrior: PlayerClass warrior = new WarriorClass(); ...
0
votes
1answer
96 views

How to differentiate between object types and roles?

I have a base class Object, and depending on how the object must behave on the scene, I have multiple abstract "role" classes, that inherits virtually from ...
16
votes
6answers
15k 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 ...
0
votes
0answers
33 views

Efficient system to reach the "parent" variable

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 ...
0
votes
0answers
14 views

Scrollable Text On Object

I want to put Scrollable Text On Object / Mesh. I looked after it on YT but I did not find anything useful. How could I do this?
0
votes
1answer
50 views

Why has my object detached itself from the parent?

I made an two objects in blender, animated them, and saved them. Firstly, when I reloaded them, half of the animations I created had disappeared, which is annoying itself but the real annoyance is ...
0
votes
2answers
167 views

Querying game objects in real-time

I'm thinking about working on a game where I need to find all the objects matching certain properties. For instances I might need to look up all the objects... Producing gold. Whose level is 5 or ...
0
votes
1answer
434 views

C++:Segmentation fault (core dumped) while creating gameobject

i made a small code to debug and i get this error player inherit from gameobject code ...
-1
votes
1answer
138 views

C++: passing gameobject as a parameter and then into vector

firstly iam used to java and new to c++ so maybe this will looks a noob's question i will explain this and give a pseudo code and then c++ just so you can understand me i have a player class which ...
1
vote
1answer
93 views

Can I put real monuments like white house, statue of liberty in my open world game? [duplicate]

I'm currently working on open world game. But I am confused about one thing that, is it ok if I put real monuments and sculptures like white house, statue of liberty etc. in my game? Please help if ...
0
votes
2answers
67 views

Can a character interact well with surroundings in-game?

I don't have any experience in game programming, but I am currently on programming-related degree, although on a different branch to game design. I thought about how an environment can come more ...
1
vote
1answer
38 views

How to set keys for emission on/off for a prefab?

I am making a prototype for a Mario game and am having difficulty completing a canned animation for a prefab. There is an item box asset that has 3 materials and an "ItemGet" animation. One of these ...
0
votes
0answers
14 views

NullReferenceException: Object reference not set to an instance of an object [duplicate]

Hi so im displaying food, health an water on the screen in a text box by using UnityEngine.UI and making text variables. They are all defined in the update function so they will keep changing and are ...
1
vote
1answer
704 views

Instantiating a GameObject at my desired position not working

I'm sure I am misunderstanding something about Unity vectors or something here. I am brand, brand new to Unity so this is part of the problem. I am trying to make a simple atomic model and I am ...
2
votes
2answers
2k views

C++ create array of multiple types

I tried to create an array Entity[] with elements Human and Zomby. ...
12
votes
1answer
1k 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
438 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
1k 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) ...
14
votes
2answers
3k 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 ...
0
votes
1answer
653 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
4k 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
52 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, ...
22
votes
3answers
8k 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
2answers
57 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 ...
1
vote
1answer
87 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
646 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: ...
4
votes
3answers
1k views

Designing the main classes in a solar system simulation game in C++

If this is not the right place for this question, could you please direct me to a more suitable site/forum? I'm a beginner in game development (and in the use of this site). I've worked with C++ only ...
0
votes
1answer
68 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
82 views

Identify objects of the same type from each other, even between game restarts?

So I have a simple Character class: ...
0
votes
2answers
79 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

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
117 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
319 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
vote
2answers
1k 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 ...
-1
votes
1answer
45 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
773 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
153 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
52 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: ...
19
votes
6answers
16k views

How object-oriented are videogames? [closed]

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

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

I am loading the object from my json file. ...
59
votes
9answers
7k 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 ...