Problem with Electric Mouse

I am having an issue with the Electric Mouse project. I want to say step 4 is where the issues starts but with nothing changing from step 1-3 I cant tell. I can save, and the game loads the start screen, I click start and the game screen pops up, both sprites are showing but that’s it. No animation, just the sprites on the background. Hoping the issue would be resolved later as I was getting no error messages, I thought maybe in step 6 is where I would see changes or motion, still nothing. I have listed a few parts of the code I added following the steps, after saving step 4. Can someone help with this project?

 create() {
    // Character objects
    // Add the player object below:
    gameState.player = [{
      name: 'Electric Mouse',
      health: 45,
      frames: [
        { key: 'playerIdle', start: 0, end: 2 },
        { key: 'playerAttack', start: 3, end: 4 },
        { key: 'playerDefend', start: 5, end: 6 },
        { key: 'playerSpecial', start: 7, end: 8 }
      ]
    }
    ];

 // Set the current opponent below:
    gameState.computer = gameState.opponents[0];
 // Add your information text and styling below: 
    const style = {
      font: '16px Helvetica', fill: '#000000', padding: { x: 6, y: 7 }
    }
    gameState.playerMove = this.add.text(65, 140, '', style);
    gameState.computerMove = this.add.text(320, 140, '', style);
    gameState.information = this.add.text(140, 80, '', style);
    gameState.playerHealthBar = this.add.text(45, 45, `HP: ${gameState.player.health}`, style);
    gameState.computerHealthBar = this.add.text(375, 45, `HP: ${gameState.computer.health}`, style);

I had the same issue. Using ‘<ctrl><shift><i>’ to involve the Console window showed up an error: gameState.player.frames not defined!
As there is only one player, there is no need to define an array for that :frowning:
Removing the first pair of square brackets in the player-definition solved this problem for me.

1 Like