How to make a player atack

1
  • 33 favourites

Stats

6,434 visits, 10,347 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

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:

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!