Skip to content

Commit

Permalink
more example TS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Aug 28, 2024
1 parent f1a9fed commit 3944671
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions packages/examples/src/examples/whac-a-mole/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export class MoleManager extends Renderable {

constructor() {
// call the super constructor
super(0, 0, {
width: 10,
height: 10,
});
super(0, 0, 10, 10);

this.moles = [];
this.timer = 0;
Expand Down
10 changes: 4 additions & 6 deletions packages/examples/src/examples/whac-a-mole/mole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ export class MoleEntity extends Sprite {
*/
display() {
const finalpos = this.initialPos - 140;
this.displayTween = pool
.pull("me.Tween", this.pos)
.to({ y: finalpos }, { duration: 200 });
this.displayTween = pool.pull("me.Tween", this.pos) as Tween;
this.displayTween.to({ y: finalpos }, { duration: 200 });
this.displayTween.easing(Tween.Easing.Quadratic.Out);
this.displayTween.onComplete(this.onDisplayed.bind(this));
this.displayTween.start();
Expand All @@ -107,9 +106,8 @@ export class MoleEntity extends Sprite {
*/
hide() {
const finalpos = this.initialPos;
this.displayTween = pool
.pull("me.Tween", this.pos)
.to({ y: finalpos }, { duration: 200 });
this.displayTween = pool.pull("me.Tween", this.pos) as Tween;
this.displayTween.to({ y: finalpos }, { duration: 200 });
this.displayTween.easing(Tween.Easing.Quadratic.In);
this.displayTween.onComplete(this.onHidden.bind(this));
this.displayTween.start();
Expand Down

0 comments on commit 3944671

Please sign in to comment.