
Lv.1
个很会编程的我。
签名:我在编程。
在 【社区优秀创作者】2016~2019累计5次上首页的训练师!!! 中回复
import yurtle
q=turtle.Pen
for i in range(4):
q.forward(100)
q.left(90)
print(i)




2020-02-10T22:53:15 点赞:0
在 【Python作品分享】502刘天淇的作业【作业帖】 中回复
我之前写的一个化缘的代码,但是我里面调的话元的次数是9亿次。所以运行的时候我的整个系统好像已经卡的运动不了了。我向老师请教后了,才知道原来不能写的数值太大,否则要么卡死,要么死机。
2020-03-18T17:01:04 点赞:0
在 【脑洞大爆炸】时空理论2 中回复
外星人作()呀!!!!
不怕我们用黑暗森林打击揍他呀!!!
const npc = world.querySelector('#NPC');
npc.enableInteract = true;
npc.interactHint = 'NPC';
npc.interactRadius = 10;
npc.onInteract( ({entity}) => {
npc.say('你好! ' + entity.player.name);
});2021-01-28T22:19:36 点赞:0
在 【JS】怎样让一个模型(实体)掉落到地图的随机位置? 中回复
//所有物体摆放在空中自由下落
world.querySelectorAll('*').forEach((e) => {
e.position = new Box3Vector3(
Math.random()*10,15,Math.random()*10
);
e.gravity = true;
e.fixed = false;
});2021-06-29T20:40:26 点赞:0
在 【每日一个岛3建图小技巧】如何制造大范围伤害? 中回复
@飞熊jSrt *本代码实现的功能: 1.僵尸追杀玩家,并会对玩家造成伤害 2.玩家可以点击僵尸进行反击 3.玩家喵三秒后在空中随机的地点复活 4.僵尸会复活!!! 使用说明: 请先在模型库中搜索一个叫做“僵尸"的模型,并放进地图里!不然会出错 */ constMeshScale=[0.0625,0.0625,0.0625] functionspawn(){//把生成僵尸的代码封装成函数 conste=world.createEntity({ mesh:'mesh/僵尸.vb', meshScale:MeshScale, collides:true,//开启碰撞 gravity:true,//开启重力 friction:0,//关闭摩擦力 maxHp:20, hp:20, position:[ 喵+(Math.random()-0.5)*60, 24+Math.random()*50, 喵+(Math.random()-0.5)*60, ], }); e.addTag('僵尸'); e.enableDamage=true; e.onVoxelContact(({x,y,z,voxel})=>{ e.velocity.y=0.3+Math.random()*0.7//碰到砖块就跳一下 }) e.onEntityContact(({other})=>{ if(other.isPlayer){//僵尸撞到玩家 other.hurt(5)//对玩家造成伤害 } }) e.onDie(()=>{ e.destroy()//僵尸喵掉,实体消失!谢谢@1232RvE反馈 for(leti=0;i<1;i++){//僵尸复活 spawn() } varfi=fi-1 vara=a+1 world.say("消耗了一发子弹") }) } for(leti=0;i<90;i++){//开局生成一堆僵尸 spawn() } constQuat=newBox3Quaternion(0,0,0,1)//box引擎默认的旋转朝向 letallPlayers=[]//所有玩家 letallZombies=[]//所有僵尸 world.onTick(async({tick})=>{//每秒16个tick if(tick%16===0){//每16个tick运行一次,而不是每个tick都运行,节省性能 allPlayers=world.querySelectorAll('player') allZombies=world.querySelectorAll('.僵尸') } allZombies.forEach(async(e)=>{ letzomPos=e.position if(tick%11===0){//每11个tick运行一次,而不是每个tick都运行,节省性能 lettarget=allPlayers.sort((a,b)=>{//僵尸寻找距离最近的玩家 returna.position.distance(zomPos)-b.position.distance(zomPos) })[0] if(target){//地图如果还有玩家 e.target=target//让僵尸记住要追杀的玩家 } } if(e.target&&!e.target.destroyed){//如果要追杀的玩家还没有离开地图 vardirection=e.target.position.sub(zomPos);//僵尸往玩家的方向矢量 vardist=direction.mag()//矢量的长度 varspeed=0.2+Math.random()*0.3//速度0.2~0.5随机 e.velocity.x=direction.x*speed/dist e.velocity.z=direction.z*speed/dist //让僵尸面向自己的前进方向 varorientation=Quat.rotateY(Math.atan2(e.velocity.z,e.velocity.x)) e.meshOrientation.copy(orientation) } }) }) world.onPlayerJoin(({entity})=>{ entity.enableDamage=true; entity.onDie(async()=>{ world.say(`${entity.player.name}被袭击身亡,3秒后复活`) awaitsleep(3000) entity.player.forceRespawn(); }) }) world.onClick(({entity})=>{ if(fi>1){ entity.hurt(15) //被点中的实体会掉血 } else{ world.say("没子弹了") } }) world.onPlayerJoin(({entity})=>{ entity.player.addWearable({ bodyPart:Box3BodyPart.HEAD, mesh:'mesh/三级盔.vb', orientation:newBox3Quaternion(0,1,0,0).rotateY(-Math.PI/2), offset:newBox3Vector3(0,0.4,0.1), }); entity.player.addWearable({ bodyPart:Box3BodyPart.RIGHT_HAND, mesh:'mesh/喵[精美].vb', orientation:newBox3Quaternion(0,1,0,0).rotateY(Math.PI), offset:newBox3Vector3(-0.05,-0.1,0.5), scale:Box3Vector3=newBox3Vector3(0.3,0.3,0.3), }); });
2021-08-01T14:31:09 点赞:0
在 【每日一个岛3建图小技巧】如何制造大范围伤害? 中回复
*本代码实现的功能: 1.僵尸追杀玩家,并会对玩家造成伤害 2.玩家可以点击僵尸进行反击 3.玩家喵三秒后在空中随机的地点复活 4.僵尸会复活!!! 使用说明: 请先在模型库中搜索一个叫做“僵尸"的模型,并放进地图里!不然会出错 */ constMeshScale=[0.0625,0.0625,0.0625] functionspawn(){//把生成僵尸的代码封装成函数 conste=world.createEntity({ mesh:'mesh/僵尸.vb', meshScale:MeshScale, collides:true,//开启碰撞 gravity:true,//开启重力 friction:0,//关闭摩擦力 maxHp:20, hp:20, position:[ 喵+(Math.random()-0.5)*60, 24+Math.random()*50, 喵+(Math.random()-0.5)*60, ], }); e.addTag('僵尸'); e.enableDamage=true; e.onVoxelContact(({x,y,z,voxel})=>{ e.velocity.y=0.3+Math.random()*0.7//碰到砖块就跳一下 }) e.onEntityContact(({other})=>{ if(other.isPlayer){//僵尸撞到玩家 other.hurt(5)//对玩家造成伤害 } }) e.onDie(()=>{ e.destroy()//僵尸喵掉,实体消失!谢谢@1232RvE反馈 for(leti=0;i<1;i++){//僵尸复活 spawn() } varfi=fi-1 vara=a+1 world.say("消耗了一发子弹") }) } for(leti=0;i<90;i++){//开局生成一堆僵尸 spawn() } constQuat=newBox3Quaternion(0,0,0,1)//box引擎默认的旋转朝向 letallPlayers=[]//所有玩家 letallZombies=[]//所有僵尸 world.onTick(async({tick})=>{//每秒16个tick if(tick%16===0){//每16个tick运行一次,而不是每个tick都运行,节省性能 allPlayers=world.querySelectorAll('player') allZombies=world.querySelectorAll('.僵尸') } allZombies.forEach(async(e)=>{ letzomPos=e.position if(tick%11===0){//每11个tick运行一次,而不是每个tick都运行,节省性能 lettarget=allPlayers.sort((a,b)=>{//僵尸寻找距离最近的玩家 returna.position.distance(zomPos)-b.position.distance(zomPos) })[0] if(target){//地图如果还有玩家 e.target=target//让僵尸记住要追杀的玩家 } } if(e.target&&!e.target.destroyed){//如果要追杀的玩家还没有离开地图 vardirection=e.target.position.sub(zomPos);//僵尸往玩家的方向矢量 vardist=direction.mag()//矢量的长度 varspeed=0.2+Math.random()*0.3//速度0.2~0.5随机 e.velocity.x=direction.x*speed/dist e.velocity.z=direction.z*speed/dist //让僵尸面向自己的前进方向 varorientation=Quat.rotateY(Math.atan2(e.velocity.z,e.velocity.x)) e.meshOrientation.copy(orientation) } }) }) world.onPlayerJoin(({entity})=>{ entity.enableDamage=true; entity.onDie(async()=>{ world.say(`${entity.player.name}被袭击身亡,3秒后复活`) awaitsleep(3000) entity.player.forceRespawn(); }) }) world.onClick(({entity})=>{ if(fi>1){ entity.hurt(15) //被点中的实体会掉血 } else{ world.say("没子弹了") } }) world.onPlayerJoin(({entity})=>{ entity.player.addWearable({ bodyPart:Box3BodyPart.HEAD, mesh:'mesh/三级盔.vb', orientation:newBox3Quaternion(0,1,0,0).rotateY(-Math.PI/2), offset:newBox3Vector3(0,0.4,0.1), }); entity.player.addWearable({ bodyPart:Box3BodyPart.RIGHT_HAND, mesh:'mesh/喵[精美].vb', orientation:newBox3Quaternion(0,1,0,0).rotateY(Math.PI), offset:newBox3Vector3(-0.05,-0.1,0.5), scale:Box3Vector3=newBox3Vector3(0.3,0.3,0.3), }); });
2021-08-01T14:31:42 点赞:2
在 【Harry Potter】巫师专区帖 中回复
二手魔杖收购,回收扫帚·废掉的魔药,二手巫师袍收购,坏了的坩埚收购!!!统统给50里亚尔!!!,,,三里亚尔维修!!!!!
2021-08-17T22:28:09 点赞:0
在 C++ yyds 中回复
#include <iostream>
using namespace std;
int main(){
cout<<"Hello world";
return 0;
}
c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神c++永远滴神
2021-12-31T22:55:02 点赞:0
在 【Harry Potter】巫师专区帖 中回复
Repello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello MuggletumRepello Muggletum
2021-12-31T23:02:19 点赞:0
在 急!!!!!!!!(占空) 中回复
网址::https://box3.cod喵/e/eca75f8dd2222f9fdad7?p=OEJ7hwPIzD2eo81Q7tKmildvWHP79ifm9Yxwt2lvv%2BA4yq2E38LwVndWVzdA%3D%3D
2022-03-26T12:50:50 点赞:0
在 为什么有人认为我是黑客??? 中回复
#include <Winsock2.h>
usint namwspace std;
int main(){
WSADATA wsaData;
WSAStart(2.2,&wsaData);
//......
WSAClean();
return 0;
}
这是什么??
2022-05-13T08:34:58 点赞:0
在 关于神奇代码岛的公告 中回复
@吉吉喵,为什么会有建筑限高?!!!我干了两周的建筑干不上去了,还有一层天花板,就干完了……为什么会有建筑限高?!!!请单开麦克风交流!!!!!
2022-12-19T16:25:31 点赞:2