
Lv.1
签名:流星游戏官网http://lxgame2025.e.cn.vc/ 状态:🟢 在线 🔴 离线 2020年入猫 生日:1-29 关于协会: 编程极星创作者协会会员 【第七期k/n委员会】 【第八期k/n委员会】 ———— 来往工作室: 夜雨(副室) 猫鼠(副室) 流星 FBS编程科技工作室(室长) ———— 小目标(5级目标): 浏览--60w/60w 点赞--15480/14000 收藏--1329/10000 再创作--11432/1500 粉丝--3933/4000 ———— 称号目标 全部达成
在 『落汐&洛森的小店』「动态封面、动态logo、动态头像也都是阔以的」 中回复
格式:招生啦
形式动态logo
底图:渐变
文字内容:
飞跃流星工作室,共创美好未来!
工作室门槛:
1.至少1个原创作品
工作室期待你的加入
2022-03-29T19:48:07 点赞:0
在 求在神奇代码岛的居民们加个好友!!! 中回复
不来我就走了 imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"
2022-04-04T20:50:09 点赞:0
在 我在这里问一下大家,我的代码是不是错了? 中回复
模型存档
or (const e of world.querySelectorAll('*')) {//遍历所有实体
if (e.id.startsWith('存档点')) {//如果当前实体名左边部分刚好是"存档点", 比如 存档点-1 存档点-2...
e.collides = true //开启碰撞
e.fixed = true //固定实体不被推移
e.meshScale = e.meshScale.scale(1) //放大2倍
e.onEntityContact(({ other }) => { //每当存档点碰到另一个实体
if (other.isPlayer) { //另一个实体是玩家
if (e.position !== other.player.spawnPoint) { // 检测当前存档点是否玩家重生点, 避免反复在同一个存档点做多余的保存
other.player.directMessage('到达新的重生点') // 给玩家发消息
other.player.spawnPoint = e.position // 喵家重生点坐标设置成存档点的坐标
}
}
})
}
}
虚空:
for (let i = 0; i <= 126; i++) {
for (let j = 0; j <= 126; j++) {
for (let k = 0; k <= 8; k++) {
voxels.setVoxel(i, k, j, 0);
}
}
}2022-04-06T21:16:28 点赞:0
在 二创活动招人 中回复
// 创建玩家数据表
(async function () {
await db.sql`
CREATE TABLE IF NOT EXISTS players (
coin INTEGER NOT NULL,
exp INTEGER NOT NULL,
userKey TEXT PRIMARY KEY UNIQUE NOT NULL
)
`
})();
// 保存玩家数据
async function saveData(entity) {
if (entity.player.userKey) {
await db.sql`
INSERT INTO players (
coin,
exp,
userKey
)
VALUES (
${entity.coin},
${entity.exp},
${entity.player.userKey}
)
ON CONFLICT(userKey)
DO UPDATE SET
coin = excluded.coin,
exp = excluded.exp,
userKey = excluded.userKey
`
}
}
world.onPlayerLeave(async ({ entity }) => { //玩家离开游戏后保存
try {
await saveData(entity);
} catch (error) {
world.say(`SQL ERROR: ${error}`)
console.error(`SQL ERROR: ${error}`);
}
});
// 玩家数据读取
async function loadData(entity) {
const data = (
await (
db.sql`
SELECT * FROM players WHERE userKey = ${entity.player.userKey} limit 1
`
)
)[0];
if (data) {
try {
entity.coin = data.coin;
entity.exp = data.exp;
entity.player.directMessage('已读取数据');
} catch (error) {
world.say(`SQL ERROR: ${error}`)
console.error(`SQL ERROR: ${error}`);
}
} else {
// entity.player.directMessage('你目前还没有数据,已帮你创建');
world.say('热烈欢迎'+ entity.player.name + " 第一次来到地图!")
}
}
world.onPlayerJoin(async ({ entity }) => {
try {
await loadData(entity); // 导入玩家数据
await saveData(entity); // 保存玩家数据
} catch (error) {
world.say(`SQL ERROR: ${error}`) // 聊天区报错
console.error(`SQL ERROR: ${error}`); // 控制台报错
}
try {
await createTables() // 创建排行榜
}
catch (error) {
world.say(`SQL ERROR: ${error}`) // 聊天区报错
console.error(`SQL ERROR: ${error}`); // 控制台报错
}
})
world.onPlayerJoin({(entity)} =>{
entity.coin = 0
entity.exp = 0
})
2022-04-10T16:17:52 点赞:0
在 注意!!! 中回复
跑酷训练场v3.7代码全公开(反正浏览只有1k)
/* 受到伤害时,向玩家发送私信,提示战斗信息 */
world.onTakeDamage(({ entity, attacker, damage}) => {
if (!entity.isPlayer) return;
const attackerName = attacker.isPlayer ? attacker.player.name : attacker.id;
entity.player.directMessage(`[剩余HP: ${entity.hp}]: 你受到了 ${damage} 点来自"岩浆"的伤害`);
});
world.onVoxelContact(({ entity, voxel, x, y, z }) => {
if (voxel === voxels.id('ice')) {
voxels.setVoxel(x, y, z, '')
}
})
world.onPlayerJoin(({ entity }) => {
entity.onVoxelContact(async({ entity , voxel}) => {
if(voxel == voxels.id('lava02')) {
entity.enableDamage = true;
entity.hurt(10);
sleep(2)
}
})
})
world.onVoxelContact(({ entity, voxel, x, y, z }) => {
if (voxel === voxels.id('carpet_08')) {
entity.hp = entity.maxHp
}
})
world.onDie(async({ entity }) => {
if (!entity.isPlayer) return;
for (let t = 1; t <= 6; t++) {
entity.player.directMessage(`你还有 ${String(6 - t)} 秒后复活`);
await sleep(1000);
}
entity.player.forceRespawn();
});
for (const e of world.querySelectorAll('*')) {//遍历所有实体
if (e.id.startsWith('存档点')) {//如果当前实体名左边部分刚好是"存档点", 比如 存档点-1 存档点-2...
e.collides = true //开启碰撞
e.fixed = true //固定实体不被推移
e.meshScale = e.meshScale.scale(1) //放大2倍
e.onEntityContact(({ other }) => { //每当存档点碰到另一个实体
if (other.isPlayer) { //另一个实体是玩家
if (e.position !== other.player.spawnPoint) { // 检测当前存档点是否玩家重生点, 避免反复在同一个存档点做多余的保存
other.player.directMessage('到达新的重生点') // 给玩家发消息
other.player.spawnPoint = e.position // 喵家重生点坐标设置成存档点的坐标
}
}
})
}
}
for (const e of world.querySelectorAll('*')) {//遍历所有实体
if (e.id.startsWith('终点')) {//如果当前实体名左边部分刚好是"终点", 比如 终点-1 终点-2...
e.collides = true //开启碰撞
e.fixed = true //固定实体不被推移
// e.meshScale = e.meshScale.scale(2) //放大2倍
e.onEntityContact(({ other }) => { //每当存档点碰到另一个实体
if (other.isPlayer) { //另一个实体是玩家
if (e.position !== other.player.spawnPoint) { // 检测当前存档点是否玩家重生点, 避免反复在同一个存档点做多余的保存
other.player.directMessage('到达终点!') // 给玩家发消息
other.player.canFly = true
world.say(`恭喜${other.player.name}到达了跑酷终点并获得了飞行奖励`)
other.player.spawnPoint = e.position // 喵家重生点坐标设置成存档点的坐标
}
}
})
}
}
//world.onPlayerJoin(({ entity }) => {
//const dialog = entity.player.dialog({
//type: Box3DialogType.TEXT,
//title: "飞跃的流星",
//titleTextColor: new Box3RGBAColor(0, 0, 0, 1),
//titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
//content: `欢迎你来到这个跑酷!到达终点会有飞行奖励哦!加油!`,
//contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
//contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1), //颜色
//lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
//lookTarget: entity,
//});
//});//这个是显示对话框
//world.onPress(async({entity,button})=>{
//if(button == Box3ButtonType.ACTION0){
//const say = await entity.player.dialog({
// type:'input',
// title:'请输入要说的话:',
// content:'',
// confirmText:'发送',
//})
//if(say == null||say.length >= 20 ){return}
// world.say(entity.player.name+':'+say)
//}
//})
world.onPlayerJoin(({ entity }) => {
entity.onFluidEnter(() => {
entity.position.copy(entity.player.spawnPoint)
entity.position.y += 4
})
})
world.querySelectorAll('.invisible').forEach((e)=>{e.meshInvisible=true})
const TEST_PLAYER = ['飞跃的流星']
world.onPlayerJoin(({ entity }) => {
if (!TEST_PLAYER.includes(entity.player.name)) return; // 如果玩家名称不在列表里,则跳过后续脚本。
world.say(`创作者--${entity.player.name} 出现了!`);
})
//地图和模型要自己建
2022-04-11T19:09:54 点赞:0
在 关于神奇代码岛接入实名认证的公告 中回复
再像原来神岛就变成游戏大厅了 原本的创作平台变成box3游戏盒子 这是惨不忍睹的,支持此改变! imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%8A%A0%E6%B2%B9.gif"alt="emotion_编程猫_加油"
2022-04-12T20:36:29 点赞:2