How did it go today?
Pretty good! I had a minor meltdown when trying to change the bottle class sprite to our animated guy. A lot of the automation that exists isn't needed for the bottle since it's very simple which also meant a lot of manually finding the right values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Currently automation is turned off and every sprite bound is set manually:( | |
public void update(float dt) { | |
//matching our sprite to the b2body | |
setPosition(b2body.getPosition().x,// - orientations.get("smash").get(0).x / 165, | |
b2body.getPosition().y);// - orientations.get("smash").get(0).y / 240); | |
//set our hit effect's position to our b2body | |
hitEffect.setPosition(b2body.getPosition().x// - orientations.get("smash").get(0).x / 165 | |
, b2body.getPosition().y);// - orientations.get("smash").get(0).y / 240); | |
//this is a rectangle we build each update for our custom contact listener | |
currentBounds.clear(); | |
Hitbox tempBox = new Hitbox(); | |
tempBox.set( | |
b2body.getPosition().x, | |
b2body.getPosition().y, | |
bounds.get("bottlespinning").get(0).get(0).getWidth() / 400, | |
bounds.get("bottlespinning").get(0).get(0).getHeight() / 400); | |
//We currently don't have any need for the boxType but later it will be useful | |
//tempBox.boxType = bounds.get("smash").get(0).get(1).boxType; | |
currentBounds.add(tempBox); | |
if (currentState == State.BROKEN) { | |
if (hitByPlayer == true) { | |
//Play our hit effect | |
hitEffect.setRegion(hitEffect.impactAnimation.getKeyFrame(stateTimer, false)); | |
hitEffect.setBounds(this.getBoundingRectangle().getX(), | |
this.getBoundingRectangle().getY(), | |
this.getBoundingRectangle().getWidth() + 1f, | |
this.getBoundingRectangle().getHeight() + 1f | |
); | |
} | |
//our hit effect is always there, just usually invisible | |
else { | |
hitEffect.setRegion(hitEffect.getFrame(3)); | |
} | |
stateTimer += dt; | |
setRegion(bottleBreak.getKeyFrame(stateTimer, false)); | |
} else if (currentState == State.INITIATED) { | |
setRegion(bottleSpin.getKeyFrame(stateTimer, true)); | |
setBounds(b2body.getPosition().x - .26f | |
, b2body.getPosition().y - .3f | |
, 1, 1 | |
); | |
stateTimer += dt; | |
} | |
} |
On the art side we got a couple new prototype versions for bottles spinning, breaking, and the hit impact effect.
via GIPHY
Looks good, how do they look in the game?
Not bad! It's satisfying to hear the crash and see the little flash of light. It's hard to hit the bottles so it's more satisfying to finally get one. Right now all the bottle breaking sounds are the same. 'Crash Crash Crash' regardless of whether it hits the ground or we break it. Maybe if we make the bottle sound quieter when it's farther away, or hits the ground, we'll be even happier to break it.Video soon to follow!
What's next?
The project has been running from one big system to the next without trying to work from some grand plan or design. At some point we'll need to redesign the code. Probably that some point should come before the 60+ list of features still waiting to be implemented.
For now we'll continue hammering out the features needed to solidify the core game play experience.
- Character animations
- Character struck reaction
- Hud UI elements
- Background animations
- Combo hit system
- Sounds sounds sounds!
And many others. Later let's look at those animation effects in detail because the Blaz Blue 3 sprites are exceptionally helpful references!
No comments:
Post a Comment