Animation Woes

0 favourites
  • 14 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • What I'm trying to make is a character that moves in a "Castlevania" esq way.

    I can get many of the animations to work properly but they conflict with each other a lot. I'm fairly new with construct and have searched for a few hours and haven't found much to help me.

    If you go onto Youtube and look up something like Castlevania SOTN Richter you will be able to see what kind of thing I am going for. (Walk, jump, throw, whip, slide, ect).

    I just can't figure out a good system to make it work with. I have searched and tried many things but for some reason I just can't get it to work.

    Any help would be greatly appreciated.

    EDIT: My main problem at the moment is the fact that if I am moving he will not properly use either of his attacking animations (E and space bar) however, if I am just standing still then he will usually do them no problem.

  • If you are moving, then you are probably telling C2 to play the moving animation before the attack one has had a chance to barely get started...

  • If you are moving, then you are probably telling C2 to play the moving animation before the attack one has had a chance to barely get started...

    I understand that, but how do I fix it?

    I do tell the game to stop him from moving when the button gets pressed but it doesn't make a difference.

  • Check this other topic with a similar question that I answered recently: How do I stop an animation from overriding other user input?

  • Check this other topic with a similar question that I answered recently:

    Thanks a lot, I must have overlooked that thread when I was searching.

    Now my whipping animation works perfectly to the right but appears very low when I do it to the right..........

    My knife throwing animation doesn't do that and I have it set up the same way so I have no idea whats going on there.

    Also does anyone know why my character appears slightly inside the floor he is standing on?

    All help is appreciated, thanks.

  • You're rotating the whip and since its origin is not centered on the image of the whip itself, it rotates off center. You should use the action "mirror" to flip things from right to left. The knife is properly centered so you don't notice that it rotated.

    I don't see the character inside the floor here

  • You're rotating the whip and since its origin is not centered on the image of the whip itself, it rotates off center. You should use the action "mirror" to flip things from right to left. The knife is properly centered so you don't notice that it rotated.

    I don't see the character inside the floor here

    Oh I see thanks a bunch for that and he does sink in about a pixel or two into the floor and the platforms. He does it a lot if you destroy two of the blocks and only stand on one of them.

  • Ah, you just need to fix the collision polygon on the "player" object. The two points on the bottom are 1-2 pixels from the very bottom of the sprite

  • Ah, you just need to fix the collision polygon on the "player" object. The two points on the bottom are 1-2 pixels from the very bottom of the sprite

    Ok thanks, that helped a little bit.

    Do you think the way I am handling projectiles is going to be efficient later on in development? They just seem sort of buggy the way they are now.

    I know I'm asking a lot and I appreciate all the help.

    Like you said to use mirroring and that worked beautifully for the whip but when I try and do that for the "thrown" weapons they just fly in the same direction.

    Controls: A and D move. W Jump.

    S Changes Subweapon.

    Space Throws Weapon. E uses whip.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In my game (the one in my signature) I also have lots of weapons and you can shoot left and right. The way I did it is that the player has a variable called "direction", and when he faces right direction is 1, and left is -1. Bullets also have this variable, and it sets if it is mirrored or not

    The weapons all move based on math, so no behaviors. And instead of setting its angle, I use a variable to tell the angle of the weapon movement.

    Example:

    [attachment=0:yg47gghe][/attachment:yg47gghe]

  • In my game (the one in my signature) I also have lots of weapons and you can shoot left and right. The way I did it is that the player has a variable called "direction", and when he faces right direction is 1, and left is -1. Bullets also have this variable, and it sets if it is mirrored or not

    The weapons all move based on math, so no behaviors. And instead of setting its angle, I use a variable to tell the angle of the weapon movement.

    Example:

    [attachment=0:3aonz83i][/attachment:3aonz83i]

    So did you have to do this for each separate projectile or is there a way to...idk what I'm thinking of (heh).

    So what I should be doing is each weapon will have a variable for direction. But your math equation is giving me a headache.

    Self = Were the object actually spawns right?

    amovtype variable is the "angle" it moves and the second part is setting how fast it will fly?

    The rest is just whooshing over my head.

  • I'm using families to group all bullets. But appears you're using the free version so you'll have to do it for each separate object

    Let me break it down for you

    self.X+(sin(self.aAngleMov)*(dt*self.speed*(1-paused)))

    • Self refers to the object doing the action. Saying "Self.X" on an action for the "Bullet" is the same as saying "Bullet.X"
    • "sin(self.aAngleMov)" gets the X-component for the angle (while "cos(self.aAngleMov)" gets the Y-component)
    • "*(dt*self.speed*(1-paused))" is the speed. "dt" is so it moves at the same speed regardless of the fps. "speed" is an instance variable for the bullet. *(1-paused) is just because of how I made the pause in my game

    So in the end, you're setting the X of the bullet to

    "Its own X" plus "the X-component of its angle 'speed' times"

  • Oh no there just aren't any tutorials on families that I saw or anything like them.

    Wow this is going to make things a lot easier.

    Can't believe I was going to make a game without knowing what families are.

    So ill try making all the bullets into a family and come back with what happens

  • I'm using families to group all bullets. But appears you're using the free version so you'll have to do it for each separate object

    Let me break it down for you

    self.X+(sin(self.aAngleMov)*(dt*self.speed*(1-paused)))

    - Self refers to the object doing the action. Saying "Self.X" on an action for the "Bullet" is the same as saying "Bullet.X"

    - "sin(self.aAngleMov)" gets the X-component for the angle (while "cos(self.aAngleMov)" gets the Y-component)

    - "*(dt*self.speed*(1-paused))" is the speed. "dt" is so it moves at the same speed regardless of the fps. "speed" is an instance variable for the bullet. *(1-paused) is just because of how I made the pause in my game

    So in the end, you're setting the X of the bullet to

    "Its own X" plus "the X-component of its angle 'speed' times"

    Ok I see what your getting at and it does make sense, but I can't seem to make it select a weapon like the knife or the cross or axe it just keeps randomly selecting one. The projectiles also don't seem to go anywhere no matter what I set the angle/ speed too.

    Someone said I just spawn the knife and it takes on the "family properties" but that doesn't seem to work either.

    I'm sorry I'm such a pain but your help is greatly appreciated

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