A simple term for "translation", the change of position of an entity typically on the route of going from point A to point B.

learn more… | top users | synonyms

4
votes
2answers
4k views

How can I move a sprite in the direction it is facing?

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
22
votes
4answers
4k views

Top Down RPG Movement w/ Correction?

I would hope that we have all played Zelda: A Link to the Past, please correct me if I'm wrong, but I want to emulate that kind of 2D, top-down character movement with a touch of correction. It has ...
41
votes
5answers
2k views

Looking for a good technique for character movement in hack&slash game

I'm making hack&slash game and I want my characters move like for example in Torchlight, Diablo, etc. Currently I generate set of nodes for all walkable areas of a floor. When I click somewhere ...
12
votes
3answers
1k views

How can I make “falling away” 3D terrain like Animal Crossing?

Animal Crossing has a unique way of scrolling the world map: When the character moves down, the the world rolls around and over at the top, like it's stuck to a cardboard tube: This video shows how ...
12
votes
4answers
4k views

Curved movement between two points

What is a good technique to enable an object to move between to points in a nice curved motion? The end position could also be in motion, such as the trajectory of a homing missile.
3
votes
1answer
326 views

Space Invaders-type game: Keeping the enemies aligned with each other as they turn around?

OK, so here's the lowdown of the problem I'm trying to solve. I'm developing a game in PyGame that's a cross between Space Invaders and Columns. I'm trying to make the motion of the enemies similar ...
16
votes
3answers
4k views

How does client-side prediction work?

I've read Valve + Gafferon and hundreds of pages from Google, but for whatever reason I can't get my head around client prediction. To my understanding, the basic problem is: Client A sends input ...
15
votes
2answers
2k views

RTS Game Protocol

I've been thinking about a multi player RTS game. The part that I can't seem to get around is keeping unit movement synced. If I move unit A to spot XY, I have to communicate that back to server that ...
24
votes
6answers
3k views

Who does the AI calculations in an MMO?

I am building an MMO and want to add NPCs. The thing is I don't know the basic design. What does the calculations, the clients or the server? I would understand the server calculating events and ...
5
votes
3answers
3k views

Moving from A(x,y) to B(x1,y1) with constant speed?

I currently have something like: float deltaX = point0.getX() - point1.getX(); float deltaY = point0.getY() - point1.getY(); And every 0.01 seconds I refresh my objects position like this: ...
4
votes
1answer
532 views

Collision Detection with SAT: False Collision for Diagonal Movement Towards Vertical Tile-Walls?

I'm developing my first tile-based 2D-game with Javascript. To learn the basics, I decided to write my own "game engine". I have successfully implemented collision detection using the separating axis ...
1
vote
1answer
533 views

What algorithms can I use for bullet movement toward the enemy?

I'm developing 2D strategy game. There are weapons that shoot at enemies. From what I've read in this, this, this and this post I think that I need linear algebra, but I don't really understand what ...
9
votes
2answers
4k views

Enemy movement in straight line to player in chase game

I'm creating a game where the enemies spawn randomly on a map then move towards the player every frame at a random speed. The map has no obstacles so the enemies should always move in a straight line. ...
6
votes
2answers
516 views

How do I keep my character centred on screen?

I am making a game similar to Legend of Zelda: Link to the Past (top-down 2D action-adventure). I want the character to stay centred on the screen when he moves. Currently, whenever the player wants ...
0
votes
0answers
113 views

SpriteKit Random Action/Movement

So basically i want a sprite to start from a random position and head to a random direction then take a random turn halfway through using CGPathAddCurveToPoint. The part i fail in is how to make it ...
13
votes
6answers
2k views

How to build a “traffic AI”?

A project I am working on right now features a lot of "traffic" in the sense of cars moving along roads, aircraft moving aroun an apron etc. As of now the available paths are precalculated, so nodes ...
9
votes
2answers
3k views

How do I tackle top down RPG movement?

