-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add Pokeball animations #734
Add Pokeball animations #734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty close to completion?
/** | ||
* Uses an item. | ||
*/ | ||
export class Item<TGameStartr extends FullScreenPokemon> extends GeneralComponent<TGameStartr> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's confusing to me how this is called Item
but refers to the animation (Move
is also confusing, but I can fix that later). Let's rename it to ItemAnimation
.
this.teamAndAction = teamAndAction; | ||
this.item = item; | ||
|
||
const battleInfo: IBattleInfo = gameStarter.battleMover.getBattleInfo() as IBattleInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this PR goes in, please file a followup issue to consolidate this class with the Move
class. Not your responsibility, but it'll be good code cleanup.
IMO there should be one general class used for both.
*/ | ||
public makeBattleBall(): IBattleBall { | ||
let probability = 0; | ||
if (this.item === "Poke") { //should this be Poke? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip: use an object of type { [i: string]: number }
so you don't have to have multiple if/elses.
Summary
It adds the animation to throw Pokeballs.
Note: My alignments aren't pixel perfect and my timing isn't necessarily down to the millisecond. I eyeballed them and left them when I felt they were good.
Fixes #733