如果您已经回答了yes
其中一个问题,那么lemverse
适合您!
您可以在本地、服务器上启动它。
[hidecontent type="logged" desc="隐藏内容:登录后可查看"]
为了能够创建您自己的元宇宙,您将需要一些 tilesets。 我们建议使用 16x16 像素的图块集。
要上传新的 tileset,请访问 urlhttp://localhost:3000/editor
或http://lemverse.example.com/editor
只有具有admin
角色的人才能访问此页面。
以下是所有部分的说明:
5
和之间6
。2
和不显示。0
到8
修改图层2
是默认的,因此不显示c
将方块更改为撞击方块(将显示为红色)一旦你导入了 tileset 并针对碰撞和分层做了一些调整,你就可以开始建造你的宇宙了!
这个编辑器与 tilesets 编辑器生成在同一个地方。
要添加新资源,只需要在页面上拖放即可。
以下是所有部分的说明:
要编辑元宇宙,你需要拥有这种做的权利。幸运的是,在产品之外任何人都可以做到!
要移动到编辑器模型,只需要简单地执行它e
,您就会看到它!
一旦你点击e
你就会看到这样的东西:
以下是所有部分的说明:
cmd+z
营销你刚刚做的事情。eraser
工具删除一个图层(从0
到的快捷方式8
)或者点击c
以在选择时删除所有图层。eraser
层很有用)一次你e
再点击你会看到这样的东西:
您可以添加一个区域,然后在地图上选择左上角,然后选择新区域的右下角。
如果你想编辑一个区域,只需要点击任一个角度坐标,然后点击地图。
ℹ️在编辑过程中按“alt”或“option”将世界坐标捕捉到瓷砖坐标
每个小区都可以配置为制作更多的东西。 要编辑这些信息,只需要单击房间名称(粗体文本)即可。
{
"adminOnly": false|true, // Put true to restrict the zone to administrators
"name": "PianoSession", // Name displayed when you enter in the zone
"hideName": false|true, // Shows/hides the name of the zone when the user enters it
"roomName": "", // Open a jitsi room with the given name, leave empty to do nothing
"teleportEndpoint": "", // Coordinate "640,480" where unauthorized people will be teleported once enter restricted zone
"unmute": false|true, // Automatically unmute jitsi mic (useful to unmute people on platform in conference room)
"unhide": false|true, // Automatically show cam in jitsi (useful to show people face automatically on platform in conference room)
"url": "https://mczak.com/code/piano/pianoframe", // If present, this will popup an iframe with this url inside
"fullscreen": false|true, // Set the iframe if full screen or not
"targetedLevelId": "", // Used for teleport zone. Should be the id of the level to teleport to.,
"inlineURL": "https://status.lemlist.com|<p>My custom text</p>", // Pop-in content with URL or HTML content
"disableCommunications": false|true, // Disabling all communications for the user inside the zone
"yt": false|true, // If the "url" attribute is a YouTube video it allows its integration without blocking
"requiredItems": ["itm_x", "itm_y"], // Items required to enter the zone
"spawn": false|true, // Mark this zone as the starting zone, users will be able to enter the level from here
"popInConfiguration": {
"position": "top", // Optional: Pop-in position on the zone (center, left, right, bottom or top), set "relative" for custom position using "x" & "y" (default center)
"x": 0, // Optional: Relative position from the zone's center on X (you need to set "position" to "relative")
"y": -60, // Optional: Relative position from the zone's center on Y (you need to set "position" to "relative")
"width": 120, // Optional: Custom width
"height": 45, // Optional: Custom height
"className": "wood-style welcome with-arrow tooltip acid fade-in animated-text" // Optional: List of CSS classes to customize pop-in's style
}
}
实体是地图之外的动态事件,与世界地图不同,可以与之交互并设置动画。
可以用它做很多事情,比如:
对于游戏开发者而言,实体应被视作添加组的简单标记符。
目前只能从JSON配置创建实体,一些参数可以直接使用接口修改。
这是门的基础JSON结构:
{
// Main data
"_id": "ent_x",
"name": "Door",
"levelId": "lvl_z",
"x": 0,
"y": 0,
// 0 = no action / 1 = actionable / 2 = pickable (will be stored in the user inventory)
"actionType": 0,
// optional: Linked entity, useful to create triggers
"entityId": "ent_y",
// States available (optional)
"state": "off",
"states": {
"off": {
"animation": "close", // animation to play when entering this state
"collider": {
"enable": true // enable the collider
}
},
"on": {
"animation": "open",
"collider": {
"enable": false
}
}
},
// Entity representation in the simulation (optional)
"gameObject": {
"scale": 1,
// Sprite component (optional)
"sprite": {
"key": "image_unique_id",
"path": "image_url|sprite_sheet_url",
"frameWidth": 32, // optional: set frame width on the spritesheet
"frameHeight": 48 // optional: set frame height on the spritesheet
},
// Animation component (optional)
"animations": {
"open": {
"repeat": 0,
"start": 0,
"end": 5
},
"close": {
"repeat": 0, // -1 to animate endlessly, 0 to animate once, x to animate x times
"start": 5, // starting animation on the
"end": 0 // ending frame
}
},
// Physics component (optional)
"collider": {
"radius": 15, // use "radius" to create a circle. Use "width" and "height" to create a rectangle
"offsetX": -15, // collider offset on X
"offsetY": -30, // collider offset on Y
"immovable": false, // static or dynamic physic body
"dragX": 0.05, // drag on x = "friction"/velocity slowdown speed
"dragY": 0.05, // drag on y = "friction"/velocity slowdown speed
"collideTilemap": true // enable or disable collision with walls
}
}
}
在lemverse中,您只有很少但有用的快捷方式!
在同一个宇宙中了解了更多什么explorers
? 点击Tab
,你会看到他们!还有可能是鬼...
只能admin
看到其他管理人员(与👑). 您可以通过单击锤子和手指来允许其他用户编辑您的宇宙🛠.
如果预定义,请点击从1
,5
它在你的角色显示一个表情符号。l
摄像头、共享屏幕可能对鼠标很烦人,所以只需要使用shift
+ 1
(到4
)切换选项的状态。
就像前面部分描述的那样,我们必须使用e
来启动编辑模式。
就像在现实生活中一样,您可以在周大喊大叫。 我们将此限制在您当前所处的区域。
为此,只需点击r
并说话! 完成后,只需松开触摸,您的消息就会发送给所有人并立即播放。
用户可能无法聊天。幸运的是,可以给用户留言。
使用非常简单,你只需要靠在你想留言的人,然后按下键p
,说话,松开键。
然后使用用户将收听通知。您还可以打开通知列表并使用收听旧消息cmd/ctrl + 5
。
要创建一个新的宇宙,您需要在levels
集合中添加一个文档。
只需要在浏览器控制台中运行以下命令:
Levels.insert({ _id: Levels.id(), name: "My test universe" });
对于level
结构,这里是所有字段的解释:
{
"_id": "lvl_XXXXXXXX", // Id of the level (useful for TP)
"name": "My test universe", // Name of your universe
"spawn": {
// Spawn position in level
[/hidecontent]
"y": 7
},
"skins": {
"guest": {
// Guest Avatar
"body": "chr_11111111111111111", // Id "characters" collection
"accessory": "chr_22222222222222222", // Id in "characters" collection (Optional)
"hair": "chr_33333333333333333", // Id in "characters" collection
"eye": "chr_44444444444444444", // Id in "characters" collection
"outfit": "chr_55555555555555555" // Id in "characters" collection
},
"default": {
// Default Avatar when user create account
"body": "chr_11111111111111111", // Id "characters" collection
"accessory": "chr_22222222222222222", // Id in "characters" collection (Optional)
"hair": "chr_33333333333333333", // Id in "characters" collection
"eye": "chr_44444444444444444", // Id in "characters" collection
"outfit": "chr_55555555555555555" // Id in "characters" collection
}
}
}
您可以在任何有用的地方使用不同的ID,例如在(下面的更多信息)defaultLevelId
中的属性中settings.json
。
settings.json
!该文件重新组合了相关设置的所有信息。 请注意,如部分所述Deploy in production
,还有一个包含敏感信息的附加文件将与存储库中的文件组合。
ℹ️最好的复制_settings.json
应用程序文件夹在可用的文件中,而不是复制下面的摘录
克隆回购后:
./app/
meteor npm install
meteor --settings settings-dev.json
该应用程序现在应该可以访问http://localhost:3000
,MongoDB 可以访问mongodb://localhost:3001/meteor
。
Webrtc 在本地主机上工作,但如果你想用另一台计算机进行测试,你需要有一个 HTTPS 连接。 你将需要使用不可通过的互连网推迟。
我们决定使用localtunnel。 一旦它安装在可访问的服务器上,设置LT_DOMAIN
没有http(s)的环境变量,所以只有空间。
之后,只需要启动ROOT_URL=https://lemverse-$(whoami).${LT_DOMAIN} meteor --settings settings-dev.json
。
修改createMyPeer
将peer.js
host 修改为lemverse-peer-USER-DOMAIN
while USER
= whoami
and DOMAIN
= LT_DOMAIN
env 更改量。
在以下位置访问您的本地实例:https://lemverse-USER-DOMAIN
。
⚠️使用本地隐道时不要忘记将对等端的端口更改为443
只需要创建您的帐户,瞧! 您现在有一个很好的播放器,一片都是黑色的!
第一个用户将开始终是管理员,因此有权通过按来编辑等级E
。如果你不是第一个用户,你就不是管理员,所以你不能改变任何东西😭. 让我们改变它!
执行此命令,您应成为管理人员:
remote(
`Meteor.users.update(Meteor.userId(), { $set: { roles: { admin: true } }})`
);
E
现在只需要按下键盘即可享受编辑的可能性(请参阅下面的更多详细信息)。
ℹ️在生产中,要执行命令,remote
您需要将自己 ( Meteor.userId()
) 添加到管理数据组中settings.json
(类似usr_XXXXXX
)或将其隐藏在/usr/local/etc/lemverse.json
(仅限服务端!)。
在lemverse你有不同的角度:
Guest
: 可以到处移动,但不能说话,不能共享屏幕,也不能听User
: 可以在除管理区 ( adminOnly=true
)以外的任何地方移动、交流、收听、共享屏幕Editor
:相同User
但也可以编辑级别别Admin
:与(对于所有等级)相同Editor
,但可以去每个区域并赋给人们Editor
角度颜色(通过UI)God
: 相同Admin
但也可以remote
从控制台运行指令官方lemverse图像是lempire/lemverse
。 如果你想拉取最后一个版本,你应该这样做: docker pull lempire/lemverse:latest
要构建最新版本的lemverse,只需要运行以下命令: docker build . -t lempire/lemverse:latest
要从您的源代码构建而无需安装任何东西,您可以运行以下命令:
docker build -f Dockerfile.dev . -t lempire/lemverse:dev
或者使用热重载运行完成整个的开发环境:docker-compose up -d
启动服务器需要一段时间。然后项目中的每个更改都会自动重载。
访问example/docker-compose-prod
以查找带有堆垛的部分说明docker-compose
。
要获得 slack 通知,您需要在要部的工作站上安装slack cli 。
你还应该有一个环境变化LEMVERSE_CHANNEL
如果您想要添加未完全完成或只是为了测试少数用户的功能,您应该使用beta flags
。
要使用beta标签,您有一个函数isLemverseBeta
可以按.hbs
原样在文件中调用,也可以.js
在lp.isLemverseBeta('myBetaFlag')
。
beta 标记存储在集合beta
中每个文件内命的数字组中users
。
由于数据存储在mongo数据库中,您可以简单地使用命令:
mongoexport --db lemverse --collection=tilesets --jsonArray --out lemverse-tilesets.json
要导入已保存的集合,请使用以下命令将其导入:
mongoimport --db=lemverse --collection=tilesets --host=localhost --port=9001 --file=./lemverse-tilesets.json --drop --jsonArray
tilesets
该命命令将使用文件中的数据替换当前集合。
remote
命令在您的浏览器中,您可以安全地(god
仅)在您的后端执行命令。
我们提供一个名为的命令remote
,它将把内容传送到后端以供使用eval
。
例如,要为自己添加 beta 标记,请在浏览器中执行以下命令:
remote(
"Meteor.users.update({ _id: Meteor.userId() }, { $addToSet: { 'beta': { $each: ['myAwesomeFeature'] } } });"
);
可以使用图像API修改讨论期间显示的头图像。为此,您只需修改该settings.json
文件。
[user_id]
您可以使用或[user_name]
访问请求头像的用户ID和名称,将动态参数添加到您的URL。
带有图片API的网站:
Robohash 示例:
https://robohash.org/[user_name]?set=set4&bgset=bg2&size=320x240