(隐) 传奇游戏的运营设计 2024年3月1日    传奇 ************************
(摘) Godot关于网络(持续更新) 2024年2月29日    godot 网络 收录关于Godot网络的方方面面,陆续增加. 高级多人游戏 官方原文链接 # 客户端 var peer = ENetMultiplayerPeer.new() peer.create_client(IP_ADDRESS, PORT) multiplayer.multiplayer_peer = peer # 服务端 var peer = ENetMultiplayerPeer.new() peer.create_server(PORT, MAX_CLIENTS) multiplayer.multiplayer_peer = peer # … ...
(摘) Godot浮动文字 2024年2月29日    godot 浮动 主场景中,鼠标左键点击则出现浮动文字 浮动文字场景: 代码: extends Node2D @export var text :String @export var velocity = Vector2.ZERO @export var gravity = Vector2.ZERO @export var mass = 100 func _ready(): var tween = create_tween() … ...
(摘) Godot ProjectSettings 获取工程设置 2024年2月27日    godot projectsettings 原文链接 这个对象常用于读取自定义游戏配置选项。 例如用以下代码来获取项目名称: ProjectSettings.get_setting("application/config/name") 项目描述:application/config/description 版本信息:application/config/version ...
(摘) Godot 等待信息和协程 await 2024年2月27日    godot await 原文链接 await 关键字可以用来创建协程,会等待某个信号发出之后再继续执行下面的代码 例如,要暂停代码执行,直到到用户按下某个按钮后才能继续往下执行剩余代码,你就可以这样写: ...
(摘) Golang获取网段内所有IP 2024年2月26日    golang ip 通过网关IP和掩码,获取本网段所有IP。通过“通义千问”搜索出来的不靠谱。 package main import ( "fmt" "net" ) // 获取同网段所有 IP 地址 func getIPsInRange(ipAddr string, subnetMask string) ([]string, error) { ip := net.ParseIP(ipAddr) mask := net.IPMask(net.ParseIP(subnetMask).To4()) // 获取 IP 地址所在的网络 _, ipNet, err := …
(原) Godot热更 2024年2月25日    godot 热更 也不知道这算不算“热更”,流程如下: Godot客户端启动后,获取服务端信息,判断版本是否相同,是否需要下载压缩包(pck) 载入固定(或服务端指定)的启动场景运行。 Godot客户端只需要一个载入场景,且导出时包含到主程序中。这样我的客户端程序只有76.8MB,通过WinRar压缩为自解包,大小为22.2MB。已经足够小了。 ...
(原) Godot下载数据 2024年2月25日    godot 下载 在Godot中实现下载更建议使用HttpClient,它不是控件。主要是在其它线程中进行下载,在_process()中显示进度。保存时使用 file.store_buffer。 ...
(摘) go代码的磁力文件下载 2024年2月23日    go 磁力文件 网上示例较少,有需要研究,例如进度条之类… package main import "github.com/anacrolix/torrent" func main() { c, _ := torrent.NewClient(nil) t, _ := … ...
(摘) Go1.22的变化 2024年2月19日    go ,我只是作一些个人记录,并不全面。 据说性能提升1-3%,内存占用减少1%。启用PGO(Profile-guided Optimization 配置文件引导优化)后,大多数程序的性能提高2%-14% ...