Help with business outfitted bob

New to coding here, I am doing the path " learning to make a game with phaser" and I am on the business outfitted bob exercise. I am on step 8-13 and when i put in my code to be able to move bob with the arrow keys, when i save the title page will still display but when i press any key to continue it will just be gray and not load anything. This is the code i am using for my cursors:

rightArrow = cursors.right.isDown;

leftArrow = cursors.left.isDown;

upArrow = cursors.up.isDown;

downArrow = cursors.down.isDown;

if (rightArrow = true){
moveBobRight();
}else if(leftArrow = true){
moveBobLeft();
}else if(upArrow = true){
moveBobUp();
}else if(downArrow = true){
moveBobDown();
}

and this is a link to the whole code section :

try with this one. Itworkes for me:

if (rightArrow){

moveBobRight();

} else if (leftArrow){

moveBobLeft();

} else if (upArrow){

moveBobUp();

} else if (downArrow){

moveBobDown();

}

1 Like

Yesss! Thank you so much.

you arent defining the arrows as variables. for upArrow downArrow leftArrow and rightArrow why dont you put const before all those lines? Const and a space.