How do i make my character punch?

The title pratically says all, i want to make my character attack enemies by punching, the thing is... idk how to do it :/, don't know how to trigger the animation (actually i kind of know, but he would be stuck in that animation) and don't know how to set its collisions to kill the enemies, can you guys help me?

dipstick5000

  • Posts: 47
I'm fairly new to Stencyl, but deep into my 2nd game, but since nobody has answered yet, I'll try. First of all I recommend doing a couple practice games that are tutorials, that are similar to what you are trying to do.

I would use Photoshop (expensive) or Gimp (free) to make at least two images of your actor, one normal and one with a punch thrown, or grab 2 images from the internet if you're not worried about copyrights. Or get free images in the packs offered here. More images (frames) make it smoother, but there are of course disadvantages as well. Import the 2 images into one actor in Stencyl, experiment and adjust the frame timing to your liking. You can customize the collision zone of each frame I believe, or maybe it's just the whole actor. Been awhile since I did that.

You could trigger your animation various ways, like on a mouse click event, but you probably want to trigger it with a collision event. I am rusty on the collisions, it's been a couple years. My current game has none. You can start and stop your animation or switch to certain frames, see attached. You can make it loop or not loop.

I realize I may not be much help here, but I try since the people here are nice and usually help me. If I could offer one piece of advice, it's do the tutorial games, or at least the pertinent ones. I often don't want to, but I'm always glad I did. It definitely saves time overall.
Tonight I'll make a game like Skyrim or Call of Duty. It'll be called Delusional.

dipstick5000

  • Posts: 47
Also, regions. I remember I used them a lot in my first game. You can make a lot of stuff happen or stop happening when an actor enters a region. Again, tutorial.
Tonight I'll make a game like Skyrim or Call of Duty. It'll be called Delusional.

Also, regions. I remember I used them a lot in my first game. You can make a lot of stuff happen or stop happening when an actor enters a region. Again, tutorial.

Well... i got a little problem, my character only use behaviors, so i the code aparently has no effect, is there any other way i can do this? or use other code maybe?

dipstick5000

  • Posts: 47
I often have trouble with behaviors, and sometimes end up using events instead. It seems you can use more variables (attributes), and some other things seem to work out better. I'm still not sure of the difference of the two. If I understand correctly, events are supposed to help behaviors, or be used in behaviors, but I find they work just fine on their own. Again, I'm a novice, so sorry if I'm not much help.
Tonight I'll make a game like Skyrim or Call of Duty. It'll be called Delusional.

I often have trouble with behaviors, and sometimes end up using events instead. It seems you can use more variables (attributes), and some other things seem to work out better. I'm still not sure of the difference of the two. If I understand correctly, events are supposed to help behaviors, or be used in behaviors, but I find they work just fine on their own. Again, I'm a novice, so sorry if I'm not much help.

Im a novice to stencyl too, however i know less about how to use it than you do :/
i have to watch more tutorials...

Bombini

  • *
  • Posts: 1400
Your question is difficult to answer without a screenshot or some code you have.
Punching an enemy can be done very simple or very complicated.

How is your approach?