The physical location of an entity inside the game space, be it visible or invisible, absolute or relative.

learn more… | top users | synonyms

0
votes
2answers
105 views

which quarter of a triangle the point is in

I've got a world made out of squares. The square are devided in four triangles like this: The corners have their heights stored in a 2D array and the center height is the average of the corners. To ...
0
votes
1answer
71 views

3d rotation of a Gunner unit to shoot the target

I'm developing a scenario to shoot incoming targets by a specific gunner unit, however I'm confused to actual logic of shooting an object with a gun. I'm working in 3D environment. I'v target's ...
1
vote
1answer
292 views

How to match user click and the sprite object position in libGDX framework

I am using libGDX Java framework for developing a practice game in Eclipse. My game is in landscape mode and I am using sprite image for game assets. Actually I am trying to follow the Kilobolt ...
0
votes
1answer
84 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
0
votes
1answer
190 views

OpenGL Reconstructing Position from Depth

I know this has been asked a lot of time before but none of those answers fixed my problem. I try to implement deferred shading and to do so I need to reconstruct the world space position from the ...
0
votes
3answers
215 views

Why is my texture drawn in a different place when in fullscreen?

I'm trying to draw a texture (with a crescent moon) in the middle of the y-axis: public void draw(SpriteBatch batch) { batch.draw(lune, 0, Gdx.graphics.getHeight() / 2); } It renders this when ...
0
votes
1answer
153 views

Ground contact point for animated character sprites in an isometric game?

I'm working on an isometric game. I have the 3D pre-rendered sprites for directions per state (walking/running, etc.) per frame. Now I need to know where a particular character stands on the ground to ...
0
votes
2answers
105 views

very simple math destination and speed calculation

My player goes to (destinationX, destinationY) His position is: (x,y) and the player has an update event function update() { this.x = this.x + dx; this.y = this.y + dy; } what is the formula ...
0
votes
2answers
74 views

Angluar movement

I'm making a little game where you are a spaceship and you fly around in 2d using the A and D key to rotate and the W key to accelerate. Now my problem is if i turn my ship it doesn't go into the ...
1
vote
1answer
166 views

Java: See if Mouse is hovering/clicking Sprite

The game I am developing is in which you defend the Cell from the Viruses, and I need the sprites to have a MouseListener for when the mouse clicks on that sprite, it will get destroyed, and I cannot ...
1
vote
1answer
73 views

An approach for storing points in space

I am going to work on my next game project, however there are some issues I want to correct since my last one. Here is one of them: This is a problem I think I can already solve, but I'd like to hear ...
3
votes
1answer
410 views

Java: AI to make a mob face the player working half-way correctly

While creating some basic AI for my "ghost" mob that is just up for testing at the moment, I thought of allowing it to face the player, depending on the player location. I get it to work correctly, ...
0
votes
1answer
927 views

How to position two objects relative to each other

I am trying to make a modular vehicle editor similar to Kerbal Space Program. The user selects an initial vehicle part which is spawned in the center of the "work area". To add another part to the ...
0
votes
2answers
701 views

How to set the object's world position in bullet?

In my Ogre3d application I am first changing the parent of a node like this: // save object "Cube" into node*; then ... Vector3 absPos(node->_getDerivedPosition()); Quaternion ...
3
votes
3answers
487 views

MMOFPS Choosing protocol for high-traffic network (UDP or TCP)? [closed]

my question about the player position sender protocol. In this article, he says "Never use TCP for networking a multiplayer game". Ok but UDP datas are not ordered. In this case, if somebody walking, ...
1
vote
2answers
85 views

Mapping of positions on images in different frames

I am looking for a possibility to map different positions on a 2D Image which has different frames. Let's say I have an image, consisting of three frames, which shows a spaceship. The first frame ...
-1
votes
2answers
625 views

Android bitmap placing

I've recently added an explosion in my game, for when enemies get killed, and it works fine and all, but the explosion wont "spawn" on the enemies x and y. The problem is that I'm not drawing the ...
0
votes
1answer
757 views

