Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 572479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:37:02+00:00 2026-05-13T13:37:02+00:00

I have a sprite which will move right,left and jump. I need to add

  • 0

I have a sprite which will move right,left and jump.
I need to add the action to a animated sprite ie an animated sprite should jump, turn right and left.
Can anyone please tell me how to do it with sample code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:37:02+00:00Added an answer on May 13, 2026 at 1:37 pm

    This is quite simple with cocos2d code here:

    Sprite *mySprite = [Sprite spriteWithFile@"mySprite.png"];
    [mySprite setPosition:ccp(x,y)];
    [self addChild:mySprite]; //This displays the Sprite in your layer
    

    Now for the sequence you intend to do…

    id moveRight = [MoveBy actionWithDuration:2 position ccp(x+k,y) //Where k is how much to the right you want it to go.
    id moveLeft = [MoveBy actionWithDuration:2 position ccp(x-k,y)];
    id jump = [JumpBy actionWithDuration:1 position:ccp (x,y) height:1 jumps:1];
    id sequence = [Sequence actions:moveRight,moveLeft,jump,nil];
    [mySprite runAction:sequence];
    

    Hope that’s clear.

    -Oscar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Game in which sprite have to jump forward . I
If I have a sprite, with which I have drawn some stuff, how do
I have a MapTile class which holds a tile sprite and the tile's attribute.
I have an image which is made up of 2 images, a sprite. What
I have a line, which is a sprite made by using this code CGPoint
everyone! I have sprite moving by action, what have health bar (progress bar). When
I have an sprite, i want to move it by using my finger to
I have a sprite class which has a draw method which draws an explosion.
I need to create a sprite graphic, I hope that's the right name for
I have written a CSS sprite auto-generator which takes selected images out of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.