Q:

phaser 3 stops loading after executing button code

I'm having some trouble with adding 2 buttons to a phaser game. Its actually the first game from phaser 3 examples, so it works alright. However, when I try to add a button for speed up and one for speed down it stops loading after it reaches that code:
    buttonUp = this.add.text(550, 16, 'speed up', { fontSize: '32px', fill: '#000' });
buttonUp.setInteractive();
buttonUp.on('pointerdown', speed++);

buttonDown = this.add.text(550, 50, 'speed down', { fontSize: '32px', fill: '#000' });
buttonDown.setInteractive();
buttonDown.on('pointerdown', speed--);

It actually stops at the 
    buttonUp.on('pointerdown', speed++);

line.
any help appreciated, thanks. 

A:

You need to pass a listener to the pointerdown event, i.e. a function, that will be called each time the event is dispatched. Wrap your speed--/++ calls into a function and pass that instead.