I have a game that I am writing in Java. It is a top down RPG and I am trying to handle movement in the world. The world is largely procedural and I am having a difficult time tackling how to handle ...
5
votes
2answers
2k views

I am looking to create realistic car movement using vectors

I have goggled how to do this and found this http://www.helixsoft.nl/articles/circle/sincos.htm I have had a go at it but most of the functions that were showed didn't work I just got errors because ...
10
votes
2answers
573 views

How to limit click'n'drag movement to an area?

I apologize for the somewhat generic title. I'm really don't have much clue about how to accomplish what I'm trying to do, which is making it harder even to research a possible solution. I'm trying ...
8
votes
2answers
14k views

Moving a sprite in XNA/C#, using vectors

I'm currently looking into XNA game development with the C# language. I have two classes: the main game handler and a "sprite" class. Following is some basic pseudo-code which I hope adequately ...
7
votes
2answers
416 views

Movement on a curved planet surface

I'm looking for a solution for moving a variety of objects over the uneven surface of my planet. The idea is that I will have a number of objects that follow the planetary landscape moving about in ...
6
votes
3answers
2k views

How do I make an entity move in a direction?

I have an Entity instance which is updated every game tick. Let's just assume that entity moves forward constantly. I'd like to be able to give the entity's angle to a function that makes it move in ...
5
votes
1answer
696 views

Smooth movement in a tile based game

How can we make our character move smoothly across tiles? He moves tile by tile, but that looks unprofessional. In addition, when you hold down the arrow keys he zips across the screen. How can we ...
6
votes
1answer
429 views

What is the best way to limit player movement?

I'm currently programming a 2d game where the player moves around on a rectangular playing field. The player has a direction and a velocity. What is the best way to limit the player's movement so ...
3
votes
3answers
2k views

How do I calculate how an object will move from one point to another?

Here's the problem: A player starts the game in the 0 coordinate (x=0,y=0). When the user clicks on the screen, it returns the coordinates of the destination. Now the player has to move from its ...
50
votes
7answers
5k views

Can I prevent diagonal movement from exploring more of the map?

In a tile-grid where movement in any of 8 directions takes exactly the same amount of turns (chess-board style rules), can I prevent diagonal movement from showing more new tiles than orthogonal ...
7
votes
2answers
4k views

Free movement in a tile-based isometric game

Is there a reasonable easy way to implement free movement in a tile-based isometric game? Meaning that the player wouldn't just instantly jump from one tile to another or not be "snapped" to the grid ...
16
votes
6answers
1k views

AI control for a ship with physics model

I am looking for ideas how to implement following in 2D space. Unfortunately I don't know much about AI/path finding/autonomous control yet. Let's say this ship can move freely but it has mass and ...
13
votes
3answers
449 views

Technique for objects following each other in complete movement?

I'm wondering how objects follow each other where they move over the previous position of the object in front of them. When the leading object stops, all that are following should stop at their ...
17
votes
2answers
1k views

Eight or infinity sign trajectory

When I want to move object around point I do: point.x *= cosf(timer.timeElapsed); point.y *= sinf(timer.timeElapsed); How to make point move on eight or infinity sign trajectory?
5
votes
2answers
3k views

Oscillating Sprite Movement in XNA

I'm working on a 2d game and am looking to make a sprite move horizontally across the screen in XNA while oscillating vertically (basically I want the movement to look like a sin wave). Currently for ...
6
votes
2answers
2k views

How to manage enemy movement and shoot in a shmup?

I'm wondering what is the best (or at least a good) way of managing enemies in a shoot-em-up. Basically, what I'd do would be a class that manages displaying and updating positions of all the ...
8
votes
1answer
399 views

Is there anything equivalent to Portal 2's linked_portal_door in any other engines?

I need the functionality of the linked_portal_door that's in Portal 2. I've searched a little in UDK and mostly got people trying to duplicate the portal gun. Does anyone know if UDK, CryEngine, ...
5
votes
3answers
512 views

