Skip to content

TypeScript Errors #6307

@subhoghoshX

Description

@subhoghoshX

Version

  • Phaser Version: 3.55.2+
  • Operating system: any
  • Browser: any

Description

When trying to recreate the game using the website's guide, I encountered a couple of TypeScript errors.

In a section while iterating the stars it shows setBounceY not found.

const stars = this.physics.add.group({
  key: "star",
  repeat: 11,
  setXY: { x: 12, y: 0, stepX: 70 },
});

stars.children.iterate((child) => {
  child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8)); // Here it says `setBounceY` doesn't exist.
  return null;
});

image

And just after that, in the tutorial, where it shows how to detect overlap, the doc shows to use null and this as the 3rd & 4th arguments.

image

But it shows a type error when I pass null.

image

Looking at the type it look like it expects something else:

type screenshot

I encountered the above errors in [email protected]+ including the latest beta 16.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions