Lv.1
在 请问如何作出导弹从空中落下并爆炸? 中回复
function sphere(vox, cx, cy, cz, radius){
let xend = cx+radius
let yend = cy+radius
let zend = cz+radius
for(let x=cx-radius;x<=xend;x++){
for(let y=cy-radius;y<=yend;y++){
for(let z=cz-radius;z<=zend;z++){
let dx = x-cx;
let dy = y-cy;
let dz = z-cz;
if(Math.round(Math.sqrt(dx*dx+dy*dy+dz*dz)) <= radius){
voxels.setVoxel(x,y,z,vox)
}
}}}
}
world.onPlayerJoin(({entity})=>{
entity.id = entity.player.name
})
world.querySelectorAll('*').forEach((e)=>{
if(e.id != '[星球大战]TIE截击战机-1')e.collides = true
})
// sphere('air',63,24,63,12) // 调用方法。在{x:63, y:24, z:63} 位置,建造一个半径为12格的实心球体
const thePoint = world.querySelector('#[星球大战]TIE截击战机-1'); // 搜索模型名字为"出生点-1"的首个实体
(async function(){
while(1){
const a = world.createEntity({
mesh:'mesh/追踪导弹.vb',
position:thePoint.position,
meshScale:[1/6,1/6,1/6],
fixed:false,
collides:true,
gravity:true,
})
a.velocity = new Box3Vector3(Math.random()*10,0,Math.random()*10)
a.onEntityContact(async({other})=>{
if(other.id == '[星球大战]TIE截击战机-1') return
other.enableDamage = true
other.hp -= 100
if(other.hp <= 0){
a.destroy()
sphere('air',other.position.x,other.position.y,other.position.z,10)
other.hp = 0
await sleep(4000)
other.hp = 100
world.say(other.id+'复活了')
}
})
a.onVoxelContact(({
x,y,z
})=>{
a.destroy()
sphere('air',x,y,z,10)
})
thePoint.say('破坏家园!哈哈哈哈')
await sleep(4000)
}
}
)();
//配置模型:1.一个名为[星球大战]TIE截击战机-1
//文件:一个叫追踪导弹的模型
2022-07-15T21:31:49 点赞:0
在 【看我做了个啥】 中回复
<!DOCTYPE> <html> <head> <title> MyHtml </title> </head> <body> <br> <br> <br> <inputid="n秒"value="请输入几秒更新一次"> <br> 可下落方块 <inputid="哪些1"value="'sand','snow','dirt'"> <br> 可下落液体 <inputid="哪些2"value="'water'"> <br> <buttonid="提交">  提            交  </button> <br> <p>               代码:</p> <pid="代码"style="height:800px;width:800px;"disabled="true"readOnly="true">aaa</p> <scriptsrc="喵喵喵"></script> <scriptsrc="in.js"></script> </body> </html>2022-09-11T22:15:14 点赞:0
在 【看我做了个啥】 中回复
$(function(){ $("#n秒").focus(function(){ if(document.getElementById('n秒').value=='请输入几秒更新一次')document.getElementById('n秒').value='' }); $("#n秒").blur(function(){ if(document.getElementById('n秒').value=='')document.getElementById('n秒').value='请输入几秒更新一次' elseif(isNaN(parseInt(document.getElementById('n秒').value))){ document.getElementById('n秒').value='0.1' }else{ leta=parseInt(document.getElementById('n秒').value) if(a<0)document.getElementById('n秒').value=0.1 elseif(a>10)document.getElementById('n秒').value=10; elsedocument.getElementById('n秒').value=parseInt(document.getElementById('n秒').value) } }); $('#提交').click(function(){ letok_voxel=document.getElementById('哪些1').value.split(',') letok_fluid=document.getElementById('哪些2').value.split(',') letsec=Number(document.getElementById('n秒').value) letanswer="global.$=world.querySelectorAll;global.gv=voxels.getVoxel;global.sv=voxels.setVoxel;functiondev(x,y,z,vox){if(gv(x,y,z)==0&&!a喵d(hes,[x,y,z])){sv(x,y,z,vox)}};world.onTick(async({tick})=>{if(tick%Math.round("+15*sec+")==0){\nfor(letx=0;x<257;x++){\nfor(letz=0;z<257;z++){\nfor(lety=64;y>0;y--){\nif(["+ok_voxel+"].includes(voxels.name(gv(x,y,z)))&&gv(x,y-1,z)==voxels.id('air')){\nsv(x,y-1,z,voxels.name(gv(x,y,z)))\nsv(x,y,z,'air')\nawaitsleep(300)\n}\nif(["+ok_fluid+"].includes(voxels.name(gv(x,y,z)))&&gv(x,y-1,z)==voxels.id('air')){dsv(x,y-1,z,voxels.name(gv(x,y,z)))\n}}}}}})"; document.getElementById('代码').innerText=answer; }); })2022-09-11T22:16:49 点赞:0
在 制作一个超级二段跳!box3 中回复
(async function(){
while(1){
world.querySelectorAll('player')[0].velocity.y = 3;
await sleep(10)
}
})();
2022-11-12T08:28:46 点赞:0
在 一个游戏(没有新意) 中回复
https://shequ.codemao.cn/community/472677
776274、液体uummoc、弄成。哦啊喵哦草、、:是葡萄糖哈
2022-11-18T20:30:42 点赞:0
在 世上最可怕的事就是:你知道代码第几行错了,却不知错在了哪…… 中回复
from tkinter import *
root=Tk() root.title("每个人都是一张试卷") root.geometry("600x400+700+300") root.resizable(0, 0) label_title=Label(root,text='输入姓名:',font=('楷体',20),bg='blue') label_title.place(x=50, y=10) entry=Entry(root, font=('楷体',20)) entry.place(x=120, y=70) def callback(): entry_get = entry.get() if entry_get=="": text.set("请输入姓名") else: book_list=['语文试卷' '数学试卷' '英语试卷' '美术试卷' '科学试卷' '期中试卷' '期末试卷' '区统考试卷' '奥数试卷' '新概念试卷'] radom_index=random.randint(0,len(book_list)-1) text.set(book_list[random_index]) label_text.place(x=300-label_text.winfo_width()/2, y=180) btn=Button(root,text='属于我的试卷',font=('楷体',15),command=callback) btn.place(x=450, y=65) text=StringVer() label_text=Label(root,font=('楷体',20),textvariable=text,width=40) label_text.place(x=120,y=180)
root.mainloop()
2022-11-24T19:33:54 点赞:0
在 这样为什么还是不能移动 中回复
;;(async function(){while(true){
metrothree.position.x += sudu
}})();2022-11-24T20:52:30 点赞:0
在 这样为什么还是不能移动 中回复
错了,是:
;;(async function(){while(true){
metrothree.position.x += sudu;await sleep(100)
}})();2022-11-24T20:53:10 点赞:0
在 【这C++题有毛?】 中回复
ht[Delete this]tps://oj.youdao.com/problem/[Delete this]231?from=problems
2022-11-28T18:07:01 点赞:0
在 不会iframe的向这看 中回复
2023-03-26T17:11:30 点赞:0