elevator saga游戏下载_win10玩沙滩ZERO特别卡

elevator saga游戏下载_win10玩沙滩ZERO特别卡一,游戏介绍这是一个在线编写JS代码的游戏:http://play.elevatorsaga.com/显示界面:其中的doc是肯定要看的。操作界面:初始代码:{init:function(elevators,floors){varelevator=elevators[0];//Let’susethefirstelevator//Whenevertheelevatorisidle(has..

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

一,游戏介绍

这是一个在线编写JS代码的游戏:http://play.elevatorsaga.com/

显示界面:

elevator saga游戏下载_win10玩沙滩ZERO特别卡

其中的doc是肯定要看的。

操作界面:

elevator saga游戏下载_win10玩沙滩ZERO特别卡

初始代码:

{
    init: function(elevators, floors) {
        var elevator = elevators[0]; // Let's use the first elevator

        // Whenever the elevator is idle (has no more queued destinations) ...
        elevator.on("idle", function() {
            // let's go to all the floors (or did we forget one?)
            elevator.goToFloor(0);
            elevator.goToFloor(1);
        });
    },
    update: function(dt, elevators, floors) {
        // We normally don't need to do anything here
    }
}

二,闯关

第1关

elevator saga游戏下载_win10玩沙滩ZERO特别卡

初始代码有提示:let’s go to all the floors (or did we forget one?)

本关代码:

{
    init: function(elevators, floors) {
        var elevator = elevators[0]; // Let's use the first elevator

        // Whenever the elevator is idle (has no more queued destinations) ...
        elevator.on("idle", function() {
            // let's go to all the floors (or did we forget one?)
            elevator.goToFloor(0);
            elevator.goToFloor(1);
            elevator.goToFloor(2);
        });
    },
    update: function(dt, elevators, floors) {
        // We normally don't need to do anything here
    }
}

第2关

elevator saga游戏下载_win10玩沙滩ZERO特别卡

{
    init: function(elevators, floors) {
        var elevator = elevators[0]; // Let's use the first elevator
        var floor = floors[0];
        
        // Whenever the elevator is idle (has no more queued destinations) ...
        elevator.on("idle", function() {
            //elevator.goToFloor(0);
        });
        elevator.on("floor_button_pressed", function(floorNum) {
            elevator.destinationQueue.push(floorNum);
            elevator.checkDestinationQueue();
        })

        floor.on("up_button_pressed", function() {
            elevator.destinationQueue.push(floor.floorNum());
            elevator.checkDestinationQueue();
        })
        floor.on("down_button_pressed", function() {
            elevator.destinationQueue.push(floor.floorNum());
            elevator.checkDestinationQueue();
        })
        
    },
    update: function(dt, elevators, floors) {
        // We normally don't need to do anything here
        var elevator = elevators[0]; // Let's use the first elevator
        for(var i=1;i<=4;i++){
            if(elevator.destinationQueue.indexOf(i)>-1){
                elevator.goToFloor(i);
            }
        }
        for(var i=4;i>0;i--){
            if(elevator.destinationQueue.indexOf(i)>-1){
                elevator.goToFloor(i);
            }
        }
    }
    
}

第2关我居然都没能通过,主要是JS不熟,加上API没太看懂。。。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/192009.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Centos7下载和安装教程

    Centos7下载和安装教程1.CentOS下载CentOS是免费版,推荐在官网上直接下载,网址:https://www.centos.org/download/DVDISO:普通光盘完整安装版镜像,可离线安装到计算机硬盘上,包含大量的常用软件,一般选择这种镜像类型即可。EverythingISO:包含了完整安装版的内容,并对其进行补充,集成了所有软件。MinimalISO:这个版本为精简版的镜像,可以安…

    2022年6月13日
    35
  • win10工作站激活码(ID00391-80000-00001-AA561破解方法「建议收藏」

    win10工作站激活码(ID00391-80000-00001-AA561破解方法,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月14日
    111
  • js闭包面试题经典_js闭包原理

    js闭包面试题经典_js闭包原理说明最近看到这样一段代码functionfun(n,o){console.log(o);return{fun:function(m){returnfun(m,n);}};}vara=fun(0);a.fun(1);a.fun(2);a.fun(3);varb=f

    2022年8月30日
    5
  • 清除挖矿脚本 minerd[通俗易懂]

    清除挖矿脚本 minerd[通俗易懂]症状:cup占用率飙高原因:这次入侵是由于redis没有设置用户名密码,没有限制访问ip导致 解决方法:ps-eopcpu,args–sort=%cpu|head  找到飙高的程序是minerdTOP查看minerd的pidkill-s9pid(pid的值每个服务器不同)rm-rf /var/spool/cron/cronta

    2022年7月13日
    21
  • C++学习——继承与派生「建议收藏」

    C++学习——继承与派生「建议收藏」普通继承例题:定义一个名为Phone的手机类,有如下私有成员变量:品牌、型号、CPU、电池容量,如下成员函数:构造函数初始化手机的信息。在此基础上派生出NewPhone类,派生类增加了两个新的私有数据成员,分别用于表示颜色和价格,增加了一个成员函数用来输出手机信息。代码如下:#include <iostream>#include<string>#include&l…

    2022年8月18日
    9
  • mac下使用pyhon+mimtdump 爬取m3u8

    mac下使用pyhon+mimtdump 爬取m3u8

    2021年5月12日
    121

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号