Lv.1
锦绣河山收拾好,万民尽作主人翁。——朱总司令
签名:build_一只建筑师吖的纪念号 编程猫促进联盟创始人
在 【教程】代码教学——跑酷的代码(如存档,传送等) 中回复
矫正后代码:
1、存档点
2、起点
3、传送到起点
4、终点奖励
5、掉下回到存档点
6、看我干什么?我是分割线----------------------------------------------------------------------------------
1、存档点
有2种存档点:
第一种:模型存档
//存档点:可放置多个,需要加存档点标签,同时存档点需要开实体化,可推移要关掉
world.querySelectorAll('.存档点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
other.player.spawnPoint.copy(other.position);
other.player.directMessage('存档成功!')
}
})
})
第二种:方块存档(踩S存档)
world.onVoxelContact(({voxel,entity})=>{
const c=voxels.id('S');//也可以是别的方块
if(voxel===c){
entity.player.directMessage('存档成功!');
entity.player.spawnPoint.copy(entity.position);
}
})
2、起点的提示(加起点标签,开实体关防推移)
world.onPlayerJoin(({entity})=>{
entity.player.Start=false;//跑酷起点判断,防作弊
entity.enableDamage=true;//可伤害
})
//跑酷起点
world.querySelectorAll('.起点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==false){
world.say(other.player.name+'出发了!');
other.player.Start=true;
other.player.spawnPoint.copy(other.position);
}
})
})
3、详细一点了
//跑酷快速传送门
world.querySelectorAll('.跑酷传送门').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
other.position.set();
})})
4、一样的简单,也是1行(才怪)
world.querySelectorAll('.终点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
other.player.directMessage('你到了终点!获得加速效果!(蹲下加速)以及发光!')
world.say(other.player.name+'到达了终点!')
other.player.Start=false;
other.player.emissive=999;
other.position.set(73, 10, 77);//这里填出生点坐标
other.player.spawnPoint.copy(other.position);
})
})
5、需要配合上面代码
//如果玩家跑酷中,一到地上就凉凉
world.onTick(({entity})=>{
world.querySelectorAll('player').forEach((e)=>{
if(e.player.Start==true){
if(e.position.y<=15){
e.hurt(999)
}
}
})
})
如果连起来,就是:
//跑酷起点
world.querySelectorAll('.起点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==false){
world.say(other.player.name+'出发了!');
other.player.Start=true;
other.player.spawnPoint.copy(other.position);
}
})
})
//存档点:可放置多个,需要加存档点标签,同时存档点需要开实体化,可推移要关掉
world.querySelectorAll('.存档点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
other.player.spawnPoint.copy(other.position);
other.player.directMessage('存档成功!')
}
})
})
//如果玩家跑酷中,一到地上就凉凉
world.onTick(({entity})=>{
world.querySelectorAll('player').forEach((e)=>{
if(e.player.Start==true){
if(e.position.y<=15){
e.hurt(999)
}
}
})
})
//跑酷快速传送门
world.querySelectorAll('.跑酷传送门').forEach((e)=>{e.onEntityContact(({entity,other})=>{other.position.set(124, 23, 68);})})
PS:红字部分是矫正的部分
2020-07-08T19:09:46 点赞:0
在 【代码岛3.0内测版】继猫猫之城毁图之后第一次公告(为保障地图安全完整,不公布链接) 中回复
#include<iostream>
using namespace std;
int sushu(int x)
{
if(x<=1) return 0;
if(x==2) return 1;
for(int i=2;i<=x-1;i++)
if(x%i==0) return 0;
return 1;
}
int main()
{
int i,j,n;
cout<<"n=";
do
{
cin>>n;
}while(n<4);
for(i=4;i<=n;i+=2)
{
for(j=2;j<i;j++)
if(sushu(j))
if(sushu(i-j))
{
cout<<i<<'='<<j<<'+'<<i-j<<endl;
break;
}
if(i==j) cout<<i<<"验证失败!"<<endl;
}
return 0;
}
//C++ 哥德喵猜想 2020-07-11T19:24:06 点赞:1
在 一片空白1 中回复
2020-07-13T20:45:07 点赞:0
在 【代码岛3.0内测版】代码岛3.0载人火车!限时体验! 中回复
https://box3create.cod喵/games/d1ff9016b1bcd613c142?p=PNVpvpqkiDLw8hcPKU7gdM5M37C3dvcOPvlsPw1QhXA9Hv1xKaLgVndWVzdA%3D%3D
2020-07-16T21:10:08 点赞:0
在 【代码岛3.0内测版】限时喵!!!建筑帮忙!!! 中回复
2020.7.22最新报道:
目前三个地图中
仅有一个地图的建筑工作完成了大约二分之一
另外两个地图:
《Science and Technology City》:没给权限
《皮卡工厂》:网址进不去
请这两个图主及时查收!
2020-07-22T20:34:41 点赞:0
在 [shyfcka暑假爆肝计划] 大家来选选~ 中回复
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>abc</title>
</head>
<body style="background-color: black;">
<div style="width: 800px; background-color: black; font-size: 18px; color: white; margin: auto;">
<div style="height: 140px; background-color: red;"><p><span style="color: black; font-family: 仿宋;"></span>图 片 集</p></div>
<div style="width: 150px; height: 2000px; float: left; background-color: darkkhaki;">
<ol style="line-height: 32px;">
<li><a href="/向日葵.html">向日葵</a></li>
<li><a href="/落叶.html">落叶</a></li>
<li><a href="/荷叶荷花.html">荷叶荷花</a></li>
</ol>
</div>
<div style="width: 650px; height: 2000px; float: left; background-color: blue;">
</div>
<div style="clear: both;"></div>
<div style="height: 120px; background-color: darkgray;"></div>
<div style="width: 800px; height: 200px; background-color: red;"></div>
</div>
</body>
</html>
<!-- PS:喵的地方是:t m(不加空格) --!>
看我做的
2020-07-22T21:18:55 点赞:0