Translations

Know another language? Translate this tutorial!

How to make a player attack

Favourite 38 favourites
Tutorial written by SrDeenisOriginally published on 30th, September 2012 - 2 revisions

How to make a player attack

First read the tutorial How to make a Platform game

This tutorial is a "continuation" of "How to make a Platform game".

Now how make a player atack: in player add a animation for the atack, my animation name is Ata. In PlayerBox add a instace variable


now go event sheet add event: key on pressed, put key space, and add sub event: playerbox istanci variable, is boolean istanci variable set, invert the event, add action: playerbox instanci variable, set boolean, true.


now go event sheet add event: playerbox istanci variable, is boolean istanci variable set, add action: player set animation "Ata". now add sub event: Play on colisium with Snailenemy, add action: snailenemy destroy


now go event sheet add event play animation on finish "Ata", add action: player box set boolean false. add sub event playerbox is moving, add
action: player set animation "Run", add sub event playervox is moving, invert, add action: player set animation "Idle".


now the rest we will check with the animation is atack or not atack, images of event sheet:


Open full size image

Open full size image

Open full size image

Open full size image

Unlock your full gamedev potential

Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!

View deals

Plus, it's got a lot of additional features that will help you save time and make more impressive games!

Congratulations on finishing this tutorial!

Did you learn a lot from it? Share it now with your friends!

Comments

0
urbano 5,099 rep

Interesting, I saw another capx the forum, which was also pretty cool, then want an example I made up. good work

Monday, October 01, 2012 at 12:43:32 PM
0
Cpryd001 4,520 rep

Nice tutorial! I hope someone can go in and spell check and clean up some of the images. (Cut the taskbar out) Excellent job!

Friday, November 09, 2012 at 5:52:03 AM
0
r4dicaldreamer 3,240 rep

very helpful :)

Monday, February 04, 2013 at 5:13:13 AM
0
piszozo 3,386 rep

thank you for that guide

Thursday, July 11, 2013 at 12:11:54 AM
0
drakima 1,451 rep

I just left a comment recently on the "How to make a Platform game" tutorial. I asked that their should have been a section that dealt with making use of the attack sprites in the asset bundle. However now that I found this tutorial I was able to implement the attack sprites so now I can move on to additional game logic for the game that I am making. Thanks for this tutorial.

Tuesday, March 25, 2014 at 5:37:30 AM
0
FabianB 650 rep

Thank you very much for the explanation :)

Saturday, June 03, 2017 at 1:04:35 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.