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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • phpstorm激活码2021.3破解方法

    phpstorm激活码2021.3破解方法,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
    111
  • unity摄像机深度图使用[通俗易懂]

    unity摄像机深度图使用[通俗易懂]https://www.jianshu.com/p/80a932d1f11ehttps://www.jianshu.com/p/178f3a065187https://www.cnblogs.com/czaoth/p/5830735.htmlhttps://www.cnblogs.com/jackmaxwell/p/7117909.htmlhttps://docs.unity3d.com/…

    2022年4月25日
    148
  • MFC学习——下检测计算机是否联网

    MFC学习——下检测计算机是否联网一个最简单的类方法:Bool IsNetworkAlive( __out LPDWORD lpdwFlags);返回TRUE表示联网,FALSE表示未连接到网络。使用时注意在头文件中加入如下代码:#include <Sensapi.h>#pragma comment(lib, “Sensapi.lib”)函数使用举例: DWORD ws;…

    2022年8月18日
    10
  • SQLSERVER 存储过程 语法

    SQLSERVER 存储过程 语法SQLSERVER存儲過程的寫法格式規格CodehighlightingproducedbyActiproCodeHighlighter(freeware)http://www.CodeHighlighter.com/–>******************************************************** author:Susan*** date:

    2022年7月17日
    13
  • SQL之视图与索引[通俗易懂]

    SQL之视图与索引[通俗易懂]SQL之视图与索引视图的定义、修改、使用索引的创建、查看视图人们在使用数据库时,并不是直接对数据源表进行操作,通常人们只关心源表的部分数据,因此为了使得用户在查询时方便,用不着在每次查询时都编写复杂的代码(比如连接等),可以事先将用户要使用的查询结果通过视图定义在数据库中,这样人们在进行查询时只需查看视图即可,简化了用户的操作,同时使得数据同源数据分离,提高了安全性。1.视图的创建语法:

    2022年7月22日
    8
  • 口罩预约管理系统——数据库设计(前端+PHP+MySQL)

    口罩预约管理系统——数据库设计(前端+PHP+MySQL)口罩预约管理系统(数据库设计)基本功能实现,如何结合前端基础、后端PHP和MySQL数据库实现呢?手把手教你设计数据库,搭建口罩预约管理系统,实现基本需求功能!

    2022年6月20日
    24

发表回复

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

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