Improving the battle, fixing bugs
This commit is contained in:
1 parent
92929118d5
commit
33c2b313af
4 files changed
+36
-1
No files matched your search
@@ -487,6 +487,9 @@ void Character::draw(Renderer& renderer) {
|
||||
hitSparkEmitter.draw(renderer, 1.0f, Environment::width, Environment::height, false);
|
||||
}
|
||||
|
||||
renderer.RenderUniform1f("uAlpha", 1.0f);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
if (!state.enabled) return;
|
||||
|
||||
if (state.useGpuSkinning) {
|
||||
@@ -609,6 +612,22 @@ bool Character::prepareGpuSkinning() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Character::tryAttackCombo()
|
||||
{
|
||||
std::cout << "Try Attack Combo" << std::endl;
|
||||
auto it = animations.find(state.currentState);
|
||||
if (it == animations.end()) return;
|
||||
|
||||
auto& anim = it->second;
|
||||
|
||||
if (static_cast<int>(anim.currentFrame) >= 20 &&
|
||||
(state.currentState == AnimationState::ACTION_ATTACK ||
|
||||
state.currentState == AnimationState::ACTION_ATTACK_2)) {
|
||||
std::cout << "Try Attack Combo Success" << std::endl;
|
||||
anim.currentFrame = anim.model.startingFrame;
|
||||
}
|
||||
}
|
||||
|
||||
void Character::drawAttachedWeapon(Renderer& renderer) {
|
||||
if (!state.showWeapon) return;
|
||||
if (weaponMesh.data.PositionData.size() == 0 || !weaponTexture) return;
|
||||
|
||||
Reference in new issue
Block a user