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

I'm assuming that the physics engine for cocos2d-x already has this ability and you will just need to dig a little bit more. Otherwise, I'm also thinking of trying to implement something similar myself for a mockup game I'm trying to create. Right now (not sure whether it's a good idea or not) I'm thinking of adding a new property that determines what kind ...


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 ...


0

I fixed it it was a silly mistake I didn't apply the vertices relative to the center but relative to the upper-left corner which is (0 , 0) for everything else in GLES 2.0 I'm using


0

From your example, I assume you are making a 2D horizontal scrolling game. If I assume your game scrolls from right to left (player moves toward the right edge of the screen), and that the CameraX value is 0 at the start of the game and increase when the player moves right, then your rendering code should be: for(int i=0; i<chunkLoad; i++) { ...



Top 50 recent answers are included