1 hit attack

This forum is currently in read-only mode.
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • Hello all, I am having troubles with my code for making the Player character attack for my action platformer game... More or less, the animation when the character hits the ground the first frame of the attack sprite shows instead of it standing.

    I tried to sorta of mimic the "fighter tutorial" created by UberLou. Instead of using 3 hit combos, just have one single attack animation when pressing the attack button. My code won't even play that.

    It's also hard to tell if the hitbox sprite shows on the attack because I can't get the attack to work properly.

    If some could take a peak at it or make an alternative to make it more easier it would be ~GREATLY appreciated~ either ways is fine for me...

    I been struggling though this for some days now.

    Sorry for the not so neat sprites I was rushing a bit to get the test file created.

    Here's the link to the Forum of the fighter tutorial i used a reference included with his .cap file

    scirra.com/forum/tutorial-fighter-updated-9-15-10_topic40104.html

    Here's my .cap

    dl-web.dropbox.com/get/attacktest.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I couldn't download the cap. Try reacquiring a public link? Or reuploading?

  • Yeah I can't dl it too.

    I have a suggestion though.

    Instead of using a hit box why don't u just work out the distance the animation does it's attack? Bare with me for a moment. It's a 2D platformer right? Sidescroller? If that's so and I assume it's left or right direction of attack the logic should be:

    • Attack Button Pushed & player is facing 'left' (or right)

    + Play the Animation Sequence Attack

    + Maybe sound too

    -- If target (or could use 'any object') is within the distance of attack (depends on left or right)

    ++ Take Damage?

  • Whoopsies!!! Sorry about that guys I thought I sent it to the public folder... I guess not.

    jangsy5 Thanks, I'll give it a shot tonight to see if that works, I'm not at my home computer at the moment. But just in case I will re-upload the .cap file.

    Here's the .cap for reals

    dl.dropbox.com/u/38448449/testm.cap

  • I think you have put the wrong cap up chap, there are no events at all in this one for attacking.

    a common mistake with animations is triggering them constantly, might need to add a trigger once while true condition in there somewhere.

  • Ugh... How embarrassing <img src="smileys/smiley29.gif" border="0" align="middle" /> Okay, yes that is the wrong file... Sorry about that guys. I re-checked it to make sure this IS the file... FOR SURE! <img src="smileys/smiley26.gif" border="0" align="middle" />

    Here is the true .cap file, For reals For reals, this time and the last time.

    dl.dropbox.com/u/38448449/attacktest.cap

  • So you are wanting to make a single strike attack? Nothing more complicated than that?

    What you have there is massively complicated, something simpler might be more appropriate.

    If this is the case, I can try to whip something simpler up for you.

  • I would appreciate that very much Steven <img src="smileys/smiley4.gif" border="0" align="middle" />

  • dl.dropbox.com/u/1487524/Scirra/SingleAttackExample.cap

    There you go chap, if you have any questions feel free to ask.

  • OUT OF SIGHT!! <img src="smileys/smiley32.gif" border="0" align="middle" />

    Thank you very man this is awesome!!! I finally get it now! Man, and it's just that simple huh? <img src="smileys/smiley3.gif" border="0" align="middle" />

    I do have a few questions regarding this .cap file. 1. I notice when you attack the player lunges slightly forward with his attack. Where about in the events can you edit that? Cuz I don't see it... or maybe I'm over looking it <img src="smileys/smiley29.gif" border="0" align="middle" /> Or need new glasses <img src="smileys/smiley23.gif" border="0" align="middle" />

    2. How did you issue the "A" key as the attack without using any events for the key?... Probably looking over that too. Maybe because I am excite with this out come. I guess it doesn't help that I am fairly new to Construct as well.<img src="smileys/smiley36.gif" border="0" align="middle" />

    Anyways...

    Thank you again!!! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Ok, there are sub events tucked away, that is where the A key attack is set, and also where the lunge is being set, click on the little plus in the top left corner of the events to see the sub events.

    Event 42 is the key down. The lunge is in the sub event of 42.

  • Uh-huh!

    Ah, yes I see, I see Okay that answers that.

    Well, Again thanks many for your help! <img src="smileys/smiley42.gif" border="0" align="middle" />

  • Oh! Oh! One last thing Bud! When the Player jumps and attacks, while pressing or holding right or left in the air, He just falls straight down during the animation attack.

    I know it has to do with something with the "Ignore Player Input" event is there a way around that? Where he is not falling down if he trying to attack a flying enemy, Boss character, etc? <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Right click on the "ignore Player Input" and toggle it off to see if that gives you the sort of movement you are after.

    Ignoring the player input is not a necessary component, just a visual flare, see if it plays the way you want without it.

  • Ah yes Indeed! I also make some slight changes. I made an extra "On key A pressed" underneath the original.

    for the original I made a if "maskplayer" is "jumping or falling" toggle "start ignoring user input".

    On the new :On key A pressed" if "maksplayer" is on the ground "start ignoring user input".

    Therefore, when player is in the air he won't fall straight down. But gives him a bit momentum in the air, amusing you are hold the left or right keys. On the ground he is not mobile while attacking even when holding left or right during attacking.

    This is what originally aiming for.<img src="smileys/smiley2.gif" border="0" align="middle" />

    Again, Thank you sooooooooo much for the .cap edit and sharing your knowledge of Construct! <img src="smileys/smiley20.gif" border="0" align="middle" />

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