punch/being punched

0 favourites
  • 10 posts
From the Asset Store
115 cool sounds for fighting projects (suitable video games, or other creations)
  • Hi, I'm new to Construct 2 program.

    I followed the platform tutorial and I learned a lot, but I want to make a platformer/side-scroller beat them up game with multiple levels.

    First thing I noticed that I need to know was, if I want to program a punch, is there a way to make only the punching hand (and not the whole character sprite) deal damage to the enemy? can I make like a 3 hit combo (meaning like 3 different types of punches) by tapping the same button once?

    Also, in the tutorial, it said that I should use an object similar to how "playerBox" for an enemy similar to how it was used for player in the tutorial? I want my enemy to be hittable several times before dying.

    The player and the enemy are both persons, so hopefully you get the idea. You beat up all the enemies by punching them repeatedly.

    thanks in advance. thank you for the awesome Construct 2 program even more.

  • Hold on, I am searching for the correct tutorial.

  • hmmm. thanks. Seems like a more advanced tutorial than the beginner one. Actually, it definitely is more advanced.

    Can I start editing his .capx file? Is it allowed?

    I want to make a platform side scroller beat em up game, not a 1 vs 1 fighting game.

    I think he did not cover how to make the enemy get hurt from the player's attacks. I would also like to learn how to make enemy go up in air (like if I use an uppercut) before falling down to ground.

    Thanks again.

  • Basically, fighting games are beat 'em ups, technically, but with levels and enemies and stuff.

    How to make stuff get hurt is explained in the novice tutorial you must have read of. Or do you mean you want them to play an animation when they get hurt?

    Swinging stuff up is used through y vectors, in the set x/y vector action, which belongs to the platform behavior.

    And, you know? For starters, you should make your character not punch, but create a projectile that shoots, or an explosion, like in my Action Gamemaster game when you press Z. That is, for starters. Trying to do punches and stuff is complex, and you should learn more about C2 engine before that. For now, try to develop the rest of the game while punches and kicks and stuff are substituted with something simpler. Or, you might try to create a different kind of game just for training.

  • editing his capx is fine, but only for training.

  • What games like this do is create Hit Box sprites.

    Here is a good example, the Red Box is the hit box.

    <img src="http://img189.imageshack.us/img189/6738/drshoryu.png" border="0" />

    Those sprites are created during the animation of the move, but are invisible sprites so you don't see them. However, they are what the game uses for collision detection. The blue boxes are where the character can be hit during that particular frame of animation.

    So in your case, say you have a 6 frame animation for your punch. In Construct you would say When Animation is at Frame 2, create hitbox sprite at the right locations (usually using an image point). When the animation is at frame 6, destroy the hitbox sprite.

    Then you just check for collision with that hitbox sprite. Make sense?

  • Thanks for the replies.

    I am preparing first the platform (BG and floor) before I start programming any attacks.

    I can try coding a projectile for the learning aspect, but my char just punches and kicks.

    I want to learn how to do 3 kinds of hurt:

    • items (you hit a box and the box shows a breaking animation before disappearing)
    • goons enemies (you hit them, they show hurt animation, then they go back to idle and can attack if they are still alive, OR disappear if they are dead)
    • bosses (basically like a player complete with animations for idle, walk, jump, attacks, probably add even stand hurt, air hurt, lie down, get up, etc.) this one's the enemy you can uppercut and he will go up in the air before falling (lie down, get up)

    so since I know how hitboxes work, I have a few questions regarding how it is implmented in C2:

    • should both attacker and the item/enemy being hit be programmed to detect the collision?
    • in the point of view of the player (attacker), in the tutorial, there was a playerBox that does most of the functions of the player, so will the playerBox be the one detecting both the attacking and being attacked aspects of the player?
    • should I use "object in contact with another object" event for hitbox collision? not sure how exactly to implement it but that's the first event that came to my mind for this
    • in the point of view of the player (attacker), in the tutorial, there was a playerBox that does most of the functions of the player, so will the playerBox be the one detecting both the attacking and being attacked aspects of the player?

    YES

    • should I use "object in contact with another object" event for hitbox collision? not sure how exactly to implement it but that's the first event that came to my mind for this

    YES there is a condition called on collision with

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ok thanks. I will try coding a punch later. I just made 2 layouts now. There is a minor issue in the 2nd layout.

    My layers are in this order:

    Main screen

    Background and floor (1 single sprite) with transparent at the top (png file)

    Sky background

    the background layer over the sky is not showing the sky. C2 doesn't recognize the transparency of the png?

    Right now, I just pasted the BG sprite over the sky sprite in the same level (Background) and deleted the sky layer to make it work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)