# Questions tagged [movement]

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

109 questions
Filter by
Sorted by
Tagged with
1k 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 degrees....
• 333
986 views

### Calculating framerate-independent values, for linear, quadratic, and exponential functions

There are a few similar posts, but they only deal with one of the three components I'm looking for, and none seem to handle the case of using a fixed step size (they're all about simulations which use ...
7k 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 ...
• 1,135
37k 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 ...
• 469
26k 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 ...
• 315
5k 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 ...
• 1,388
4k 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 ...
• 201
23k 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 ...
5k 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 ...
• 341
16k 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 ...
• 223
16k views

### Best way to interpolate player movements in a very fast paced Unity game?

In my Unity online multiplayer game players move very fast and I currently use Lerp to interpolate between their last position and current position: ...
• 171
20k 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 at ...
• 861
7k 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 ...
• 161
6k 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.
• 207
8k 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. ...
• 103
22k views

### How to check if grounded with rigidbody

Does anyone have a better way to make an object with a rigidbody check for ground and then jump, right now I wrote a script where a raycast is cast downwards and it checks for distance but then I ...
• 1,255
18k views

### How can I implement a directional melee attack?

I am attempting to make a top down game similar to the SNES Zelda games, in Unity 4.3, in 2D. When my character swings their sword, every enemy within a radius takes damage. I want to make sure that ...
• 41
5k views

### Smooth Camera Follow

I am using a fixed static background. I have a gameobject(Current ref. image) which is moving with the help of waypoints. I have made camera to follow the Current. The camera is stuttering while ...
18k views

### How can I move an object in an "infinity" or "figure 8" 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 ...
• 1,470
11k 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 ...
• 321
25k 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 ...
• 583
5k 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 ...
• 233
13k views

### How do you move a sprite in sub-pixel increments?

Pixels are either on or off. The minimum amount you can move a sprite is a single pixel. So how you make the sprite move slower than 1 pixel per frame? The way I did it was to add the speed to a ...
• 263
4k views

### How can I make a character walk on uneven walls in a 2D platformer?

I want to have a playable character who can "walk" on an organic surface at any angle, including sideways and upside-down. By "organic" levels with slanted and curved features instead of straight ...
• 373
2k 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 ...
• 347
7k 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 ...
• 81
643 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 he/...
• 163
1k views

### What are the properties of "position, velocity, acceleration, rotation" collectively named?

They say naming things is one of the hardest problems in computer programming. They were right. Given the pseudocode below, what is a more appropriate name for this collection of properties? "Course",...
• 271
1k 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 ...
• 171
1k views

### Doom-style 2.5D Movement Animations

I've started working on a demo for my 2.5D game. For a basic scene I figured I would just use the good old fashioned doom sprites textured to a double sided plane. Simple enough. But I've been ...
• 201
1k 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 ...
• 1,077
467 views

### How can I convey a sensation of speed in space?

I'm making a game where you see a spaceship (in 3rd person) travelling at high-speed between planets (it takes 2-3 seconds move between them). What effect could I use to convey the effect of extreme ...
• 175
208 views

### How do I calculate the position of a vehicle moving between tiles, over time?

I'm working on a small multiplayer game where players can create cities, and these cities will be placed on what's called the "world map." The world map is basically a giant coordinate plane made up ...
• 45
3k views

### Displaying possible movement tiles

What's the fastest way to highlight all possible movement tiles for a player on a square grid? Players can only move up, down, left, right. Tiles can cost more than one movement, multiple levels are ...
• 254
958 views

### How do I create a player movement system in Farseer?

My group of students is helping produce a a 2D platformer. We tried making a pixel-based collision system which fell through. Now I am trying this physics engine on for size and see new ways to create ...
• 35
5k views

### Making a player move to my mouse when clicked?

How can I get my player to move to the mouse when it is clicked (like in Warcraft)? So far I have tried: ...
5k views

### Using Unity's transform.translate() to translate relative to an object but only using two axis

I'm using transform.translate() to move an object around the world space, relative to the camera that is following it. The camera has an angle of 23 degrees on the ...
• 3,641
10k views

### How can I make my player move in the direction the camera faces?

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
• 335
1k views

### Move GameObject with defined lists of position and rotation

I'm working on playing a replay on every strike. For that I'm recording the positions and rotation of the sphere in the list individually. I now have the values reside in the list. How do i move my ...
2k views

### Frame-rate independant movement with acceleration

First of all, this is different to this question, because that question doesn't update entities the same way I am. My update loop goes something like this (for the player): Apply acceleration based ...
• 123
931 views

### Smooth out movement of the snake in a 2d Snake game

I am working on a 2-D snake game in C++ with the SFML library. I would like to smooth out the movement of my snake as it looks extremely choppy currently. How the Snake moves The snake is made up of a ...
10k 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 ...
• 813
8k 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 ...
9k 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 (...
• 93
5k views

### Following a path in a smooth fashion

I am currently making a 2d tower defense game with a static, predetermined lane that the enemies follow (i.e. towers cannot block the path and path finding is not the problem I am trying to solve). I ...
• 191
2k 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 ...
• 173
2k 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 ...
• 906
19k 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 <...
• 925
7k 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 ...
• 767