Ligdx Box2d : convert box2d coordinates into screen coordinates

I'm new in libgdx and i have a little problem. I created a body in box2d and i want to assign it a sprite; for that i need to get the position of the body,then insert into the main loop the updated ...
4
votes
3answers
2k views

Smooth Sprite Movement - Don't Add Velocity to Position?

I am trying to figure out if there is a way to move a sprite smoothly on the screen at different speeds without stuttering, but keeping the effect that it's moving smoothly; especially at faster ...
-1
votes
1answer
81 views

differences in UDK map on different installs

My goal is to create a simple groundplane in UDK (11/2012 version, fresh install) that the user will be able to run around on. My requirements are therefore very basic and I tried to whip something up ...
1
vote
2answers
388 views

Moving an object around the the circle to the specific location in circumference

Well I have run out of ideas how to approach this particular problem.See the picture below: So the idea is that the object (dot in black) has to get to a point mark X (red X mark).However the ...
0
votes
1answer
168 views

How to calculate the position of an attached model after rotation?

I'm programming a basic game on XNA. I started to place an object (eg weapon) attached to the right arm of my player. When I move my character forward behind left or right all right. But when I ...
1
vote
4answers
153 views

Logic that can traverse all possible layouts, but not checking every combination of identical pieces?

Suppose we have a grid of arbitrary size, which is filled by blocks of various widths and heights. There are many 2x2 blocks (meaning they take a total of 4 cells in the grid) and many 3x3 blocks, as ...
3
votes
1answer
139 views

How to make an object stay relative to another object

In the following example there is a guy and a boat. They have both a position, orientation and velocity. The guy is standing on the shore and would like to board. He changes his position so he is ...
0
votes
2answers
519 views

Shuffle tiles position in the beginning of the game XNA Csharp

I'm trying to create a puzzle game where you move tiles to certain positions to make a whole image. I need help with randomizing the tiles start position so that they don't create the whole image at ...
1
vote
2answers
381 views

Get position of tile in tileset

Take this image: http://ScrnSht.com/nkvusq How can i get the position of tile 14 (or any other) when only knowing the following: Tile ID: 14 Rows: 4 Columns: 7 The end result should be 2x4.
0
votes
2answers
877 views

XNA - positioning after rotation

I have a turret with a 2 gunbarrels. The turret rotates towards my mouse. So far no problem. When it creates a few bullets and positions them at the end of the gun barrels. Here is the problem. It ...
2
votes
1answer
377 views

Position Reconstruction from Depth by inverting Perspective Projection

I had some trouble reconstructing position from depth sampled from the depth buffer. I use the equivalent of gluPerspective in GLM. The code in GLM is: template GLM_FUNC_QUALIFIER detail::tmat4x4 ...
1
vote
1answer
1k views

Positioning a sprite in XNA: Use ClientBounds or BackBuffer?

I'm reading a book called "Learning XNA 4.0" written by Aaron Reed. Throughout most of the chapters, whenever he calculates the position of a sprite to use in his call to SpriteBatch.Draw, he uses ...
3
votes
1answer
315 views

Retrieving model position after applying modeltransforms in XNA

For this method that the goingBeyond XNA tutorial provides, it would be really convenient if I could retrieve the new position of the model after I apply all the transforms to the mesh. I have edited ...
3
votes
2answers
173 views

Camera placement sphere for an always fully visible object

Given an object: With the bounds [x, y, z, width, height, depth] And an orthographic projection [left, right, bottom, top, near, far] I want to determine the radius of a sphere which allows me to ...
2
votes
1answer
376 views

multiply matrix by vector: what to do if need to change y-up to z-up?

I multiply a matrix with a position vector to get a new position, however, now I need to change my matrix from y-up coordinate space to z-up. Changing only the matrix won't work: how to apply the ...
0
votes
1answer
250 views

Why set the position of both b2Body and Box2DSprite?

