class SaturnFive {
constructor(){
this.countDown=0;
this.speed=0;
this.distance=384403.9;
}
ready(){
console.log("进入倒计时");
this.countDown=10;
let timer = setInterval(()=> {
console.log(this.countDown--);
if(this.countDown===0){
this.fire();
clearInterval(timer);
}
},1000)
}
fire(){
console.log("点火");
this.speed=100000;
const time = this.distance/this.speed;
console.log(time+"秒后到达");
setTimeout(()=>{
console.log("到达");
},time*1000)
}
}
class Apollo11 {
constructor(){
this.money=0;
this.rocket=null;
console.log("Apollo11立项");
}
crowdFunding(){
this.money+=1000000000000;
console.log("众筹获得1000000000000");
}
buildRocket(){
if(this.money<1000000000000){
throw new Error("穷碧,先去筹钱")
}
this.money-=1000000000000;
this.rocket= new SaturnFive();
console.log("成功建造出土星五号")
}
}
const apollo11 =new Apollo11();
apollo11.crowdFunding();
apollo11.buildRocket();
apollo11.rocket.ready();
该说你是大佬呢?
还是沙雕呢……
该说你是大佬呢?
还是沙雕呢……
合并成大雕倒是符合我

(手动滑稽)
陈智炜我知道 你在看 别看了 回去改bug
You "dou ji ling" is very well
Most helpful comment
陈智炜我知道 你在看 别看了 回去改bug