我的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)
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)
| 归档时间: |
|
| 查看次数: |
97 次 |
| 最近记录: |