Tag Info

New answers tagged

0

Some games define rectangular area of the screen that the player can move about in without causing camera movement. Any movement outside of this area will cause the camera to move to compensate. This allows the player to make small movements (e.g. adjusting position on a block or jumping on an enemy) without shifting the camera. Shaun Inman has posted a ...


0

I call the way I do it the rule of the two thirds. Basically the screen height is split in three, and level design is done accordingly to these part sizes. Player avatar is always in the middle part. When she jumps to a higher platform contained in the top third of the screen, the camera moves to center the player. When player reaches the lowest part the ...


0

There is no reason for the Map and Player objects to communicate at all that I can see. So far as what you've told us we can assume that Player object only holds data about their position, but then what does the map hold? (rhetorical Q). It sounds like the objects are doing the same job. I.e. the map already knows the Player object's position. If your map ...


0

I think some trigonometry classes would help you. Meaning of variables position.x is the x coordinate, and position.z is the y (if 2D game) or z (3D game) coordinate. Yaw is the rotation (in radians I think). So when user presses A do yaw--; and when user presses S do yaw++;. Distance is how far to move (sort of like speed). NOTE: This is written in Java. ...


2

Your question is a bit wider than you exposed I think. Player and Map are two objects and should be thought as it. They are not different, from an engine point of view, of a ping-pong table or a flying toaster. That said the question is : how to make NORMAL objects findable and communicate? For a map / player relation I usually put responsability... on a ...


3

One way to do it is to keep track of the Front and Up normalized vectors and transform the front vector whenever your character turns, and calculate the Right vector using cross product ( I am assuming Up vector won't rotate). Or you can keep track of the three vectors and rotate them. Once you rotate them you update the position by adding the offset in the ...


1

The setLinearVelocity method literally sets the Box2D body's x- and y-velocities to the given values. That means if the parameter for x is set, the character will begin moving horizontally. However, if the parameter for y is zero, the character will stop moving vertically. To fix this, you could either pass the character's current y-velocity in the ...


1

You might want to take a look at these articles. They are a bit old; however I think they cover what you are looking for. Coordinated Unit Movement Implementing Coordinated Unit Movement


0

A friend found a potential solution by increasing the Physics2D.velocityThreshold constant, I'm not able to test it currently since it's a 4.5 feature and I currently use 4.3 (downloading/installing 4.5 right now).


1

Look at what's happening. SaveX is 300, SaveY is 0. When you normalize moveVec you take the Vector (300,0) and resize it to be a length of 1, which makes it (1,0). You test to see if 300 > your position, if so you add moveVec.getX(), otherwise you subtract. So you move 1 to the right. You then test to see if 0 > your position, if so you add ...


1

The white vector is the correct vector with the code you have. If you're only ever adding integers to your position, the movement is going to be at increments of 45 degrees. That's restricted to orthogonal and diagonal movement only. If you want free movement you should be normalizing the movement vector. Check to see if the libraries you're using have a ...


0

Don't use JFrame, instead use BasicGame subclass and AppGameContainer (it's much better than JFrame). And to your problem, you have to create a Camera class. That's all already covered here.


1

from looking at the docs I have found your issue public static void rotateM (float[] m, int mOffset, float a, float x, float y, float z) Added in API level 1 Rotates matrix m in place by angle a (in degrees) around the axis (x, y, z). Parameters: m source matrix mOffset index into m where the matrix starts a angle to rotate in ...


4

As long as your movement space isn't Euclidean and things can block an entire grid space, you'll have this problem. If you want people to not "play the grid" you're probably going to have to not use a grid.


1

If I understand, your question is about the building of the formation (arrival of the enemies from outside the screen into a "space-invaders like" formation (aka end-formation)). Having played this game a lot, here is how I think they have done it: They have a handful of "incoming trajectories" which come from out of the screen to an end-point roughly in ...



Top 50 recent answers are included