How can I make my sprite jump up and move forward AT THE SAME TIME?



I'm new to coding in general, and I'm trying to make a sprite's movements work. For some reason, he can only jump and THEN move, or move and THEN jump, but never at the same time. I'm using InputProcessor and a TiledMap system. Here's some code : @Overridepublic boolean keyDown(int keycode) { switch(keycode) { case Keys.W: if(canJump) { velocity.y = speed; canJump = false; } break; case Keys.A: velocity.x = -speed; break;

Related to : How can I make my sprite jump up and move forward AT THE SAME TIME?
How to make my sprite Jump? (XNA, C#)
Game Development

I've been working on a simple platformer game using XNA. I have been having some trouble working out a good jumping algorithm. After getting rid of the messy half done versions of the jumping algorithm all I have left is.


if (keystate.IsKeyDown(Keys.W))
{
spritePosition.Y = spritePosition.Y - 10;
}

I realise this is a very unsophisticated start but any tips would be great. I'm a self taught programmer so some terminology might be lost on me, I tend to find looking at actual code the best way to learn. Thanks.


How to move&jump animation sprite in box2d
Game Development

in this code created a animation sprite using spritesheet. the sprite created body. there boy can move on world using button.


//spritesheet plist
[[CCSpriteFrameCache sharedSpriteFrameCache]
addSpriteFramesWithFile:@"boyRunning.plist"];
// Create a sprite sheet with the boyRunning images
spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"boyRunning.png"];
[self addChild:spriteSheet];
// Load up the frames of our animation
NSMutableArray *walkAnimFrames = [NSMutableArray array];
for(int i = 2; i <=7; ++i) {
[walkAnimFrames addObject:[[CCSprite
How do I bounce, move, and jump a sprite simultaneously in AndEngine
Game Development

I am looking to move a sprite in the same manner as in this video. I am using AndEngine. How do I move that ninja(sprite), complete with move and jump, using the AndEngine Box2D physics extension.


Here is my MainActivity1.class:


public class MainActivity1 extends BaseGameActivity {
Scene scene;
private TiledTextureRegion mPlayerTextureRegion;
private BoundCamera mBoundChaseCamera;
private static final int CAMERA_WIDTH = 1024;
private static final int CAMERA_HEIGHT = 600;
private BitmapTextureAtlas mBitmapTextureAtlas;
private BitmapTextureAtlas mBitmapTextureAtlasp;
Unity3d C# - Unable to make ball jump and move same time
Game Development
I am able to jump or move left/right any point in time. But unable to jump and at the same time move left/right simultaneously. Am I missing anything? My codes as follows. Thanks for advice. public int rotationSpeed = 100;public float jumpHeight = 8;private bool isFalling = false;void Update () { // handle ball rotation float rotation = Input.GetAxis("Horizontal") * rotationSpeed; rotation *= Time.deltaTime; rigidbody.AddRelativeTorque(Vector3.back * rotation); //c
Unable to make ball jump and move same time
Game Development
I am able to jump or move left/right any point in time. But unable to jump and at the same time move left/right simultaneously. Am I missing anything? My codes as follows. Thanks for advice. public int rotationSpeed = 100;public float jumpHeight = 8;private bool isFalling = false;void Update () { // handle ball rotation float rotation = Input.GetAxis("Horizontal") * rotationSpeed; rotation *= Time.deltaTime; rigidbody.AddRelativeTorque(Vector3.back * rotation); //c
How can I make my sprite jump up and move forward AT THE SAME TIME?
Game Development
I'm new to coding in general, and I'm trying to make a sprite's movements work. For some reason, he can only jump and THEN move, or move and THEN jump, but never at the same time. I'm using InputProcessor and a TiledMap system. Here's some code : @Overridepublic boolean keyDown(int keycode) { switch(keycode) { case Keys.W: if(canJump) { velocity.y = speed; canJump = false; } break; case Keys.A: velocity.x = -speed; break;

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .