你如何创建多个"if"语句?

-7 javascript if-statement

我的java脚本需要帮助.我想创建if if then else和last else ...但它不会工作:(

if(fallingFrame >= fallingSpeed) {
    if(floor.contains(pt1) || floor.contains(pt2) || floatFloor.contains(pt1) || floatFloor.contains(pt2) || tLPF.contains(pt1) || tLPF.contains(pt2) ) {
        //if (isPlayerOnFloor() || IsPlayerOnFloor()) {
        falling = false;
        if(floatFloor.contains(pt1) || floatFloor.contains(pt2)) {
            character.y = main.height - floatFloorHeight - characterheight;
        }
        if else
        {
            character.y = main.height - floorheight - characterheight;

        }
    else (tLPF.contains(pt1) || tLPF.contains(pt2)) {
            character.y = main.height - tLPFHeight - characterheight;
        }

    }
}
Run Code Online (Sandbox Code Playgroud)

Kir*_*k H 5

if (a == b) {
  ... do this ...
} else if (a == b+1) {  // <---- I believe you're looking for this!
  ... do that ...
} else {
  ... do something generic! ...
}
Run Code Online (Sandbox Code Playgroud)