Skip to main content

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.

Filter by
Sorted by
Tagged with
4 votes
1 answer
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....
Rivasa's user avatar
  • 333
0 votes
1 answer
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 ...
Raigan Burns's user avatar
26 votes
4 answers
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 ...
Corey Ogburn's user avatar
  • 1,135
24 votes
3 answers
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 ...
Fofole's user avatar
  • 469
13 votes
2 answers
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 ...
rphello101's user avatar
50 votes
5 answers
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 ...
piotrek's user avatar
  • 1,388
8 votes
2 answers
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 ...
asbumste's user avatar
  • 201
6 votes
3 answers
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 ...
user avatar
19 votes
2 answers
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 ...
Darthg8r's user avatar
  • 341
12 votes
2 answers
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 ...
bobthemac's user avatar
  • 223
9 votes
2 answers
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: ...
idn's user avatar
  • 171
35 votes
4 answers
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 ...
Chris Evans's user avatar
16 votes
3 answers
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 ...
Chris's user avatar
  • 161
15 votes
4 answers
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.
anonymouse's user avatar
10 votes
2 answers
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. ...
user4761's user avatar
  • 103
5 votes
3 answers
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 ...
John Smith's user avatar
  • 1,255
4 votes
5 answers
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 ...
Jeremy's user avatar
  • 41
3 votes
4 answers
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 ...
user5185619's user avatar
31 votes
4 answers
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 ...
Yevhen's user avatar
  • 1,470
21 votes
6 answers
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 ...
Lunikon's user avatar
  • 321
14 votes
3 answers
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 ...
Shaun Wild's user avatar
13 votes
2 answers
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 ...
WarmWaffles's user avatar
12 votes
6 answers
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 ...
bzrr's user avatar
  • 263
11 votes
2 answers
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 ...
Eric N's user avatar
  • 373
11 votes
2 answers
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 ...
Vexille's user avatar
  • 347
8 votes
2 answers
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 ...
leo882's user avatar
  • 81
6 votes
1 answer
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/...
DLiKS's user avatar
  • 163
6 votes
2 answers
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",...
EnabrenTane's user avatar
5 votes
1 answer
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 ...
Macks's user avatar
  • 171
4 votes
1 answer
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 ...
whitwhoa's user avatar
  • 201
4 votes
1 answer
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 ...
JesseTG's user avatar
  • 1,077
3 votes
3 answers
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 ...
BAmadeusJ's user avatar
  • 175
2 votes
1 answer
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 ...
josh's user avatar
  • 45
2 votes
3 answers
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 ...
Ash Blue's user avatar
  • 254
2 votes
1 answer
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 ...
Ryan Foy's user avatar
2 votes
2 answers
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: ...
user avatar
0 votes
3 answers
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 ...
user3797758's user avatar
  • 3,641
0 votes
1 answer
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 ...
Samurai Fox's user avatar
0 votes
2 answers
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 ...
Salar Muhammad's user avatar
0 votes
1 answer
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 ...
Jacob Garby's user avatar
0 votes
2 answers
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 ...
user avatar
58 votes
7 answers
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 ...
Mr. Smith's user avatar
  • 813
31 votes
6 answers
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 ...
Patrick Lorio's user avatar
9 votes
2 answers
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 (...
xtr486's user avatar
  • 93
9 votes
2 answers
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 ...
Pwnosaurus's user avatar
7 votes
3 answers
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 ...
IceCreamYou's user avatar
7 votes
2 answers
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 ...
Caius Eugene's user avatar
7 votes
3 answers
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 <...
user3150201's user avatar
7 votes
5 answers
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 ...
tesselode's user avatar
  • 767
6 votes
1 answer
2k views

How does a game like Enter the Gungeon handle forward and backwards movement with their orthographic set up?

So I've been scratching my head at this problem for over a week now, and would love some insight from anyone who might know a bit more. In my game I have the floor flat on the X/Z plane with walls/...
Shervin's user avatar
  • 131