Lv.1
hmmm
在 【代码岛3.0实体AI实验室】让实体绕着圈子走 中回复
https://box3create.codemao.cn/games/7e8d6b1d822265467e43
2020-06-05T20:16:25 点赞:0
在 求助(如何让传送门只传送指定人物) 中回复
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer&&!other.isPlayer){
if(other.hasTag('传送门')){
if(entity.player.name==='指定的人'){
entity.position.set(0,0,0);//传送位置
}
}
}
})2020-07-05T08:37:18 点赞:0
在 【试卷警告】一张代码岛3.0代码能力自测卷 中回复
一、填空题(每空5分):
1.给所有玩家发消息应当用到(world.say)函数
2.world.querySelectorAll的作用是(搜索所有在线玩家)
3.实体的名称变量是(entity.id),玩家的名称变量是(entity.player.name)
4.可以通过变量(entity.isPlayer)来判断实体是不是玩家
二、选择题(每题5分):
1.控制实体速度的变量是(C)
A entity.player.velocity B entity.position C entity.velocity D entity.player.position
2.我们可以使用(D)来更改指定位置的方块
A Voxels.getVoxel B Voxels.getVoxelId C Voxels.id D 都不是
3. entity.player.cameraMode='fixed'的作用是(C)
A 固定玩家的3D光标 B 改变玩家的外观 C 固定玩家的视角 D 固定玩家
4.world.querySelector('.boat')的作用是(B)
A 查找所有名称为boat的实体 B 查找首个带有标签boat的实体 C 查找首个名称为boat的实体 D 查找所有带有标签boat的实体
5.entity.player.Point的含义是(D)//你自定义的吧。。。
A 玩家的重生点 B 玩家喵亡的地点 C 玩家的出生点 D 不确定
三、判断题(每题2分)
1.老明同学想要查找所有玩家,他应该使用world.querySelectorAll('*player') (x)//名字起的不错
2.particleRatSpread为每秒产生的粒子数量 (x)//我咋没听过哦这玩意儿呢?
3.particleColor可以设定为一个长度为5的数组,代表每个阶段粒子的颜色 (√)
4.world.onChat有两个传入参数,分别是entity和chat (x)//entity和message
5.world.onClick每一个时刻调用一次 (√)
四、实际程序题(每题10分)
1.当有玩家碰到带有box标签的实体时,此玩家收到消息“你碰到了box”
var a='box';
var b='.';
var c=b+a;//1928370465
var stststcccccc喵喵dajkfvhpalelh=world.querySelectorAll('.box');
world.querySelectorAll(c+''+''+'').forEach((eww)=>{eww.position.copy(eww.position)})
world.querySelectorAll('.box').forEach((e)=>{//!
var sss=e.position;var ps=(1===2);
e.onEntityContact(({other})=>{
if(ps/'2147483喵8(2^31)'/){
return;//error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
var tkdaojvoasndfkntt=other.player.name;
other.player.directMessage('你碰到了'+a+''+''+''+''+''+'');.//888938950412948501
var vvsv=tkdaojvoasndfkntt+sss.toString();//咳咳咳
var stuwwwv=vvsv+' ';//000000-000000-000000+111111=111111;;;;;;;;
})
//hi! olleh
//!ih hello
/*//*/})
2.让每一个带有标签car的实体沿x方向移动(速度不限)
//////////////////////////////////////////////////////////////////////
world.querySelectorAll(''+''+''+'.'+''+'c'+''+''+''+ar').forEach((estthshs)=>{//awvepdoaskmxcokmwosdfji
/*lknalksdml;salfkaks*/estthshs.velocity.x=1*2*3*4*5*6*7*8*9*10;//试试嘿嘿加速度快发家史大V啊谁都不骄傲我跑是就按实际的高速喵发as
var jfjfjfjf=estthshs.velocity;//发的考虑撒可富几点上课发大姐夫;拉我进地方发啦就是
var dkajcieooajes=/*asdvniajsdfnpawjnf*/jfjfjfjf.x;//aon ofsdfklwl;ae
var /*fasfd;klvamlksdfjkja*/kadvoknepjqaio/*cmawvl;d喵flknas;lkfn*/=dkajcieooajes;//nopaosdwfavodsjofj
dkajcieooajes=10;///dasvmoejrgoja;fjdlkjae
})///////////////////////////////////////////////////////////////////
3.每过3秒,就让所有玩家和带有“jump”标签的实体“跳”一下
setInterval(()=>{
world.querySelectorAll('.jump').forEach((e)=>{
e.velocity.y++;
})/*dfmalvkjnoaejrfodnvaknsbd lajoifjf*/
world.querySelectorAll/*apsdofkm;lak sdglfkkdlqwksd */('player').forEach((falskdaklnesrslqfe)=>{
falskdaklnesrslqfe.velocity.y++;
falskdaklnesrslqfe.velocity.y+=1;
})
},3*2*5*2*5*2*5);//哦啊的瑟吉欧叫啥佛偈jiojoooooooooooooooooooooooo
4.每当有玩家碰到水方块,破坏此水方块,让所有玩家血量-10,并广播消息“有人碰到了水喵”
world.onFluidEnter(({entity,x,y,z})=>{
entity.enableDamage=true;
entity.hurt(10);
voxels.setVoxel(x,y,z,0);
world.say('有人碰到了水喵');
})
看谁敢抄哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈或或或或或或或或
2020-07-18T11:15:51 点赞:0
在 【代码岛3.0】模型叛乱! 中回复
想要更疯狂写就键入以下代码吧!
注:一定要在开启的时候键入!
world.onTick(()=>{for(let i=0;i<100;i++){voxels.setVoxel(Math.round(Math.random()*126),Math.round(Math.random()*126),Math.round(Math.random()*126),Math.round(Math.random()*300));}world.querySelectorAll('*').forEach((e)=>{if(e.isPlayer){return;}e.fixed=false;e.position.set(Math.round(Math.random()*126),Math.round(Math.random()*126),Math.round(Math.random()*126))})})2020-07-24T09:53:34 点赞:0
在 【C++程序设计:恶作剧】病毒程序(假的)集结 中回复
哪个胆子大的可以试试这个:
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
switch(Message) {
case WM_DESTROY: {
PostQuitMessage(0);
break;
}
default:
return DefWindowProc(hwnd, Message, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
memset(&wc,0,sizeof(wc));
wc.cbSize = sizeof(WNDCLASSEX);
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszClassName = "WindowClass";
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc)) {
MessageBox(NULL, "Window Registration Failed!","Error!",MB_ICONEXCLAMATION|MB_OK);
return 0;
}
while(1);
{
hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,"K.O.","²¡¶¾£¡",WS_VISIBLE|WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
640,
480,
NULL,NULL,hInstance,NULL);
}
if(hwnd == NULL) {
MessageBox(NULL, "Window Creation Failed!","Error!",MB_ICONEXCLAMATION|MB_OK);
return 0;
}
while(GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}2020-07-24T14:49:36 点赞:0