fighting game basics

0 favourites
  • 15 posts
From the Asset Store
A well commented fighting game template to learn from or use as a base for your own game!
  • Hi, I'm making a side scroller beat em up game based on the story of "One Piece" anime/manga.

    So far, I have added the player's movements, basic attacks (3 hit combo by pressing X button 3 times consecutively)

    Now, I know some people will tell me to search tutorials or post them here. I would like to tell that I have searched them all (or most of them) already. They're too advanced for me at this point. My brain can't digest those info all at once. I need to start from the basic level.

    Here is my file so far:

    sendspace.com/file/q1u8h0

    Situation of my game:

    These are sample layouts

    youtube.com/watch

    youtube.com/watch

    Basically, you (player) go through all enemies (goons that are easy to defeat) throughout the whole layout, then go to the end to clear the layout, then go to another layout and start another adventure. I HAVE NOT programmed the changing of layouts yet.

    I have goons (pirates that have instance variables called "Life" for their individual lives.

    BUG in my file so far:

    When I use 3 hit combo (press x 3 times) then run/walk then use combo again and run/walk, sometimes I get stuck in a position and I CAN'T do anything (walk/run/jump/attack).

    I want to learn some other things:

    1) HIT BOXES / COLLISION BOXES

    I have already programmed the hitbox for an attack (using spawn another object) and made the attack actually hit the enemy (using on collision with another object).

    My questions are:

    1a) Do I use the same hitbox (just a small square sprite) for all of my player's different attacks?

    1b) If I want to inflict a damage of 30 for punch1 and 50 for punch2. How do I do that?

    1c) Is there a way to resize the HIT BOX if I would use the same hitbox for ALL ATTACKS?

    2) I want to push enemies when I use punch1 and I want to pull enemies towards me when I use punch2. How do I do that?

  • 1a Yes

    1b Enemy is hit - punch is punch1 - enemy.health deduct 30

       Enemy is hit - punch is punch2 - enemy.health deduct 50

    1c Yes punch is punch1 - hitbox set size to (whatever,whatever)

           punch is punch2 - hitbox set size to (whatever,whatever)

    2 on enemy hit - punch is punch1 - enemy set x to x+10

    on enemy hit - punch is punch2 - enemy set x to x-10

    So you'd have to have variables for punch, or just use the is animation punch1 playing. With punch 2 you could also pin the enemy to the hitbox or somthing like that.

  • As you say most tutorials are too advanced for you I just made the events as simple as I could, so you can learn the basics of event-making. If you want the events to be more advanced I'd recommend first learning the basics so you have more insight to what you are doing.

  • ok thanks. your responses are easily understandable. I'll try them later at home.

    Pardon these questions as I cannot try them at this moment (I'm using a different computer at work).

    Some more questions:

    1) If I want to make other kinds of goons objects (that also has their own animations for stance/walk/attack/hurt) BUT also function the same way as my current pirate goons, I have to use FAMILY right?

    2) Can I use FAMILY instead of pirate in the conditions and actions of events?

    3) What is a container? I tried searching "container" without quotes in the manual but I did not see any. There are other stuffs I thought I could see explanations of from the manual but I really did not saw any.

    4) If I would have a different player at the start of layout 2, does that NEW PLAYER object need to have his OWN PlayerBox as well?

    Thanks in advance.

  • LittleStain

    help again?

  • Families are a good way to organize different objects that have a lot of the same behaviours.

    Also I can recommend learning about functions. Add parameters to the functions called to make the same events work on different objects and/or parts of your game.

    here's the manual entry for containers

    You should try to re-use objects as much as possible. The playerbox shouldn't have to be different, especially if most events pertaining to it are the same.

  • LittleStain

    thanks. I read about the behaviors in the manual. I'm not sure I understood where to use some of them though.

    this is my layout

    <img src="http://neuropod.net/imagehost/uploads/d2e75339f8240b15aa601b3ee2cb2fe7.png" border="0" />

    RED rectangle - window size

    the char on the leftmost part - player

    green circles - goons/enemies

    blue circles - where I intend to put more goons

    blue rectangles all over the layout - invisible object with solid behavior (for floors//walls)

    What's a good logic to use for the AI of the goons ? like walking around randomly then go near me and attack me when I am near them (near an individual goon)

    <img src="http://neuropod.net/imagehost/uploads/2b036021e89e7d50221c4f04ed269204.png" border="0" />

    when I punch any single goon, all the other goons also show their hurt animation.

    I only want the single goon I hit/attacked to show their hurt animation

    and about the previous question I asked, about pushing enemies when I punch them, I tried using solid behavior on my attack hitbox. is it recommended to use solid on a hitbox?

    last question for now:

    <img src="http://neuropod.net/imagehost/uploads/0b8bf4cdd82ff0ccded63455c3022d36.png" border="0" />

    those are the frames of a swinging rope and the monkey sprite. those are separate. the monkey is supposed to be pinned to the circles at the end of the ropes.

    what should I use to do that? pin? container?

  • All goons are playing the animation for you're not picking the specific instance. The goon isn't referenced in the event, just the goonbox.

    This can probably be fixed by using a container and putting goon and goonbox in it. that way they are related at all times.

    AI is a difficult subject, because everyone wants something different. You could for instance do a for each check and a system compare distance(player.x,player.y,ggonbox.x,goonbox.y) < (a certain distance) and have the goon attack when that's true.

    You could use pin for the monkey, or set position. pin would probably work best here. Just make sure to pin the hand of the monkey to the bottom of the rope location only.

  • Did you create the graphics of your game yourself?

    If so, great work!

    btw, I've send you a personal message

  • <img src="http://neuropod.net/imagehost/uploads/c8546d375e89cfc929289c7787736dad.png" border="0" />

    can't reply/send pm to you/anyone else :

    how many rep do I need to send PMs? no clue how rep here increase either.

    anyway, the sprites I used were ripped from video games. I'm trying to make a game based on the story of "One Piece" (a japanese manga/anime). The sprites are for public use. I can give you the link to it if you want. I am also ripping sprites from games.

    I am still not familiar with the concept of container, among other concepts of C2.

    Just to be clear, this is my format so far:

    Goons (family)

    • Pirate with sword (stand) <----this is what I am only programming so far
    • Pirate with sword (air)
    • Pirate with knife
    • Pirate with bomb
    • Pirate with gun
    • many others I have planned

    Player (family)

    • Luffy (only player I have programmed right now)

    playerBox (platform body of objects from player family)

    playerAttackCLSN (hitbox for player's attacks)

    goonBox - platform body for goons objects

    In that layout screenshot, I put 4 instances of pirateSwordStand and 4 instances of goonbox (rectangle sprite). So if I use a container, I don't have to manually add a goonbox for each pirate I add to the layout?

    I don't understand how using a container will fix the single hurt animation issue. Shouldn't I use an instance variable instead since the hurt animation is per instance of the pirateSwordStand ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The container automatically associates the objects in it with eachother.

    So when goonbox is hit if you call the hurt animation for the goon it will automatically pick the assiciated goon.

  • Here is your rep page where you can see what you need to finish to get rewards.

    https://www.scirra.com/me/rep

    Be sure to Thumbs up all the good comments whenever a new update or blog comes out, and vote on games in the arcade.

    I believe you need 500 to PM.

  • sgn15 the error you got comes when you remain on the reply page for more than I think 10 minutes or so. So the best thing is to type on notepad or some other software and than just paste on the reply text and you won't go wrong. <img src="smileys/smiley4.gif" border="0" align="middle" />

    Hope that helps. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • LittleStain

    I read the manual about containers again. I understand the effect of making a container but the actual container in the example is vague (for me). In the example, there is a container that contains both the base and the turret? Am I right? or is the base the container that contains the turret?

    In my case, I should select GoonBox and click create container and select PirateSwordStand? or vice versa?

    I tried both and in both cases, I got this error message when running the layout

    Javascript error! TypeError: cur_frame is undefined localhost/Sprite_plugin.js, line 803 (col undefined) This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!

    Paradox

    ok thanks. At first I assumed some staffs was increasing the rep of members posting.

    thehorseman007

    that message appeared when I tried to reply to a PM, but yeah I encountered that while posting too. Thanks.

  • That error message doesn't seem to have anything to do with the container, for it speaks of Sprite-plugin.

    It could be that adding the container broke some of your events, because of instances still in your layout that weren't correctly referenced anymore. But I haven't had this error myself.

    If you could send me your capx, either through the forum or on my email (which I send in my PM) I'll take a look.

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