In a game, we add a body for each sprite, the method is: createBodyAtLocation:(CGPoint) forSprite:(Box2DSprite*)sprite In which we create the body and we attach it to the sprite in parameter: ...
3
votes
2answers
995 views

Positional sound with headphones?

I've have read this interesting question, where is explained how to simulate positional sound with the left and right channel; but still I wonder: is it possible to simulate positional sound (with ...
2
votes
2answers
771 views

Making mouse pos realtive to a moving object

I'm coding my first actual game, trying without following tutorials, just trying to use my knowledge so far to make something playable. I'm creating (attempting) a simple side-scrolling shooter. I ...
1
vote
1answer
3k views

Looking at the mouse position in a top down Unity game?

I'm trying to make a simple top down game where the player looks at wherever the mouse is pointed. The player is only going to rotate on the Y axis. Here's what I have so far but I can't seem to get ...
2
votes
1answer
299 views

delay camera xna

I read this tutorial http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2/Camera_delay.php but i didnot unsterstand it. Is there another way to delay the camera position movement without this ...
0
votes
1answer
224 views

How to move the camera in XNA only after few moments?

I made the camera position 10 units from an object, but not behind it. I dont want the camera position behind the object right away when it rotates, I want that when I will rotate the object, the ...
0
votes
1answer
297 views

How to compute tile offset for different isometric angles?

I am working on an isometric game and the designers want to use a different isometric angle than the default one, where I simply had to do a 2/1 offset based on tile size. I know what the new ...
1
vote
3answers
4k views

Find Point with only angle and distance

I'm working on a school project and we have to create a tank team with the programming game Robocode (tank battle with self programmed bots in Java). I have to program a scout bot that scans, finds ...
3
votes
1answer
310 views

Entity position: In map or in script?

I'd like to know how others have handled the issue of storing the entity's position. (Or maybe it's not an issue and I just make it too complicated.) I'm undecided on whether to store the position of ...
1
vote
1answer
390 views

Scene graphs vs in-game representation

This is a general question which aim is to allow me to start digging on the subject by myself. As I noticed the general opinion is that scene graphs are good for describing the scene in a level ...
11
votes
9answers
2k views

How to implement time traveling into a game?

I was wondering how to implement time travel into a game. Nothing super complex, just time-reversal like what's in Braid, where the user can rewind/fast forward time by 30 seconds or whatever. I ...
24
votes
4answers
3k views

Finding the nearest object

I have a sizable game engine and I'd like a feature for finding the nearest of a list of points. I could simply use the Pythagorean theorem to find the distances. I know I can't simply add x and y, ...
7
votes
2answers
599 views

How should one handle positions in a tile-based world?

I have a simple Tower Defense game using a tiled world. Creep and towers are on a tile at all times. How should I represent the position of creeps in code? (Do creeps know their current tile and ...
2
votes
1answer
524 views

Why are my 2D positions “off” after adding a camera transformation in XNA?

My game's source is on github. I am following this tutorial to create a 2D camera. After I adding the transformation to the SpriteBatch, all of my positions seem to be "off" when I move the ship (and ...
4
votes
3answers
965 views

Kepler orbit : get position on the orbit over time

I'm developing a space-simulation related game, and I am having some trouble implementing the movement of binary stars, like this: The two stars orbit their centroid, and their trajectories are ...
6
votes
4answers
1k views

Determing an object's position along a curve over time

I have some objects in my game which are "thrown". At the moment I am trying to implement this by having these objects follow a parabolic curve. I know the start point, the end point, the vertex and ...
6
votes
4answers
398 views

What data should I use to track the player position on a world at the same size of the earth in a multiplayer game?

I guess this kind of game or simulator already exist somewhere, but I'm not sure... Let's imagine I'm making a game where the proportions of the planet earth and the humans beings on it are the same ...
6
votes
3answers
1k views

How would one determine the position of a participant in a racing game?

Now, for the record, I'm currently not implementing any racing game whatsoever, but this problem just popped into my mind and now I'm curious. So how would one go about finding out which participant ...