猫史档案馆


星河影城

星河影城

Lv.1

天猫河眼

获赞:270收藏:71浏览:4076作品收藏:96

签名:我在制作游戏

回复帖子评论
上一页1 页 / 共 1下一页

招人~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 中回复

不要跟DTS书贝贝玩

是DTS书贝贝他自己把作品删除的

emotion_星能猫_哼emotion_星能猫_哼emotion_星能猫_哼emotion_星能猫_哼 

2023-07-07T12:53:10 点赞:0

【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复

我为啥导入不了音乐

2023-09-25T23:42:36 点赞:0

【代码岛3.0代码公布!】僵尸追杀玩家 中回复

搬砖喵有这个代码.我以前见过 /*本代码实现的功能: 1.僵尸追杀玩家,并会对玩家造成伤害 2.玩家可以点击僵尸进行反击 3.玩家喵三秒后在空中随机的地点复活 使用说明: 请先在模型库中搜索一个叫做“僵尸"的模型,并放进地图里!不然会出错 */ 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(40)//对玩家造成伤害 } }) e.onDie(()=>{ e.destroy()//僵尸喵掉,实体消失!谢谢@1232RvE反馈 }) } for(leti=0;i<30;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.position.x=Math.random()*127 entity.position.z=Math.random()*127 entity.position.y=100 awaitsleep(100)//防止引擎延迟造成复活后受到死前的伤害 entity.hp=entity.maxHp//恢复满血 }) }) world.onClick(({entity})=>{ entity.hurt(10)//被点中的实体会掉血 })

2023-10-31T20:37:51 点赞:0

【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复

网络异常

2023-11-12T17:57:43 点赞:1

网络异常??? 中回复

是啊.我也是.网络异常.源码世界被毁灭了

2023-11-12T18:12:54 点赞:0

【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复

为什么我没有星河工作室了? imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%BF%BB%E7%99%BD%E7%9C%BC.gif"alt="emotion_编程猫_翻白眼"imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%BF%BB%E7%99%BD%E7%9C%BC.gif"alt="emotion_编程猫_翻白眼"imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%BF%BB%E7%99%BD%E7%9C%BC.gif"alt="emotion_编程猫_翻白眼"imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%BF%BB%E7%99%BD%E7%9C%BC.gif"alt="emotion_编程猫_翻白眼"

2023-11-18T12:50:38 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1kN4y1Z7qP/?spm_id_from=333.788.recommend_more_video.4

2023-11-22T20:27:41 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1Vb411z78p/?spm_id_from=333.788.recommend_more_video.18

2023-11-22T20:41:26 点赞:0

编程大事件视频:https://space.bilibili.com/30059216 中回复

我看的

2023-11-24T13:55:27 点赞:0

【编程猫六周年】素材领取处! 中回复

https://shequ.codemao.cn/mall/theme/63

2023-11-24T21:53:26 点赞:0

为啥就没有工作室了呢? 中回复

https://shequ.codemao.cn/work_shop/12016

2023-11-24T22:38:32 点赞:0

请问围猎小鸡的效果怎么作 中回复

console.clear() varDefaultScale=[0.0625,0.0625,0.0625]; varQuat=newBox3Quaternion(0,0,0,1); varscore=0 functionspawn(x,y,z,meshName){ if(world.entityQuota()<=0){return}//如果可分配的实体小于等于0,就不再创建新的模型 varentity=world.createEntity({ mesh:meshName,//模型名 collides:true,//能碰撞 fixed:false,//固定 gravity:true,//受重力下落 meshScale:DefaultScale,//模型放大倍数 position:[x,y,z],//位置坐标 friction:0.5,//摩擦力 }) entity.enableDamage=true//允许公鸡受伤 entity.onVoxelContact(({x,y,z,voxel})=>{//当公鸡碰到地形方块 //当公鸡落地后,随机改变移动速度 entity.velocity.y=0.5+Math.random()*0.5 entity.velocity.x=(Math.random()-0.5)*0.5 entity.velocity.z=(Math.random()-0.5)*0.5 if(voxel===voxels.id('stone')){//如果公鸡碰到了石头方块,什么也不发生 }elseif(voxel===voxels.id('lava02')){//如果公鸡碰到了岩浆 entity.hurt(40)//公鸡扣40生命 }else{ voxels.setVoxel(x,y,z,'')//公鸡可以破坏其他类型的方块 } }) entity.onEntityContact(({other})=>{//当公鸡碰到另一个模型实体 if(other.isPlayer){//如果另一个模型实体是玩家 other.hurt(20)//这个玩家扣20生命 } }) varhandler=world.onTick(()=>{//计时循环,每秒更新16次公鸡的朝向 entity.meshOrientation=Quat.rotateY(Math.atan2(entity.velocity.z,entity.velocity.x))//公鸡朝向自己的移动方向 }) entity.onDie(()=>{//当公鸡喵(enitity.hp<=0) entity.destroy()//删除公鸡实体 score++; world.say('已经收拾了'+score+'只公鸡') }) entity.onDestroy(()=>{//当公鸡实体被删除 handler.cancel()//取消控制公鸡朝向的计时循环 }) returnentity } for(vari=0;i<250;i++){//生成250只公鸡模型实体 spawn(63,11+i,63,'mesh/公鸡.vb') } world.onPlayerJoin(({entity})=>{//当有新玩家进入游戏 entity.enableDamage=true//允许玩家受伤 entity.onVoxelSeparate(({x,y,z,voxel})=>{//玩家离开方块的时候 //spawn(x+0.5,y+1.5,z+0.5,'mesh/公鸡.vb')//在离开的方块留下公鸡模型 voxels.setVoxel(x,y+1,z,'lava02')//岩浆突出到地面 }) }) world.onPlayerLeave(({entity})=>{//当有玩家离开游戏 world.say('恭送'+entity.player.name)//世界广播 }) world.onChat(({entity,message})=>{//当有玩家在输入框发送消息 if(message==='1'){//如果那名玩家输入的是1 //让所有实体对你说欢迎 varallEntities=world.querySelectorAll('*'); for(vareofallEntities){ if(e.isPlayer){continue}//如果实体是玩家,就跳过 e.say('欢迎'+entity.player.name) } }elseif(message==='2'){ //让位置在(60,0,60)~(70,120,70)之间的实体对你说欢迎 varfoundEntities=world.searchBox(newBox3Bounds3( newBox3Vector3(60,0,60), newBox3Vector3(70,120,70), )) for(vareoffoundEntities){ if(e.isPlayer){continue}//如果实体是玩家,就跳过 e.say('hello'+entity.player.name) } }elseif(message==='复活'){ entity.hp=entity.maxHp entity.position.x=10 entity.position.y=50 entity.position.z=10 } }) world.breakVoxelSound=world.placeVoxelSound=''      

2023-11-24T22:41:03 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1jj411k7kJ/?spm_id_from=333.788.recommend_more_video.0

2023-12-16T01:36:10 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV17Q4y1n7k8/?spm_id_from=333.337.search-card.all.click

2023-12-16T01:55:40 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1Rc411U7HJ/?spm_id_from=333.788.recommend_more_video.0

2023-12-16T01:59:11 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1kw411P7o9/?spm_id_from=333.788.recommend_more_video.2

2023-12-16T02:02:51 点赞:0

我的网站??? 中回复

https://www.bilibili.com/video/BV1Cc411i78r/?spm_id_from=333.788.recommend_more_video.10

2023-12-16T02:36:56 点赞:0