Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Using Arcade-Slopes plugin in Typescript


colinvella
 Share

Recommended Posts

 

Hi,

I am trying to use the Arcade-Slopes plugin in Typescript, but I'm not sure how to do it.

I added a ref to the .d.ts file in tsconfig.json:

  "files": [
        "./src/app.ts",
        "./vendor/phaser.d.ts",
        "./vendor/phaser-arcade-slopes.d.ts"
    ]

This is how I'm trying to load the plugin.

        // enable arcade slopes plgin
        this.game.plugins.add(Phaser.Plugin.ArcadeSlopes);

But when I try to convert the collision layer:

// Convert the collision layer to work with Arcade Slopes
        this.game.slopes.convertTilemapLayer(this.collisionLayer, 'arcadeslopes');

I get the following errors:

src/app.ts(71,26): error TS2339: Property 'convertTilemapLayer' does not exist on type 'ArcadeSlopes'.
vendor/phaser-arcade-slopes.d.ts(61,5): error TS7010: 'resolve', which lacks return-type annotation, implicitly has an 'any' return type.
vendor/phaser-arcade-slopes.d.ts(156,17): error TS2304: Cannot find name 'object'.
vendor/phaser-arcade-slopes.d.ts(157,14): error TS2304: Cannot find name 'object'.
vendor/phaser-arcade-slopes.d.ts(238,3): error TS7010: 'clear', which lacks return-type annotation, implicitly has an 'any' return type.

It looks like the arcade slopes .d.ts file isn't compiling properly either.

Has anyone managed to use Arcade Slopes successfully with Typescript? I'm seriously considering restarting with plain old JS to avoid this problems.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...