# Tagged Questions

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

6k 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 ...
13k 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: object....
14k 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 ...
389 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....
3k 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 ...
3k 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 ...
937 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 ...
8k 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 ...
8k 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 ...
3k 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 ...
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.
7k 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 ...
5k 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. ...
5k 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 ...
4k 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 ...
7k 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 ...
1k 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 ...
3k 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: if (Mouse.isButtonDown(0)) { if (X < Mouse.getX()) { X += Speed; } if ...
548 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)) { // ...
3k 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 ...
751 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 ...
534 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 ...
476 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/...
537 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",...
640 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 ...
96 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 ...
2k views

### How can I move an object towards another along a straight line

How can I move an object (like a cube) towards another object? Let's say that we have a red cube in the center of a floor, and a blue cube in another location, there aren't objects between this two, ...
3k 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 ...
7k 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 ...
6k 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 (...
2k 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 ...
5k 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 ...
4k 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 infinity sign trajectory?
1k 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 ...
7k 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 ...
4k 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 ...
2k 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 ...
4k 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 ...
572 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, ...
883 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 ...
493 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 cube)....
343 views

### Best 2d AI movement system

I'm creating a top-down rpg (no tile-based) using libgdx. Now I need to make enemies move on map with obstacles. What is the best approach to realize that? A*(I think, if enemy see player, he should ...
293 views

### How can I incorporate the path of a jump into my A* implementation?

I need to calculate the path of a jump via A* for a simple platformer game. Calculating the direction is simple, but translating the jump physics into pre-calcuted voxel paths is a bit difficult. ...
667 views

### Beginner: How do I calculate a vector?

I am trying to wrap my head around some concepts in a side project I'm working on. I'm struggling with how I can calculate a vector based on my character movement logic. Here are the relevant details ...
2k 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) ...
757 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 ...
3k 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 ...
267 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 ...