4
votes
1answer
153 views

How do I make a cube move by rolling?

I am learning jMonkeyEngine by making some small games with it. I have a simple rectangular cube that I want the player to be able to roll around the game world. When he presses the arrow keys, the ...
0
votes
1answer
68 views

What's the best way to time a character AI movement on android/java?

I'm creating an android game and I'm trying to figure out the best way to time a character position change, something like this: public void move() { //this.posX += 5; this.posY += 5; if ...
1
vote
2answers
151 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, ...
5
votes
1answer
480 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 ...
1
vote
0answers
69 views

The input doesn't recognize that I release the key? [closed]

I'm creating a window (JOptionPane), in response to a collision. However, if the player is holding a key down when the window pops up, the input doesn't trigger a key release when the key is released. ...
0
votes
1answer
129 views

Java: Basic Movement AI not working

I am working on a basic AI system to get an entity to follow a player. I created both the player and the ghost entity, but it seems as if the ghost only wants to increment both x and y, it never wants ...
0
votes
1answer
368 views

Pokémon character turning / facing: How is it achieved? Movement is already done though [closed]

You know that when the player playing Pokémon games want to change the facing of the main character, one would simply tap on the directional pad (D-pad) on the Game Boy (Color/Advanced/Advanced SP) or ...
2
votes
1answer
443 views

2D Top down acceleration vector

I have been wanting to solve the issue of movement once and for all... with all that I have learnt and read through, should be a piece of cake one would have thought... , seems it isn't. Having ...
2
votes
2answers
168 views

Smoother controls

I am trying to move my background left if the user hits the right key. and right if the user hits the left key, so that it will look like the player is moving. The problem is that whenever I hold the ...
2
votes
2answers
444 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 ...
3
votes
1answer
166 views

AI surrounding algorithm suggestions

I am building up a simulation where predator groups (tribes) try to hunt other agents in the simulation (whom also are clustered in groups). Now I got to a point where members of a group follow their ...
6
votes
4answers
413 views

Implementing AI to hide behind obstacles

I am developing an AI simulation of predator and prey. I would like to simulate the AI hiding behind obstacles, if it is being chased. But I am still trying to figure out the best way to implement ...
1
vote
1answer
850 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 ...
3
votes
1answer
260 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 ...
3
votes
2answers
933 views

How do you set the movement speed of a sprite?

I'm using Slick 2D/Java to play around with graphics. Getting an image to move is easy: Input input = gc.getInput(); if(input.isKeyDown(sprite.up)){ sprite.y--; }else if ...
4
votes
4answers
463 views

Can a high FPS negatively affect how a program runs?

Yeah I know this is a broad question and will get down rated, I'm just hoping for some answer before it gets closed. Anyway, I'm using Slick 2D/Java to play around with graphics. I'm having some ...
1
vote
1answer
373 views

How to I get a rotated sprite to move left or right?

Using Java/Slick 2D, I'm using the mouse to rotate a sprite on the screen and the directional keys (in this case, WASD) to move the spite. Forwards and backwards is easy, just position += ...
0
votes
2answers
476 views

Can't get sprite to rotate correctly? [closed]

I'm attempting to play with graphics using Java/Slick 2d. I'm trying to get my sprite to rotate to wherever the mouse is on the screen and then move accordingly. I figured the best way to do this was ...
4
votes
2answers
3k 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 ...
6
votes
3answers
1k views

How can I make a character move forward in a certain direction?

I have an entity class which is updated every game tick. Let's just assume said entity moves forward constantly. What i want to know is, how can i make it so that i can give an angle to a function and ...
2
votes
1answer
1k views

How can I accomplish Pokemon-style movement over tiles in java?

I'm talking about where if you press a directional key once you walk over to the adjacent tile and can't do any other actions during the walk. I can get my character to move one tile width, but my ...
3
votes
6answers
2k views

How to implement object velocity as a vector

I'm working on a Breakout game, and want to change the ball's movement code from how I currently do it, to something based on vectors (as I feel learning and implementing movement based on vectors ...
2
votes
3answers
542 views

Movement in RPG

I want to make an RPG game in which I move tile by tile. So when I hit up, the tile row that I am on decreases by one for example. Also, it's supposed to be a slow movement so that I can see the ...
0
votes
2answers
918 views

3D: First Person Movement

I've searched and searched for a solution today but haven't found one. I have a Camera with Vector3 and also the camera has an angle. If I use this: hero.position.x += speedX; hero.position.z += ...
0
votes
2answers
448 views

How do I move a sprite around using tile based movement in Java?

So, I'm new to Java and I want to get a sprite to move around the screen, like a tile-based movement. I really would like some help and some resources or tutorials could work. I've done a little C#, ...
2
votes
1answer
780 views

2D bullet movement speed problem [duplicate]

Possible Duplicate: Moving from A(x,y) to B(x1,y1) with constant speed? My problem is that I can't get my bullet movement right. The current update code I have for it is: speedX = deltaX; ...
-1
votes
1answer
701 views

2D top down movement

I'm trying to make my first real time game. I'm having problems with the movements using the mouse though. If close to theX axis, the player is moving fine, but if close to the Y axis(going ...
1
vote
2answers
627 views

Collision Problems

I'm having some troubles with a 2D platformer type game (there's more to it, but that's all that matters for this question). I had collision with the platforms working fine, but if the character hit ...
9
votes
2answers
2k 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 ...
3
votes
2answers
713 views

Mouse-driven Movement

I'm trying to write a game where player picks where they are going by just mouse-clicking on that position and it goes there (just like RuneScape's point-and-click mouse interface). I'm trying to get ...