Terraria Sword Swing Advice

0 favourites
  • 12 posts
From the Asset Store
An advanced inventory example similar to Terraria.
  • Im looking to get some help with my player attack.I want to make a sword swing motion like terraria and i have all the sprites to do so.I am failing at actually pinning and making the sword swing lined up with my arms swing animation.

    The Terraria sword has an image point at the bottom of the hilt of the sword. And, it sets the position of that image point to the same position where the player's hand is every tick.

    But how do i achieve this in construct? is it possible to recreate?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cant you just set an imagepoint at the sword hilt, and go through your animation sprites and make sure that imagepoint is where you want it to be for each frame.

    The set the swing animation to that imagepoint position each tick.

  • cvp the issue im having is getting it to follow my arm attack animation.I understand the concept but im failing somewhere.

    i have my image points set but i cant get my pickaxe to follow the image point like it should.

  • Do you have an example capx? or could you make one(if you cant compromise your development)? then it might be easier to help.

  • Something like this?

    .capx

    Or am I not getting the point? <img src="smileys/smiley1.gif" border="0" align="middle">

    You are welcome to use the awesome graphics... no royalties needed <img src="smileys/smiley17.gif" border="0" align="middle">

  • cvp

    im not sure what im doing wrong but its not working the way it should for me,do i have to place the tool in the players hand like you are doing?

    i have multiple animations if that helps to know.the sword/tool wont we out until the player swings.

  • That should not be necessary. The set X and set Y is setting the position of the axe.

    You just need to make sure you have the imagepoint on every frame of the animation you are attaching it to, and then make sure to attach the animation you are running to that imagepoint.

    If you want you can throw me a personal message with your file, and I will be happy to help you out if I can.

  • cvp

    im going to go ahead and send you that PM so you can check this out for me,Im not sure what i m doing wrong.I did everything like you said to do it.Thank you for ofering you help in the matter.

    PM is coming your way.

  • I have send you a suggestion fix in a PM. Feel free to update the community with a note of what and how it works if it solves your problem <img src="smileys/smiley1.gif" border="0" align="middle" />

  • cvp

    So in basic terms all i needed was this piece of information.

    i knew i was doing something wrong,thank you for showing me how to attach angles to imagepoints through expressions.i never knew how to achieve that before.

    angle(player_arms.X, player_arms.Y, player_arms.ImagePointX(1),player_arms.ImagePointY(1))

  • lol back up.

    For your player object.. animate him attacking with the weapon, then erase the weapon.

    For your weapon object.. use the same frames but erase the player.

    Since they were the exact same frames & hotspots, they will align perfectly. Crop all the frames & set collision polys when you're done and you're good to go.

  • there is actually a nice tutorial in youtube. The channel is called "ConstructDude" or something and he explains how to make such a "terraria" swinging sword animation quite nicely. Maybie you should check it out in addition.

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