Determining the end location for AI movement in groups in a 2D RTS

I have written an RTS game (a demo for a game engine of sorts, actually) in which the user's basic interaction with the game is to select a bunch of soldiers and then right-click on the map to move ...
5
votes
1answer
203 views

Walking on a sphere

I'm working on a game which involves walking your character on the surface of a sphere. Using the answer to Arbitrary Rotation about a Sphere, I've written my code as: if (game.isKeyDown(37)) { // ...
3
votes
1answer
285 views

Moving the jBullet collision body to with the player object

I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a ...
5
votes
5answers
976 views

How do I implement deceleration for the player character?

Using delta time with addition and subtraction is easy. player.speed += 100 * dt However, multiplication and division complicate things a bit. For example, let's say I want the player to double his ...
2
votes
1answer
1k views

Stopping on a slope in Box2d

I am creating a simple platformer using Box2d. I've implemented a variant of the technique described here. To make the player character move more 'platformer-like' I want him to stop on (shallow) ...
2
votes
1answer
343 views

Move Sprite from A(x,y) to B(x1,y1);

I have a sprite with an UpdateHandler that can change it's position every 0.1 seconds. My Question is , given the Sprites current position, how can I move it to another position(like from 10,10 to ...
1
vote
1answer
127 views

Increase restitution (bounciness) of an object in a JavaScript formula

I'm going slightly around the houses on this one. I originally started a thread over on Stack Overflow about it but then it seemed to diverge into mathematics, with no joy from the SO community over ...
0
votes
1answer
406 views

How can I determine which direction a 2D collision is occurring from?

The problem is as follows: Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and ...
5
votes
2answers
519 views

How to combine tap and long hold gesture recognizers?

I have a game in which the player moves around a sprite by tapping on various sections of the screen (left, right, up, down). So far, each tap moves the sprite one tile (I use a tile system for ...
5
votes
1answer
580 views

How can I implement view wobble when my player is running?

I'm creating a FPS in XNA. So far its' going great. What I'm looking at doing is replicating the camera movements that you see in Modern Warfare. So, if you are walking the camera stays pretty ...
3
votes
1answer
532 views

How do you get an object to orbit around a certain point on a 2d plane?

I had a concept for a game come to me this morning but I can't figure out how I'd go about implementing the movement. The general idea involves the left and right controls causing a sprite to go ...
2
votes
3answers
412 views

Best way to implement mouse-based movement in MMOG

I want to design an MMO where players click the destination they want to walk to with their mouse and the character moves there, similar to Runescape in this manner. I think it should be easier than ...
1
vote
3answers
263 views

How to move an object along a vector

Let's say I got an object A and object B in a 2D game. I create a vector leading from A to B. It's name is AB. How can I make A move along the vector AB and reach B? One way I was thinking of doing ...
1
vote
1answer
165 views

How to implement deceleration and stopping over a certain distance [duplicate]

So I have a a character, say a spaceship. It needs to move distance R, and in direction T (Theta). So say if The object is at (0,0), and it needs to get to (4,3), it has R = 5 and T = about 36 ...
1
vote
1answer
982 views

Moving sprites on a graph in libGDX

In my game I'd like to move sprites on a fixed path. Until this point I was trying to stick with the tools already provided by libGDX, like the Tiled map renderer classes so I'm looking for a solution ...
0
votes
2answers
99 views

How to move an image back and forth with javascript

I currently am trying to make a baseball game and have this code here: http://jsfiddle.net/769BK/ I have the baseballX set to a decrement, and then I try increasing the value using baseballX++; but it ...
0
votes
2answers
136 views

How to move an object using X and Y coordinates in JavaScript

I am making a 2d baseball game with JavaScript and HTML5 and am trying to move an image that I have drawn with JavaScript like so: //canvas var c = document.getElementById("gameCanvas"); ...