Halp, i'm a begginer

0 favourites
  • 3 posts
  • Hi, i'm trying to do a platformer game and i put the character movements with no problem. Then, discovering the program, i bumped into some problems, here it is:

    1 - When i press left or right arrow during the jump action the character start to walk in the air until touch the ground.

    2 - When i press "x" button (attack button) the character does the animation and freeze in the last frame until i press any button to "defrost" the animation. If i hold movement button and then press "x" the character does the animation while is moving.

    3 - If i hold right arrow, press left whitout releasing right and then release right arrow the player stays on iddle animation and move backwards.

    I hope you guys can help me.

    Here comes:

    dropbox.com/s/5i2vi5048vloy32/6.capx

  • First, this is the wrong sub-forum for this. You should get help elsewhere... this sub-forum is for people seeking paid or volunteer help in gaming projects.

    Here is a quick and dirty solution to your problem... which still has some problems. There is a cleaner solution to this, but I think you need to at least see why I did what I did to help improve your programming skills. You should be able to add more condition checks to your code to make sure that the character movement code is impeccable.

    PROBLEM 1 & 3 -

    SOLUTION

    Create a new global flag called B_Moving. When B_Moving is TRUE (or equals one), that means your character is moving.

    Also create a new global flag called B_Jumping. When B_Jumping is TRUE (or equals one), that means your character is jumping.

    Make the following changes by adding the lines printed in bold:

    MODIFY Line 1:

    Condition:

    Keyboard -> On Left arrow pressed AND

    System -> B_Moving = 0

    System -> B_Jumping = 0

    Action:

    Sprite -> Set animation to "Walking" (play from beginning)

    Sprite -> Set Mirrored

    System -> B_Moving = 1

    MODIFY Line 2:

    Condition:

    Keyboard -> On Right arrow pressed AND

    System -> B_Moving = 0

    System -> B_Jumping = 0

    Action:

    Sprite -> Set animation to "Walking" (play from beginning)

    Sprite -> Set Not mirrored

    System -> B_Moving = 1

    MODIFY Line 4:

    Condition:

    Keyboard -> On Right arrow released AND

    System -> B_Moving = 1

    Action:

    Sprite -> Set animation to "Idle" (play from beginning)

    System -> B_Moving = 0

    MODIFY Line 5:

    Condition:

    Keyboard -> On Left arrow released AND

    System -> B_Moving = 1

    Action:

    Sprite -> Set mirrored

    Sprite -> Set animation to "Idle" (play from beginning)

    Start ignoring Platform user input

    System -> B_Moving = 0

    MODIFY Line 6:

    Condition:

    Keyboard -> On Up arrow released

    Action:

    Sprite -> Set animation to "Jumping" (play from beginning)

    Start ignoring Platform user input

    System -> B_Jumping = 1

    ADD Line #10:

    Condition:

    Sprite -> On collision with Sprite2

    Action:

    System -> Set B_Jumping = 0

    PROBLEM 2 -

    SOLUTION

    ADD Line #11:

    Condition:

    Sprite > On animation "Attacking" finished

    Action:

    Sprite > Set animation frame to 0

    Hope that helps!

    <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't even try yet but thanks. As i try i'll post the result.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)