fighting game basics

Get help using Construct 2

Post » Tue Oct 01, 2013 9:41 am

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:
http://www.sendspace.com/file/q1u8h0

Situation of my game:
These are sample layouts
http://www.youtube.com/watch?v=Na_hJA3vLr4
http://www.youtube.com/watch?v=ii_Ve2OvfYw

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?sgn152013-10-01 09:45:08
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Tue Oct 01, 2013 9:56 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 01, 2013 9:58 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 01, 2013 10:18 am

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.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Wed Oct 02, 2013 4:45 am

@LittleStain
help again?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Wed Oct 02, 2013 7:58 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 04, 2013 10:40 am

@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


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)



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:

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? sgn152013-10-04 10:49:05
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Fri Oct 04, 2013 10:52 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 04, 2013 10:55 am

Did you create the graphics of your game yourself?
If so, great work!

btw, I've send you a personal message
LittleStain2013-10-04 11:07:01
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 04, 2013 11:47 am



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 ?
B
16
S
7
Posts: 301
Reputation: 2,726

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 6 guests