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.
-1
votes
0answers
34 views
Getting an object from a 2d array inside of a class [on hold]
I am have a class file that contains two classes, platform and platforms. platform holds the single platform information, and platforms has an 2d array of platforms. Im trying to render all of them in ...
-1
votes
0answers
76 views
Artificial Intelligence … how to make an object roam freely/avoid other objects, and model consciousness? [closed]
Say a simple free roam battle scene in which a player runs around freely and engages in battle with other enemies/objects, as shown below:
The dragon/dinosaur (or whatever that thing I drew appears ...
-1
votes
1answer
49 views
Jumping over non-stationary objects without problems … 2-D platformer … how could this be solved? [closed]
You know this problem ... take Super Mario Bros. for example. When Mario/Luigi/etc. comes in proximity with a nearing pipe image an invisible boundary setter must prevent him from continuing forward ...
-2
votes
1answer
154 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 ...
0
votes
0answers
21 views
XNA Accessing a particluar type of screen from the screen manager
I am using monogame and the screen manager sample.
I have a small question regarding how to access a particular type of game screen; GamePlayScreen.
All of the screens extend a class GameScreen and ...
3
votes
2answers
95 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 ...
1
vote
3answers
142 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
81 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
61 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 ...
3
votes
1answer
101 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
56 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
257 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 ...
0
votes
1answer
82 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 ...
-1
votes
1answer
97 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 ...
1
vote
1answer
88 views
Making different kinds of items [closed]
I want to create 2 items on the screen. Each item will be a differently colored rectangle.
item1 = green rect
item2 = blue rect
If the user gets the 1st item, it will print bullet1, which is the 1st ...
13
votes
5answers
1k 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
780 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 ...
1
vote
3answers
683 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 ...
2
votes
1answer
85 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
80 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
0answers
1k views
Cutting objects and applying texture to cut. Unity3d/C#
Basically what I'm trying to do is figure out how to calculate realtime cutting of objects, and apply a texture to the cut. I found some good scripts, but most of them have been abandoned and aren't ...
52
votes
9answers
3k 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 ...
0
votes
2answers
544 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
130 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 ...
1
vote
1answer
297 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
147 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
370 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 ...
1
vote
2answers
642 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 ...
2
votes
4answers
3k 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 ...
0
votes
1answer
835 views
Interactions between game objects
I'm programming a basic Pacman clone to teach myself game programming. However, I'm struggling with the best way to have the game objects communicate/interact without my code becoming a huge mess.
...
5
votes
3answers
723 views
Object-oriented Snake game design
I'm going to make a snake remake with SDL library and right now I'm thinking heavily about the object-oriented design.
I can imagine that I will have classes like GameEngine, Snake, Board and Food, ...
2
votes
2answers
1k views
Creating an object in javascript with unity (unityscript)
So I have a ton of experience with JavaScript (its what I do for a living) but I am new to unity. I have built a game engine in javascript but now want to move it over to unity. I have been trying to ...
1
vote
4answers
249 views
What is the best method to use to write and handle multiple levels?
I have a level class that does all of the updating and drawing and everything pertaining to the level. My question is, what would be the best approach to creating different levels? Should I just ...
2
votes
2answers
1k 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 ...
0
votes
1answer
582 views
In some games, we just let the main() loop be the Player object or Table object?
I was thinking that let's say if there is a game of Blackjack or MasterMind, then we should have a class called Dealer or ComputerPal, which is how the computer interact with us (as a dealer for ...
6
votes
3answers
3k 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 ...
6
votes
2answers
1k 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 ...
0
votes
2answers
153 views
Why are changes in one object applied to all objects in a list?
I've got two List:
BasicModels: As Content has to be loaded at the start of the game I instanciate and load all models into this list.
ModelsOnScreen: Every time when a Model is added to the screen ...
0
votes
3answers
362 views
How do I make a message based communication system between objects?
Just as I was told here, I need to make some kind of communication between objects in my game. Mainly, for achievements. How do I do this? My idea was to make every object have an array attached to ...
0
votes
1answer
276 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
2answers
113 views
How do I make a pointer point to the current running level if each level is its own class?
I'm hard-coding my levels and coding each level in its own class...The problem is that I need to have a pointer that points to the class of the current level. I don't know how I would go about doing ...
1
vote
3answers
145 views
Changing game object type: reinstantiating the object, or switching an object state
I work on a strategy game, where the player occasionally has to transform ordinary citizens into the so called "leaders". Leaders are temporary units, which the player can control directly, in order ...
5
votes
1answer
174 views
Should Different “Types” of Animations be in the Same Class?
For example, say you want a character animation and a health bar animation. Since these require different algorithms, should they be in the same class?
They both re-use some of the same code but ...
4
votes
3answers
536 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 ...
11
votes
1answer
926 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
2answers
273 views
Question on methods in Object Oriented Programming [closed]
I’m learning Java at the minute (first language), and as a project I’m looking at developing a simple puzzle game.
My question relates to the methods within a class. I have my Block type class; it ...
14
votes
6answers
2k 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
223 views
Combination of DLL/Plugins with Object/Components
I worked on a personal game project (learning) for about the last year or so off and on in Ogre3D. Now that I am starting a new project, I want to avoid the Class Heirarchy for objects and having all ...
1
vote
1answer
872 views
How to make one solid object in Maya?
How can I "glue" more objects to each other so I get one object? (It is for resizing models), couldn't find anything about it on the internet, but I'm dutch, so maybe that's why. Thank you very much!
...
3
votes
3answers
1k views
Game Object Design
I'm having a problem with the way I designed my first simple game in C++.
I have GameObject (abstract class) and ObjectA which inherits the update() and draw() methods from GameObject.
My main loop ...