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;

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.

C & C++ & C#

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
Web Design

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;
Programming Languages
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
C & C++ & C#
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
Programming Languages
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;
Game Development

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow