# Phaser: How to call a function inside another function?

So I actually have the following code that works:﻿

var player;
var box_tnt;

function create (){
}

//the function hitTnt stop the game because the player died
function hitTnt (player, boxes){
this.physics.pause();
console.log('Game Over!');
textGameOver.setText('GAME OVER');
player.setTint(0xff0000);
player.anims.play('default');
gameOver = true;﻿﻿﻿
}


and I want to do something like:

var player;
var box_tnt;

function create (){
}

//the function hitTnt stop the game because the player died
function hitTnt (player, boxes){
gameOver();
//other stuff here
}

function gameOver (){
this.physics.pause();
console.log('Game Over!');
textGameOver.setText('GAME OVER');
player.setTint(0xff0000);
player.anims.play('default');
gameOver = true;﻿﻿﻿
}


but I have the following error message:

TypeError: gameOver is not a function

Do you have please any ideas how to do it properly?

gameOver = true;﻿﻿﻿ this overwrites gameOver; it used to be a function, now it's a boolean holding true value.
• Thank you for making me realise this stupid mistake, know I can access the function that I renamed gameEnd(); but I still have the following error: this.physics is undefined How do I please pass this. and player. from function hitTnt to function gameEnd ? – Ced Feb 10 '19 at 22:55