13
votes
3answers
3k views

How to avoid movement speed stacking when multiple keys are pressed?

I've started a new game which requires no mouse, thus leaving the movement up to the keyboard. I have tried to incorporate 8 directions; up, left, right, up-right and so on. However when I press more ...
0
votes
0answers
32 views

top down 8 directional movement - need help with collision [duplicate]

I have for some time now been strugling with movement in my game. I want a zelda like 8 directional top-down movement. I have tried different things, but non of them have been perfect. EDIT: ...
0
votes
2answers
123 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
146 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"); ...
-2
votes
1answer
102 views

in a 2D game that has an array as a map how to make graphics look nice?

I have a map that's stored in a 2D Array with 1s being walls, 0s being roads, and 2s being houses. There is a character that is not stored in the map but its position is always checked against the map ...
0
votes
1answer
191 views

Movement / aiming algorithm in 2d / tiled based game

I'm trying to create simple 2D / tiled base game in JavaScript. Entities are able to move by any number of pixels, but only in one direction at once (can't go in diagonal way). AI for enemies is ...
0
votes
1answer
155 views

Isometric Movement in Javascript In the DOM

I am creating a game using Javascript. I am not using the HTML5 Canvas Element. The game requires both side view controlles, and Isometric controls, hence the movementMode variable. I have got the ...
5
votes
3answers
547 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
219 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)) { // ...
0
votes
1answer
574 views

Character movement on a 2D tile map

I'm working at making a HTML5 game. Top down, closest thing I can equate it to is the gameboy zeldas, but open world and no rooms. What I have so far is a procedurally generated map in a multi ...
-1
votes
2answers
1k views

Moving a sprite towards an x and y coordinate

Given a sprite with an x and y coordinate, how would I move it toward another sprite with an x and y coordinate? I've already made it face towards the other sprite, and I've made it move towards the ...
0
votes
2answers
383 views

Increasing speed of circle over time as linear with Box2d

Assume that there is a circle and it can be moved by using keyboard arrows.Is required that increasing speed over time like increasing car speed. For example; max speed is 25 and time to reach max ...
1
vote
1answer
128 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
292 views

Player movement behind objects

I was playing around on RPG JS and Browser Quest, and the player, when moving, can give the effect of walking behind the trees or houses etc, so the player effectively disappears while it is "behind" ...
-5
votes
2answers
529 views

A* mouse movement javascript top-down game

Im trying to implement a* path finding for my character movement in my game. The game is written in javaScript along with jQuery in a canvas. I have read up on A* so i believe i understand what it ...