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

-1
votes
1answer
56 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 ...
-4
votes
0answers
19 views

Add existing multiple Object to JFrame [closed]

Hi i want to create different objects and place them in a single JFrame. There will be same type objects and different type objects. They change their place and existing by time. Do you have any ...
1
vote
1answer
85 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
674 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 ...
15
votes
2answers
543 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
125 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
65 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
77 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
451 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 ...
50
votes
8answers
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
308 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
119 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
0answers
51 views

Using Instance Nodes, worth it?

I am making a 2d game where there are various environments with lots and lots of objects. There is a forest scene with like 1200 objects in total(trees mainly), of which around 100 are visible on the ...
1
vote
1answer
258 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
141 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 ...

1 2 3
15 30 50 per page