Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enemy knockback #1860

Merged
merged 5 commits into from
Nov 17, 2013
Merged

Enemy knockback #1860

merged 5 commits into from
Nov 17, 2013

Conversation

bucketh3ad
Copy link
Member

Closes #1800

To do before merging:

  • Finalize knockback values
  • Add animation, rather than immediate position switching.
  • Incorporate an exception for bosses and static enemies

@didory123
Copy link
Member

Hmm, I like what you've got so far. Definitely very crude, but it's still improving our boring enemies by a lot.
To make the knockback transition look smoother, can we make the enemy 'jump' back like the player does when hit? Hurt animations will be more annoying, but I think it'll actually be a fairly easy job for most enemies (just add popping eyes with outstretched legs)

@bucketh3ad
Copy link
Member Author

I'll work on adding a fluid 'jump' motion for enemies this afternoon.

I also want to vary the knockback somewhat so it doesn't end up being too boring and predictable. As far as variation, should we have different weapons inflict different amounts of knockback, or should we have different enemies react to being knocked back differently? Both?

@CalebJohn
Copy link
Member

I think both would be pretty cool

@didory123
Copy link
Member

Different weapons inflicting different amounts might cause slight problems though. If we're considering 'heavier' weapons to inflict more distance, the player will just be able to button mash enemies again since the main disadvantage of those weapons is the slow speed.

On another note, maybe we can consider having 'combo' attacks? If the player hits them twice in a row in a certain time interval, the enemy is knocked back further? That might be a bit too complicated though, so just spitballing ideas here.

@bucketh3ad
Copy link
Member Author

@didory123 I'm thinking it would be better for weaker weapons, like the switch and projectiles, to have a smaller knockback than normal, rather than stronger weapons having a bigger knockback.

@bucketh3ad
Copy link
Member Author

The updated version has a significant delay after damage before the knockback effect, which I don't want but can't figure out how to eliminate. Someone with more experience working with the animation code mind taking a look?

The 'combo' effect that @didory123 mentioned ended up being included as an unintended side effect. Double punch some hippies and watch them go flying!

@bucketh3ad
Copy link
Member Author

Knockback on flying and falling enemies behaves as midair horizontal motion.

I made a separate issue, #1886, to track the problem with hitting enemies midair since this bug is also present in the master branch.

@didory123
Copy link
Member

LGTM

@didory123
Copy link
Member

Actually, with this pull, it's almost impossible to be killed by enemies when you have a weapon. Since our attacks have almost zero delay between then, you can just button mash and push the enemies away and let them come to you.

@bucketh3ad
Copy link
Member Author

I halved the default value of the weapon knockback, added the option to set each weapon's knockback, and removed the combo effect from enemies.

I also set the punch knockback to trigger only when player.punchKnockback is true. I figure we can use that for an item like a kickpuncher glove to give punches the power of kicks.

This should be ready to merge, as long as @didory123 approves of the new knockback values.

@didory123
Copy link
Member

Just a few minor things:

I think that we should increase the weapon knockback value a tiny bit more. Hopefully when #1895 is fixed, it'll make the knockbacks smoother and better.

Also, when attacking an enemy from behind, the enemy should turn around to face the player and then get pushed back. Otherwise, everything else looks really good and ready to merge. Awesome job!

@danhp
Copy link
Member

danhp commented Nov 15, 2013

It's pretty clean as is.

Only question: do all weapons currently give the same knockback distance?

@bucketh3ad
Copy link
Member Author

Currently, all weapons use the default knockback (I'm going to boost it again slightly from 10 to 12)

If the weapon has a knockback property, it will use that value instead.

@didory123
Copy link
Member

@bucketh3ad Any more headway on this?

@danhp
Copy link
Member

danhp commented Nov 17, 2013

I call merge as we're at the stage of messing around with slight number changes just to get some physics. Most of all the code we'll likely need is in.

As for the enemy turning around... why? When you push someone from the back do you expect them not to fall on their face???

Edit: Jumpkill might need some tweaking to not just trampoline an enemy.

@didory123
Copy link
Member

@daniwa bucket actually convinced me of not doing the turning around thing way before, so I'm fine with not having it. As for the values, I'm actually not too passionate about it either I just want to get this thing in soon.

Merge?

@danhp
Copy link
Member

danhp commented Nov 17, 2013

jumpkill knockback? or would that be weird.

@didory123
Copy link
Member

@daniwa bucket says it looks weird, so he didn't do it. We can change individual enemy behaviors when being jumpkilled though

@danhp
Copy link
Member

danhp commented Nov 17, 2013

Then merge it!

@bucketh3ad
Copy link
Member Author

I played some more, and I think 10 works fine as a default. We can always adjust it later if we want. This is ready to merge.

didory123 added a commit that referenced this pull request Nov 17, 2013
@didory123 didory123 merged commit 62325df into hawkthorne:master Nov 17, 2013
@CalebJohn CalebJohn mentioned this pull request Dec 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enemy knockback
4 participants