1 hit attack

For questions about using Classic.

Post » Tue Oct 25, 2011 3:15 am

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

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



Here's my .cap

https://dl-web.dropbox.com/get/attacktest.cap?w=2a7be200
B
4
G
1
Posts: 17
Reputation: 634

Post » Wed Oct 26, 2011 4:55 am

I couldn't download the cap. Try reacquiring a public link? Or reuploading?
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Wed Oct 26, 2011 8:07 am

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?
B
3
G
1
Posts: 44
Reputation: 563

Post » Wed Oct 26, 2011 11:16 pm

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

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


B
4
G
1
Posts: 17
Reputation: 634

Post » Thu Oct 27, 2011 5:52 am

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.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Thu Oct 27, 2011 10:24 pm

Ugh... How embarrassing Okay, yes that is the wrong file... Sorry about that guys. I re-checked it to make sure this IS the file... FOR SURE!

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

http://dl.dropbox.com/u/38448449/attacktest.cap
B
4
G
1
Posts: 17
Reputation: 634

Post » Fri Oct 28, 2011 8:57 am

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.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Fri Oct 28, 2011 4:26 pm

I would appreciate that very much Steven
B
4
G
1
Posts: 17
Reputation: 634

Post » Fri Oct 28, 2011 8:43 pm

http://dl.dropbox.com/u/1487524/Scirra/SingleAttackExample.cap

There you go chap, if you have any questions feel free to ask.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Fri Oct 28, 2011 10:24 pm

OUT OF SIGHT!!

Thank you very man this is awesome!!! I finally get it now! Man, and it's just that simple huh?

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 Or need new glasses

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.

Anyways...

Thank you again!!!
B
4
G
1
Posts: 17
Reputation: 634

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests