Better Results Here

ACLP15

  • Posts: 23
Maybe I'll get better results here than in developer exchange.

I need help making a punch behavior for a platformer. I Have one semi started but it won't do anything.


I can Upload a demo with enemy and Kill tile place holders after I get my guy to punch.

Ok so my character can Punch now, but only in one direction and do no damage.
Here is a picture of the code.
The comment things are copied from the Jumping behavior in the run and jump set

« Last Edit: May 18, 2012, 11:21:44 pm by ACLP15 »

GreenGuy

  • Posts: 101
I'm fairly new to coding and never figured out what an offset does... mind explaining it to me please?
then i may be able to help
________________,.-*'Renewal'*-.,________________
http://community.stencyl.com/index.php/topic,10615.0.html
------------------------'*-.,Renewal,.-*'------------------------

skyepilot2

  • Posts: 24
So basically to clear this up, what I see is

When you press the punch button

if you are on the ground and facing right it will damage enemies--or whatever else you are punching--
OR if you are on the ground saying you are not facing right (you have to be facing left) it will damage enemies to the left.

I can Upload a demo with enemy and Kill tile place holders after I get my guy to punch.

so here you are saying you can kill tile place holders?  I do not understand this, sorry I can't help... but I tried, and good luck with this.
Renewal Beta!!!!!!  test it out and give us some comments :D
http://community.stencyl.com/index.php/topic,10615.0.html

ACLP15

  • Posts: 23
I'm fairly new to coding and never figured out what an offset does... mind explaining it to me please?
then i may be able to help

It means it will move it on the X axis if you put 5
and same with the Y axis
So basically to clear this up, what I see is

When you press the punch button

if you are on the ground and facing right it will damage enemies--or whatever else you are punching--
OR if you are on the ground saying you are not facing right (you have to be facing left) it will damage enemies to the left.

I can Upload a demo with enemy and Kill tile place holders after I get my guy to punch.

so here you are saying you can kill tile place holders?  I do not understand this, sorry I can't help... but I tried, and good luck with this.
   Punch thing yes.

I will elaborate with the Kill tile. In my game I want to put in actors that look like tiles that kill you when you touch them. I just would like to get a demo out so people who help me wouldn't think I was asking for help for nothing. The tile place holders would just show where kill tiles would go.

skyepilot2

  • Posts: 24
O.K. so a "kill tile" is an actor that looks like a tile so that you can attack it.  I am pretty sure you could use an actual tile and kill that just make it differ slightly from your actual tile.  I saw a post where you can click a tile and it deletes it, berhaps you could do the same but instead of clicking, it would have to colide with your character while in the punch animation?

But I don't know much stencyl, so this is just an idea, I am trying to help out a bit, because helping you helps me.

Hope it helped? :S
Skye
Renewal Beta!!!!!!  test it out and give us some comments :D
http://community.stencyl.com/index.php/topic,10615.0.html

ACLP15

  • Posts: 23
I'll look into that. I don't need too much help with the tile though, I need help with making my character punch. So far all I've gotten out of this is a big ol bag of nothing

ACLP15

  • Posts: 23
Ok so my character can Punch now, but only in one direction and do no damage.
Here is a picture of the code.
The comment things are copied from the Jumping behavior in the run and jump set.

Xietao

  • Posts: 725
Sorry, this behavior can't work properly because you can't set the friction larger than 1 or smaller than 0
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

ACLP15

  • Posts: 23
Ok, so I can now punch left and right and only when he is on the ground, but I want him to stop when he is punching. I set the X Speed to 0, but he stops only for a second then moves while punching. How would I make him stop moving during his punch?

Satyre

  • *
  • Posts: 270
Create a "punch" boolean and set it to true when the character punchs, and false after the punch has been done. When the punch is true, then don't let the player move.

I created a sample game with the behaviours, and how I would create the behaviours.
The sample contains a punching actor for both directions, an enemy with life points that decrease after beeing punched, stopping of the actor by punching.

It is on stencyl forge under the name " test punch platform "
This is how it looks

Left / Right to move, C to punch
<a href="http://static.stencyl.com/games/12852-2.swf" target="_blank" class="new_win">http://static.stencyl.com/games/12852-2.swf</a>

« Last Edit: May 28, 2012, 12:56:20 pm by Satyre »

ACLP15

  • Posts: 23
Satyre you are a saint among men thank you for all the help you have given me.  :D

Satyre

  • *
  • Posts: 270
No problem about the help, it is also helpful for one of my future projects ;)

I have updated the sample by using stencyl 2.1, it is now called "Jump'n'Run Fighter Sample". If I have some free time, I'll adjust the small glitches. Now you can run, jump, and punch the little guy, which has a health meter from the preshipped behaviours.