Doubts with animation by melee attack

Get help using Construct 2

Post » Wed Jan 18, 2012 7:01 pm

Hello everyone,

Only a few months I started messing with the Construct2 and the manuals and some topics of the forum here I learned a lot of things. I am very grateful to everyone for that.

With that I started my project.
I'm making a platform game with a hero who basically will have melee attacks, transformations and a lot of other things that I still have to learn how.

Well, I have the sprites with animated movements, and has managed to do the basic game play, runs right left, jumps, lands, in order the basics .... But now I am studying how to make him defer attack, sprites and have even tried to do something like this:

condition:
    press space
    is on the floor

action:
    Set Animation "1hit"


It does not work .. Can someone please give a hint or show some good example of something ...

Ps: Sorry if this is repeated, but I found nothing specific like that, so ...


Thank you.
B
6
G
1
Posts: 14
Reputation: 1,378

Post » Wed Jan 18, 2012 7:07 pm

I have never had a problem with animation but I'm sure it's probably simple like the capitalisation of the h
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Wed Jan 18, 2012 7:18 pm

The animation to happen, but only when the player is running, and stop other animations work properly while you are pressing the attack button.

Here Capx: http://dl.dropbox.com/u/55988144/Temp/Project_test.capx


B
6
G
1
Posts: 14
Reputation: 1,378

Post » Wed Jan 18, 2012 11:06 pm

Here is a quick fix based off what I'm currently doing for my own game, although it's probably not the best solution so if anyone has any better approach I'd also be pretty interested to hear it.

http://dl.dropbox.com/u/56373295/Construct%202%20Files/Melee%20attack.capx

All I've done is create an event which checks that "1hit" isn't playing and made all the other animation events a sub-event of that one. I also have one more event which is not a sub-event that checks when "1Hit" is finished and sets the animation back to "Parado".

On a somewhat related note how come Construct 2 considers an animation to be playing even if it has reached the end of its frames is there some kind of setting I need to change? I know it's only a few extra events but I'm not keen on having to put in an event for each attack which tells construct 2 to change animations once its finished.
Vercingetorix2012-01-18 23:23:04
B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Wed Jan 18, 2012 11:46 pm

Ah ninja Vercingetorix.

Well, I have made quite a few other change.
Note that you don't have to duplicate action anymmore for your Wolf or Normal mode. It's all handled in a global variable (can be an instance variable if you want too, it's programming design choice)
Also I prefer to use a boolean to check if you are attacking. It's the same idea as Vercingetorix but I like booleans :D (programming design choice too).
And using a boolean can also help on @Vercingetorix's "related note" I guess

Also drxbellini you should be carefull about your platform collision. I'll explain it to you with ASCII art now :D
If your colision are like that   \______/   you will get stuck when you are against the platform and try to jump.
So I modified the polygon to be more like |_____|
Actually I even at little tiny unperceptibly pushed a bit toward /___\ just because there's no alignement system for collision point yet so I wasn't 100% sure they were vertical.

Here is the capx
beliniPlatformer.capx
Last edited by Yann on Sun Sep 14, 2014 9:56 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 19, 2012 4:29 pm

Thank you so much everyone for all the attention and time spent on it.

I am grateful for the help ... really thank you ...
B
6
G
1
Posts: 14
Reputation: 1,378

Post » Thu Jan 19, 2012 4:36 pm

Looks good drxbelini.
B
192
S
6
G
7
Posts: 213
Reputation: 10,178


Return to How do I....?

Who is online

Users browsing this forum: Colorfish, imothep85, tatogame, Yahoo [Bot] and 10 guests