45 lines
1.1 KiB
GDScript3
45 lines
1.1 KiB
GDScript3
|
|
extends Control
|
||
|
|
|
||
|
|
const WEBSOCKET_ENDPOINT: String = "wss://dev.bytesandpieces.xyz:9088"
|
||
|
|
|
||
|
|
const insect_resources = [
|
||
|
|
preload("res://Tile/Prefabs/Ant.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Bee.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Beetle.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Grasshopper.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Ladybug.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Mosquito.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Pillbug.tres"),
|
||
|
|
preload("res://Tile/Prefabs/Spider.tres")
|
||
|
|
]
|
||
|
|
|
||
|
|
var insect_data = {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
func prepare_insect_data() -> void:
|
||
|
|
var c: int = 65
|
||
|
|
|
||
|
|
#for i in insect_resources:
|
||
|
|
#for k in 2:
|
||
|
|
#print(String.chr(c))
|
||
|
|
#c = c + 1
|
||
|
|
|
||
|
|
# Called when the node enters the scene tree for the first time.
|
||
|
|
func _ready() -> void:
|
||
|
|
prepare_insect_data()
|
||
|
|
|
||
|
|
WSClient.lobby_joined.connect(_on_lobby_joined)
|
||
|
|
|
||
|
|
func _on_lobby_joined(lobby: String) -> void:
|
||
|
|
pass
|
||
|
|
|
||
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
|
func _process(delta: float) -> void:
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
func _on_button_pressed() -> void:
|
||
|
|
WSClient.start(WEBSOCKET_ENDPOINT, "", false)
|
||
|
|
pass # Replace with function body.
|