Close combat attack? Like melee?! (HELP PLEASE!)

Hello! I'm just basically done, just need to make some more levels & I'm done. Is it possible to do close combat? Like lets say i have two actors one is a good guy and the other is bad, they both have swords. I really want my actor to hit it and kill it, lets say it takes 3 hits to kill the bad guy (& later on as the levels get harder it takes like 5 hits to kill and so on)... How on earth would I make this happen? Also I would like the bad guy to take away some of the good guys life (lets say the good guy has 3 lives). I would like the bad guy to take away some of the good guys life so its more of a melee.

What would I use to make everything come together? I tried using collides and timers. Maybe I just didn't code them right.

I really need your guys help on this one big time! Anything will help me a lot!

Thanks :)

Comments

  • MoikMoik Member, PRO Posts: 257
    edited May 2014

    I'm thinking have an invisible actor Constrained to each combatant with size equal to the sword swing arc. Then, each time you process an attack, have it check if the actual actor overlaps the sword swing actor. If so, have that actor lose one health with Change Attribute (game.HeroCurrentHP) = (game.HeroCurrentHP)-1.

    To make them get harder, just attach a Change Attribute to whatever process occurs when the level ends and the scene changes to make (game.EnemyMaxHP) = (game.EnemyMaxHP)+1

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    Okay I constrained it to the good guy so where ever he moves it follows. I can't just constrain it to the sword because it's just one animation. So will that work?

    Next question, should I make hit points, or does the HeroCurrnet & EnemyMax take the place of the hit points? Also want I wanna ask is the HeroCurrnet & EnemyMax are they Real Attribute? @Moik‌

  • MoikMoik Member, PRO Posts: 257

    Its correct to constrain the swingbox to the character rather than the animation.

    Current/Max are how I would express them. It may not be necessary in your set-up. Separating Current and Max only really matters if you have healing or regeneration.

    I'm not sure about the difference between Real and Integer. I suspect either is fine.

Sign In or Register to comment.