I have an object in the superclass Enemy
interface rigidBodyData{
spriteName: string
spriteSizeX: number
spriteSizeY: number
idleAnim: string
mass: number
}
And I import it to the subclass
import rigidBodyData from "./Enemy"
export default class Crabby extends Enemy{
public rigidBody: Phaser.Physics.Arcade.Sprite
private dataList: rigidBodyData
constructor(_scene:Phaser.Scene, x:number, y:number){
super(_scene, x, y, this.dataList)
}
}
How can I create a modifiable object of type rigidBodyData and return it to the superclass?
I don't want to send the parameters in the Crabby object declaration
this.crabby = new Crabby(this, 150, 650)
I tried to send a tuple instead an object, but doesn't work, so, I'm trying to send an object