mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2026-03-22 00:26:23 +00:00
changed folder scructure
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
source_md5="9750ca6557519b87fc4520d712122db2"
|
||||
dest_md5="5eb6e761bb9e4397cd2a5caa6c18dc5a"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
source_md5="ea99925cae38c148dc6a1c29df4fb92e"
|
||||
dest_md5="f73af61b19494ec5bf488ba2a748b42b"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="4c808b578f2c91daff0d263d354987bc"
|
||||
dest_md5="891b486e29729d74d35394bfcab59da4"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
source_md5="8fad288d82d0e9d24f41f65f4d5e4301"
|
||||
dest_md5="a9d8bb2f96bc788ab0d7fc16f125c927"
|
||||
|
||||
Binary file not shown.
9
kristofers/game/code/UI.gd
Normal file
9
kristofers/game/code/UI.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends CanvasLayer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Global.ui = self
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
Global.ui = null
|
||||
27
kristofers/game/code/game.gd
Normal file
27
kristofers/game/code/game.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Node2D
|
||||
|
||||
var current_spawn_location_instance_number = 1
|
||||
var current_player_location_instance_number = null
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
|
||||
|
||||
if get_tree().is_network_server():
|
||||
setup_player_positions()
|
||||
|
||||
|
||||
func setup_player_positions() -> void:
|
||||
for player in Players.get_children():
|
||||
if player.is_in_group("player"):
|
||||
for spawn_location in $spawn_locations.get_children():
|
||||
if int(spawn_location.name) == current_spawn_location_instance_number and current_player_location_instance_number != player:
|
||||
player.rpc("update_position", spawn_location.global_position)
|
||||
current_spawn_location_instance_number += 1
|
||||
current_player_location_instance_number = player
|
||||
|
||||
|
||||
func _player_disconnected(id) -> void:
|
||||
if Players.has_node(str(id)):
|
||||
Players.get_node(str(id)).username_text_instance.queue_free()
|
||||
Players.get_node(str(id)).queue_free()
|
||||
13
kristofers/game/code/global.gd
Normal file
13
kristofers/game/code/global.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends Node
|
||||
|
||||
var ui = null
|
||||
|
||||
func instance_node_at_location(node: Object, parent: Object, location: Vector2) -> Object:
|
||||
var node_instance = instance_node(node, parent)
|
||||
node_instance.global_position = location
|
||||
return node_instance
|
||||
|
||||
func instance_node(node: Object, parent: Object) -> Object:
|
||||
var node_instance = node.instance()
|
||||
parent.add_child(node_instance)
|
||||
return node_instance
|
||||
62
kristofers/game/code/network.gd
Normal file
62
kristofers/game/code/network.gd
Normal file
@@ -0,0 +1,62 @@
|
||||
extends Node
|
||||
|
||||
const DEFAULT_PORT = 28960
|
||||
const MAX_CLIENTS = 3
|
||||
|
||||
var server = null
|
||||
var client = null
|
||||
|
||||
var ip_address = ""
|
||||
var current_player_username = ""
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if OS.get_name() == "Windows":
|
||||
ip_address = IP.get_local_addresses()[3]
|
||||
elif OS.get_name() == "Android":
|
||||
ip_address = IP.get_local_addresses()[0]
|
||||
else:
|
||||
ip_address = IP.get_local_addresses()[3]
|
||||
|
||||
for ip in IP.get_local_addresses():
|
||||
if ip.begins_with("192.168.") and not ip.ends_with(".1"):
|
||||
ip_address = ip
|
||||
|
||||
get_tree().connect("connected_to_server", self, "_connected_to_server")
|
||||
get_tree().connect("server_disconnected", self, "_server_disconnected")
|
||||
|
||||
|
||||
func create_server() -> void:
|
||||
server = NetworkedMultiplayerENet.new()
|
||||
server.create_server(DEFAULT_PORT, MAX_CLIENTS)
|
||||
get_tree().set_network_peer(server)
|
||||
Global.instance_node(load("res://scenes/server_advertiser.tscn"), get_tree().current_scene)
|
||||
|
||||
|
||||
func join_server() -> void:
|
||||
client = NetworkedMultiplayerENet.new()
|
||||
client.create_client(ip_address, DEFAULT_PORT)
|
||||
get_tree().set_network_peer(client)
|
||||
|
||||
|
||||
func reset_network_connections():
|
||||
if get_tree().has_network_peer():
|
||||
get_tree().network_peer = null
|
||||
|
||||
|
||||
func _connected_to_server() -> void:
|
||||
print("Successfully connected to the server")
|
||||
|
||||
|
||||
func _server_disconnected() -> void:
|
||||
print("Disconnected from the server")
|
||||
|
||||
for child in Players.get_children():
|
||||
if child.is_in_group("Net"):
|
||||
child.queue_free()
|
||||
|
||||
reset_network_connections()
|
||||
|
||||
if Global.ui != null:
|
||||
var prompt = Global.instance_node(load("res://scenes/simple_prompt.tscn"), Global.ui)
|
||||
prompt.set_text("Disconnected from server")
|
||||
76
kristofers/game/code/network_setup.gd
Normal file
76
kristofers/game/code/network_setup.gd
Normal file
@@ -0,0 +1,76 @@
|
||||
extends Control
|
||||
|
||||
var player = load("res://scenes/player.tscn")
|
||||
|
||||
onready var multiplayer_config_ui = $multiplayer_configure
|
||||
onready var username_text_edit = $multiplayer_configure/username_text_edit
|
||||
onready var device_ip_address = $UI/device_ip_address
|
||||
onready var start_game = $UI/start_game
|
||||
|
||||
|
||||
func _ready():
|
||||
get_tree().connect("network_peer_connected", self, "_player_connected")
|
||||
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
|
||||
get_tree().connect("connected_to_server", self, "_connected_to_server")
|
||||
|
||||
device_ip_address.text = Network.ip_address
|
||||
|
||||
if get_tree().network_peer != null:
|
||||
pass
|
||||
else:
|
||||
start_game.hide()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if get_tree().network_peer != null:
|
||||
if get_tree().get_network_connected_peers().size() >= 0 and get_tree().is_network_server():
|
||||
start_game.show()
|
||||
else:
|
||||
start_game.hide()
|
||||
|
||||
|
||||
func _player_connected(id) -> void:
|
||||
print("Player " + str(id) + " has connected")
|
||||
instance_player(id)
|
||||
|
||||
|
||||
func _player_disconnected(id) -> void:
|
||||
print("Player " + str(id) + " has disconnected")
|
||||
if Players.has_node(str(id)):
|
||||
Players.get_node(str(id)).username_text_instance.queue_free()
|
||||
Players.get_node(str(id)).queue_free()
|
||||
|
||||
|
||||
func _on_create_server_pressed():
|
||||
if username_text_edit.text != "":
|
||||
Network.current_player_username = username_text_edit.text
|
||||
multiplayer_config_ui.hide()
|
||||
Network.create_server()
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func _on_join_server_pressed():
|
||||
if username_text_edit.text != "":
|
||||
multiplayer_config_ui.hide()
|
||||
username_text_edit.hide()
|
||||
Global.instance_node(load("res://scenes/server_browser.tscn"), self)
|
||||
|
||||
|
||||
func _connected_to_server() -> void:
|
||||
yield(get_tree().create_timer(0.1), "timeout")
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func instance_player(id) -> void:
|
||||
var player_instance = Global.instance_node_at_location(player, Players, Vector2(rand_range(0, 1920), rand_range(0, 1080)))
|
||||
player_instance.name = str(id)
|
||||
player_instance.set_network_master(id)
|
||||
player_instance.username = username_text_edit.text
|
||||
|
||||
|
||||
func _on_start_game_pressed():
|
||||
rpc("switch_to_game")
|
||||
|
||||
|
||||
sync func switch_to_game() -> void:
|
||||
get_tree().change_scene("res://scenes/game.tscn")
|
||||
123
kristofers/game/code/player.gd
Normal file
123
kristofers/game/code/player.gd
Normal file
@@ -0,0 +1,123 @@
|
||||
extends KinematicBody2D
|
||||
|
||||
const JUMP_FORCE = 500
|
||||
const GRAVITY = 500
|
||||
const MAX_SPEED = 5000
|
||||
const ACCELERATION = 10
|
||||
|
||||
var speed = 50
|
||||
var velocity = Vector2()
|
||||
var fly = false
|
||||
|
||||
var username_text = load("res://scenes/username_text.tscn")
|
||||
var username setget username_set
|
||||
var username_text_instance = null
|
||||
|
||||
puppet var puppet_position = Vector2(0, 0) setget puppet_position_set
|
||||
puppet var puppet_velocity = Vector2()
|
||||
puppet var puppet_rotaion = 0
|
||||
puppet var puppet_username = "" setget puppet_username_set
|
||||
|
||||
onready var tween = $Tween
|
||||
|
||||
|
||||
func _ready():
|
||||
get_tree().connect("network_peer_connected", self, "_network_peer_connected")
|
||||
username_text_instance = Global.instance_node_at_location(username_text, Players, global_position)
|
||||
username_text_instance.player_following = self
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if username_text_instance != null:
|
||||
username_text_instance.name = "username" + name
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if is_network_master():
|
||||
mode_switch(delta)
|
||||
screen_wrap()
|
||||
|
||||
|
||||
func mode_switch(delta):
|
||||
if Input.is_action_just_pressed("mode_switch") and fly == false:
|
||||
fly = true
|
||||
elif Input.is_action_just_pressed("mode_switch") and fly == true:
|
||||
fly = false
|
||||
|
||||
if fly == false:
|
||||
movement(delta)
|
||||
elif fly == true:
|
||||
flying()
|
||||
|
||||
|
||||
func movement(delta):
|
||||
if Input.is_action_just_pressed("stop"):
|
||||
velocity.x = 0
|
||||
velocity.y = 0
|
||||
if Input.is_action_pressed("move_left"):
|
||||
if velocity.x > -MAX_SPEED:
|
||||
velocity.x -= speed
|
||||
elif Input.is_action_pressed("move_right"):
|
||||
if velocity.x < MAX_SPEED:
|
||||
velocity.x += speed
|
||||
|
||||
#if !Input.is_action_pressed("move_left") and !Input.is_action_pressed("move_right") and is_on_floor():
|
||||
# velocity.x = 0
|
||||
|
||||
velocity.y += GRAVITY * delta
|
||||
if Input.is_action_pressed("jump") and is_on_floor():
|
||||
velocity.y -= JUMP_FORCE
|
||||
velocity = move_and_slide(velocity, Vector2.UP)
|
||||
|
||||
|
||||
func flying():
|
||||
var fly_speed = 1000
|
||||
var velocity = Vector2()
|
||||
if Input.is_action_pressed("move_right"):
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed("move_left"):
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed("move_down"):
|
||||
velocity.y += 1
|
||||
if Input.is_action_pressed("move_up"):
|
||||
velocity.y -= 1
|
||||
velocity = velocity.normalized() * fly_speed
|
||||
|
||||
velocity = move_and_slide(velocity)
|
||||
|
||||
|
||||
func screen_wrap():
|
||||
if position.x <= -10:
|
||||
position.x = get_viewport_rect().size.x
|
||||
if position.x >= get_viewport_rect().size.x + 10:
|
||||
position.x = 0
|
||||
|
||||
|
||||
func puppet_position_set(new_value) -> void:
|
||||
puppet_position = new_value
|
||||
tween.interpolate_property(self, "global_position", global_position, puppet_position, 0.1)
|
||||
tween.start()
|
||||
|
||||
|
||||
func username_set(new_value) -> void:
|
||||
username = new_value
|
||||
if is_network_master() and username_text_instance != null:
|
||||
username_text_instance.text = username
|
||||
rset("puppet_username", username)
|
||||
|
||||
|
||||
func puppet_username_set(new_value) -> void:
|
||||
puppet_username = new_value
|
||||
if not is_network_master() and username_text_instance != null:
|
||||
username_text_instance.text = puppet_username
|
||||
|
||||
|
||||
func _network_peer_connected(id) -> void:
|
||||
rset_id(id, "puppet_username", username)
|
||||
|
||||
|
||||
func _on_network_tick_rate_timeout():
|
||||
if is_network_master():
|
||||
rset_unreliable("puppet_position", global_position)
|
||||
rset_unreliable("puppet_velocity", velocity)
|
||||
rset_unreliable("puppet_rotation", rotation_degrees)
|
||||
35
kristofers/game/code/server_advertiser.gd
Normal file
35
kristofers/game/code/server_advertiser.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Node
|
||||
|
||||
|
||||
export (float) var broadcast_interval = 1.0
|
||||
var server_info = {"name": "LAN Game"}
|
||||
var socket_udp
|
||||
var broadcast_timer = Timer.new()
|
||||
var broadcast_port = Network.DEFAULT_PORT
|
||||
|
||||
|
||||
func _enter_tree():
|
||||
broadcast_timer.wait_time = broadcast_interval
|
||||
broadcast_timer.one_shot = false
|
||||
broadcast_timer.autostart = true
|
||||
|
||||
if get_tree().is_network_server():
|
||||
add_child(broadcast_timer)
|
||||
broadcast_timer.connect("timeout", self, "broadcast")
|
||||
|
||||
socket_udp = PacketPeerUDP.new()
|
||||
socket_udp.set_broadcast_enabled(true)
|
||||
socket_udp.set_dest_address('255.255.255.255', broadcast_port)
|
||||
|
||||
|
||||
func broadcast():
|
||||
server_info.name = Network.current_player_username
|
||||
var packet_message = to_json(server_info)
|
||||
var packet = packet_message.to_ascii()
|
||||
socket_udp.put_packet(packet)
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
broadcast_timer.stop()
|
||||
if socket_udp != null:
|
||||
socket_udp.close()
|
||||
47
kristofers/game/code/server_browser.gd
Normal file
47
kristofers/game/code/server_browser.gd
Normal file
@@ -0,0 +1,47 @@
|
||||
extends Control
|
||||
|
||||
onready var server_listener = $server_listener
|
||||
onready var server_ip_text_edit = $background_panel/server_ip_text_edit
|
||||
onready var server_container = $background_panel/VBoxContainer
|
||||
onready var manual_setup_button = $background_panel/manual_setup
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
server_ip_text_edit.hide()
|
||||
|
||||
|
||||
func _on_server_listener_new_server(serverInfo):
|
||||
var server_node = Global.instance_node(load("res://scenes/server_display.tscn"), server_container)
|
||||
server_node.text = "%s - %s" % [serverInfo.ip, serverInfo.name]
|
||||
server_node.ip_address = str(serverInfo.ip)
|
||||
|
||||
|
||||
func _on_server_listener_remove_server(serverIp):
|
||||
for serverNode in server_container.get_children():
|
||||
if serverNode.is_in_group("server_display"):
|
||||
if serverNode.ip_address == serverIp:
|
||||
serverNode.queue_free()
|
||||
break
|
||||
|
||||
|
||||
func _on_manual_setup_pressed():
|
||||
if manual_setup_button.text != "Exit setup":
|
||||
server_ip_text_edit.show()
|
||||
manual_setup_button.text = "Exit setup"
|
||||
server_container.hide()
|
||||
server_ip_text_edit.call_deferred("grab_focus")
|
||||
else:
|
||||
server_ip_text_edit.text = ""
|
||||
server_ip_text_edit.hide()
|
||||
server_container.show()
|
||||
|
||||
|
||||
func _on_join_server_pressed():
|
||||
if server_ip_text_edit.text != "":
|
||||
Network.ip_address = server_ip_text_edit.text
|
||||
hide()
|
||||
Network.join_server()
|
||||
|
||||
|
||||
func _on_go_back_pressed():
|
||||
get_tree().reload_current_scene()
|
||||
9
kristofers/game/code/server_display.gd
Normal file
9
kristofers/game/code/server_display.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Label
|
||||
|
||||
var ip_address = ""
|
||||
|
||||
|
||||
func _on_join_button_pressed():
|
||||
Network.ip_address = ip_address
|
||||
Network.join_server()
|
||||
get_parent().get_parent().queue_free()
|
||||
66
kristofers/game/code/server_listener.gd
Normal file
66
kristofers/game/code/server_listener.gd
Normal file
@@ -0,0 +1,66 @@
|
||||
extends Node
|
||||
|
||||
|
||||
signal new_server
|
||||
signal remove_server
|
||||
|
||||
var cleanup_timer = Timer.new()
|
||||
var socket_udp = PacketPeerUDP.new()
|
||||
var listen_port = Network.DEFAULT_PORT
|
||||
var known_servers = {}
|
||||
|
||||
export (int) var server_cleanup_threshold = 3
|
||||
|
||||
|
||||
func _init():
|
||||
cleanup_timer.wait_time = server_cleanup_threshold
|
||||
cleanup_timer.one_shot = false
|
||||
cleanup_timer.autostart = true
|
||||
cleanup_timer.connect("timeout", self, 'clean_up')
|
||||
add_child(cleanup_timer)
|
||||
|
||||
|
||||
func ready():
|
||||
known_servers.clear()
|
||||
|
||||
if socket_udp.listen(listen_port) != OK:
|
||||
print("GameServer LAN service: Error listening port: " + str(listen_port))
|
||||
else:
|
||||
print("GameServer LAN service: Llistening port: " + str(listen_port))
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if socket_udp.get_available_packet_count() > 0:
|
||||
var server_ip = socket_udp.get_packet_ip()
|
||||
var server_port = socket_udp.get_packet_port()
|
||||
var array_bytes = socket_udp.get_packet()
|
||||
|
||||
if server_ip != "" and server_port > 0:
|
||||
if not known_servers.has(server_ip):
|
||||
var serverMessage = array_bytes.get_string_from_ascii()
|
||||
var gameInfo = parse_json(serverMessage)
|
||||
gameInfo.ip = server_ip
|
||||
gameInfo.lastSeen = OS.get_unix_time()
|
||||
known_servers[server_ip] = gameInfo
|
||||
emit_signal("new_server", gameInfo)
|
||||
print(socket_udp.get_packet_ip())
|
||||
else:
|
||||
var gameInfo = known_servers[server_ip]
|
||||
gameInfo.lastSeen = OS.get_unix_time()
|
||||
|
||||
|
||||
func cleanup():
|
||||
var now = OS.get_unix_time()
|
||||
for server_ip in known_servers:
|
||||
var serverInfo = known_servers[server_ip]
|
||||
if (now - serverInfo.lastSeen) > server_cleanup_threshold:
|
||||
known_servers.erase(server_ip)
|
||||
print("Remove old server: %s" % server_ip)
|
||||
emit_signal("remove_server", server_ip)
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
socket_udp.close()
|
||||
|
||||
|
||||
|
||||
10
kristofers/game/code/simple_prompt.gd
Normal file
10
kristofers/game/code/simple_prompt.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _on_ok_pressed():
|
||||
get_tree().change_scene("res://scenes/main_menu.tscn")
|
||||
|
||||
|
||||
|
||||
func set_text(text) -> void:
|
||||
$Label.text = text
|
||||
15
kristofers/game/code/username_text.gd
Normal file
15
kristofers/game/code/username_text.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Node2D
|
||||
|
||||
var player_following = null
|
||||
var text = "" setget text_set
|
||||
onready var label = $Label
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if player_following != null:
|
||||
global_position = player_following.global_position
|
||||
|
||||
|
||||
func text_set(new_text) -> void:
|
||||
text = new_text
|
||||
label.text = text
|
||||
7
kristofers/game/default_env.tres
Normal file
7
kristofers/game/default_env.tres
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
24
kristofers/game/export_presets.cfg
Normal file
24
kristofers/game/export_presets.cfg
Normal file
@@ -0,0 +1,24 @@
|
||||
[preset.0]
|
||||
|
||||
name="game"
|
||||
platform="Linux/X11"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="Builds/game.x86_64"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
binary_format/64_bits=true
|
||||
binary_format/embed_pck=true
|
||||
texture_format/bptc=false
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
texture_format/no_bptc_fallbacks=true
|
||||
BIN
kristofers/game/font/Roboto-Regular.ttf
Normal file
BIN
kristofers/game/font/Roboto-Regular.ttf
Normal file
Binary file not shown.
9
kristofers/game/font/roboto.tres
Normal file
9
kristofers/game/font/roboto.tres
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://font/Roboto-Regular.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 64
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
BIN
kristofers/game/icon.png
Normal file
BIN
kristofers/game/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
34
kristofers/game/icon.png.import
Normal file
34
kristofers/game/icon.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
96
kristofers/game/project.godot
Normal file
96
kristofers/game/project.godot
Normal file
@@ -0,0 +1,96 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Game_4"
|
||||
run/main_scene="res://scenes/main_menu.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
Network="*res://code/network.gd"
|
||||
Global="*res://code/global.gd"
|
||||
Players="*res://scenes/players.tscn"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=1920
|
||||
window/size/height=1080
|
||||
window/size/test_width=1280
|
||||
window/size/test_height=720
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
mode_switch={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
stop={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
14
kristofers/game/scenes/floor.tscn
Normal file
14
kristofers/game/scenes/floor.tscn
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://sprites/floor.svg" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 960, 24 )
|
||||
|
||||
[node name="floor" type="StaticBody2D"]
|
||||
|
||||
[node name="floor" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
25
kristofers/game/scenes/game.tscn
Normal file
25
kristofers/game/scenes/game.tscn
Normal file
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/floor.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://code/game.gd" type="Script" id=2]
|
||||
|
||||
[node name="game" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="floor" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 960, 1056 )
|
||||
scale = Vector2( 2, 1 )
|
||||
|
||||
[node name="spawn_locations" type="Node" parent="."]
|
||||
|
||||
[node name="1" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 512, 810 )
|
||||
|
||||
[node name="2" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1408, 810 )
|
||||
|
||||
[node name="3" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 512, 270 )
|
||||
|
||||
[node name="4" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1408, 270 )
|
||||
94
kristofers/game/scenes/main_menu.tscn
Normal file
94
kristofers/game/scenes/main_menu.tscn
Normal file
@@ -0,0 +1,94 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://font/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://code/network_setup.gd" type="Script" id=2]
|
||||
[ext_resource path="res://code/UI.gd" type="Script" id=3]
|
||||
|
||||
[node name="network_setup" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="multiplayer_configure" type="Control" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="create_server" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -267.5
|
||||
margin_top = -202.0
|
||||
margin_right = 267.5
|
||||
margin_bottom = -26.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Create server"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="join_server" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -267.5
|
||||
margin_top = 24.0
|
||||
margin_right = 267.5
|
||||
margin_bottom = 200.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Join server"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="username_text_edit" type="LineEdit" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -422.5
|
||||
margin_top = 117.0
|
||||
margin_right = 422.5
|
||||
margin_bottom = 221.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
placeholder_text = "Enter username"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="start_game" type="Button" parent="UI"]
|
||||
margin_left = 27.0
|
||||
margin_top = 27.0
|
||||
margin_right = 391.0
|
||||
margin_bottom = 158.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Start game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="UI"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -150.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="multiplayer_configure/create_server" to="." method="_on_create_server_pressed"]
|
||||
[connection signal="pressed" from="multiplayer_configure/join_server" to="." method="_on_join_server_pressed"]
|
||||
[connection signal="pressed" from="UI/start_game" to="." method="_on_start_game_pressed"]
|
||||
26
kristofers/game/scenes/player.tscn
Normal file
26
kristofers/game/scenes/player.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://sprites/square.svg" type="Texture" id=1]
|
||||
[ext_resource path="res://code/player.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 16, 16 )
|
||||
|
||||
[node name="player" type="KinematicBody2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="square" type="Sprite" parent="."]
|
||||
scale = Vector2( 2.5, 2.5 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2( 2.5, 2.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Tween" type="Tween" parent="."]
|
||||
|
||||
[node name="network_tick_rate" type="Timer" parent="."]
|
||||
wait_time = 0.03
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="network_tick_rate" to="." method="_on_network_tick_rate_timeout"]
|
||||
3
kristofers/game/scenes/players.tscn
Normal file
3
kristofers/game/scenes/players.tscn
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="players" type="Node"]
|
||||
6
kristofers/game/scenes/server_advertiser.tscn
Normal file
6
kristofers/game/scenes/server_advertiser.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://code/server_advertiser.gd" type="Script" id=1]
|
||||
|
||||
[node name="server_advertiser" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
148
kristofers/game/scenes/server_browser.tscn
Normal file
148
kristofers/game/scenes/server_browser.tscn
Normal file
@@ -0,0 +1,148 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://font/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://scenes/server_listener.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://code/server_browser.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "searching_for_servers"
|
||||
length = 0.8
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:text")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.4, 0.6 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ "Searching for servers", "Searching for servers.", "Searching for servers..", "Searching for servers..." ]
|
||||
}
|
||||
|
||||
[node name="server_browser" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="background_panel" type="Panel" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 96.0
|
||||
margin_top = 162.0
|
||||
margin_right = -96.0
|
||||
margin_bottom = -54.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="manual_setup" type="Button" parent="background_panel"]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -473.0
|
||||
margin_top = -175.0
|
||||
margin_right = -30.0
|
||||
margin_bottom = -30.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Manual setup"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="go_back" type="Button" parent="background_panel"]
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 30.0
|
||||
margin_top = -170.0
|
||||
margin_right = 473.0
|
||||
margin_bottom = -25.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Go back"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="server_ip_text_edit" type="LineEdit" parent="background_panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -403.0
|
||||
margin_top = -243.0
|
||||
margin_right = 403.0
|
||||
margin_bottom = -138.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
|
||||
[node name="type_in_server_ip" type="Label" parent="background_panel/server_ip_text_edit"]
|
||||
anchor_right = 1.0
|
||||
margin_top = -105.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Type in server IP"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="join_server" type="Button" parent="background_panel/server_ip_text_edit"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -221.5
|
||||
margin_top = 94.5
|
||||
margin_right = 221.5
|
||||
margin_bottom = 239.5
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Join server"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="background_panel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 70.0
|
||||
margin_top = 40.0
|
||||
margin_right = -70.0
|
||||
margin_bottom = -175.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="searching_for_servers" type="Label" parent="background_panel/VBoxContainer"]
|
||||
margin_right = 1588.0
|
||||
margin_bottom = 76.0
|
||||
rect_min_size = Vector2( 0, 70 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Searching for servers.."
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="background_panel/VBoxContainer/searching_for_servers"]
|
||||
autoplay = "searching_for_servers"
|
||||
playback_speed = 0.5
|
||||
anims/searching_for_servers = SubResource( 1 )
|
||||
|
||||
[node name="server_browser_label" type="Label" parent="background_panel"]
|
||||
anchor_right = 1.0
|
||||
margin_top = -176.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Server Browser"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="server_listener" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[connection signal="pressed" from="background_panel/manual_setup" to="." method="_on_manual_setup_pressed"]
|
||||
[connection signal="pressed" from="background_panel/go_back" to="." method="_on_go_back_pressed"]
|
||||
[connection signal="pressed" from="background_panel/server_ip_text_edit/join_server" to="." method="_on_join_server_pressed"]
|
||||
[connection signal="new_server" from="server_listener" to="." method="_on_server_listener_new_server"]
|
||||
[connection signal="remove_server" from="server_listener" to="." method="_on_server_listener_remove_server"]
|
||||
32
kristofers/game/scenes/server_display.tscn
Normal file
32
kristofers/game/scenes/server_display.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://font/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://code/server_display.gd" type="Script" id=2]
|
||||
|
||||
[node name="server_display" type="Label"]
|
||||
anchor_right = 1.0
|
||||
margin_right = -220.0
|
||||
margin_bottom = 130.0
|
||||
rect_min_size = Vector2( 0, 130 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "N/A: 000.000.000"
|
||||
align = 1
|
||||
valign = 1
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="join_button" type="Button" parent="." groups=[
|
||||
"server_display",
|
||||
]]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -302.0
|
||||
margin_top = 13.0
|
||||
margin_bottom = -13.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Join"
|
||||
|
||||
[connection signal="pressed" from="join_button" to="." method="_on_join_button_pressed"]
|
||||
6
kristofers/game/scenes/server_listener.tscn
Normal file
6
kristofers/game/scenes/server_listener.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://code/server_listener.gd" type="Script" id=1]
|
||||
|
||||
[node name="server_listener" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
68
kristofers/game/scenes/simple_prompt.tscn
Normal file
68
kristofers/game/scenes/simple_prompt.tscn
Normal file
@@ -0,0 +1,68 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://font/Roboto-Regular.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://code/simple_prompt.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 100
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 100
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="simple_prompt" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -704.0
|
||||
margin_top = -330.0
|
||||
margin_right = 704.0
|
||||
margin_bottom = 330.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ok" type="Button" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -257.0
|
||||
margin_top = -310.0
|
||||
margin_right = 257.0
|
||||
margin_bottom = -113.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "OK"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -516.0
|
||||
margin_top = -155.5
|
||||
margin_right = 516.0
|
||||
margin_bottom = -68.5
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Simple prompt"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[connection signal="pressed" from="Panel/ok" to="." method="_on_ok_pressed"]
|
||||
21
kristofers/game/scenes/username_text.tscn
Normal file
21
kristofers/game/scenes/username_text.tscn
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://font/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://code/username_text.gd" type="Script" id=2]
|
||||
|
||||
[node name="username_text" type="Node2D"]
|
||||
z_index = 10
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = -197.0
|
||||
margin_top = -125.0
|
||||
margin_right = 197.0
|
||||
margin_bottom = -49.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "null"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
51
kristofers/game/sprites/floor.svg
Normal file
51
kristofers/game/sprites/floor.svg
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="1920"
|
||||
height="48"
|
||||
viewBox="0 0 508.00001 12.7"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="floor.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
width="7256.6929px"
|
||||
units="px"
|
||||
inkscape:zoom="0.14030934"
|
||||
inkscape:cx="416.9359"
|
||||
inkscape:cy="1297.1339"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1006"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="45"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs2" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<rect
|
||||
style="fill:#b4cffa;stroke-width:0.259237;fill-opacity:1"
|
||||
id="rect31"
|
||||
width="508"
|
||||
height="12.7"
|
||||
x="0"
|
||||
y="0" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
34
kristofers/game/sprites/floor.svg.import
Normal file
34
kristofers/game/sprites/floor.svg.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/floor.svg-297905206d682966af5dba035b7d5368.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/floor.svg"
|
||||
dest_files=[ "res://.import/floor.svg-297905206d682966af5dba035b7d5368.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
49
kristofers/game/sprites/square.svg
Normal file
49
kristofers/game/sprites/square.svg
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="32"
|
||||
height="32"
|
||||
viewBox="0 0 32 32"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="square.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:document-units="px"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="54.6875"
|
||||
inkscape:cy="42.75"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1006"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="45"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs2" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<rect
|
||||
style="fill:#aa0000"
|
||||
id="rect65"
|
||||
width="32"
|
||||
height="32"
|
||||
x="0"
|
||||
y="0" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
34
kristofers/game/sprites/square.svg.import
Normal file
34
kristofers/game/sprites/square.svg.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/square.svg-eb5ce7ff66dca983c1acbf7134c96e32.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/square.svg"
|
||||
dest_files=[ "res://.import/square.svg-eb5ce7ff66dca983c1acbf7134c96e32.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,3 @@
|
||||
source_md5="9750ca6557519b87fc4520d712122db2"
|
||||
dest_md5="5eb6e761bb9e4397cd2a5caa6c18dc5a"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="955d690ad235d803af1ea20b98c6c3dc"
|
||||
dest_md5="92a6f5c5b2f6296b05cab30ce1278e0e"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="4f501708bd37bf4cbdd218c104ac8ae5"
|
||||
dest_md5="d6c6d4987c8841435ace13715a0c1bd8"
|
||||
|
||||
Binary file not shown.
19
kristofers/test/Game_1/Floor.tscn
Normal file
19
kristofers/test/Game_1/Floor.tscn
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/lava.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 251.631, 251.123 )
|
||||
|
||||
[node name="Floor" type="StaticBody2D"]
|
||||
scale = Vector2( 0.3, 0.3 )
|
||||
|
||||
[node name="lava" type="Sprite" parent="."]
|
||||
position = Vector2( -3.75497, -1.16341 )
|
||||
scale = Vector2( 0.3, 0.3 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -3.75497, -1.16341 )
|
||||
scale = Vector2( 0.3, 0.3 )
|
||||
shape = SubResource( 1 )
|
||||
60
kristofers/test/Game_1/Main.tscn
Normal file
60
kristofers/test/Game_1/Main.tscn
Normal file
@@ -0,0 +1,60 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Floor.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://floor.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 559.976, 757.874 )
|
||||
|
||||
[node name="Floor" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 539.901, 843.359 )
|
||||
|
||||
[node name="Floor2" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 587.901, 843.359 )
|
||||
|
||||
[node name="Floor3" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 635.901, 843.359 )
|
||||
|
||||
[node name="Floor4" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 755.901, 787.359 )
|
||||
|
||||
[node name="Floor5" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 803.901, 771.359 )
|
||||
|
||||
[node name="Floor8" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 1027.9, 667.359 )
|
||||
|
||||
[node name="Floor11" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 635.901, 547.359 )
|
||||
|
||||
[node name="Floor12" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 683.901, 547.359 )
|
||||
|
||||
[node name="Floor14" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 779.901, 547.359 )
|
||||
|
||||
[node name="Floor15" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 827.901, 547.359 )
|
||||
|
||||
[node name="Floor13" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 731.901, 547.359 )
|
||||
|
||||
[node name="Floor9" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 1147.9, 595.359 )
|
||||
|
||||
[node name="Floor10" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 1267.9, 539.359 )
|
||||
|
||||
[node name="Floor6" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 851.901, 787.359 )
|
||||
|
||||
[node name="floor" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 962.745, 26.6196 )
|
||||
scale = Vector2( 2, 1 )
|
||||
|
||||
[node name="floor2" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 1003.11, 1052.51 )
|
||||
scale = Vector2( 2, 1 )
|
||||
28
kristofers/test/Game_1/Player.gd
Normal file
28
kristofers/test/Game_1/Player.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends KinematicBody2D
|
||||
|
||||
var speed = 10
|
||||
var jump_force = 300
|
||||
var gravity = 700
|
||||
var vel = Vector2()
|
||||
|
||||
onready var image_player = get_node("Player")
|
||||
|
||||
func _physics_process(delta):
|
||||
if Input.is_action_pressed("player_left"):
|
||||
vel.x -= speed
|
||||
elif Input.is_action_pressed("player_right"):
|
||||
vel.x += speed
|
||||
|
||||
vel.y += gravity * delta
|
||||
|
||||
if Input.is_action_pressed("player_jump") and is_on_floor():
|
||||
vel.y -= jump_force
|
||||
|
||||
vel = move_and_slide(vel, Vector2.UP)
|
||||
|
||||
# if vel.x < 0:
|
||||
# image_player.flip_h = true
|
||||
# elif vel.x > 0:
|
||||
# image_player.flip_h = false
|
||||
|
||||
|
||||
29
kristofers/test/Game_1/Player.tscn
Normal file
29
kristofers/test/Game_1/Player.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/jedi.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Player.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 84.8674, 259.173 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 18.8674, 110.053 )
|
||||
|
||||
[node name="Player" type="KinematicBody2D"]
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="jedi" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -14.2705, -4.75684 )
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 53.5143, -48.1629 )
|
||||
rotation = 0.253073
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
shape = SubResource( 2 )
|
||||
34
kristofers/test/Game_1/Sprites/floor.png.import
Normal file
34
kristofers/test/Game_1/Sprites/floor.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/floor.png-bad02a3061f4734a68e01c2ddec9b22e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/floor.png"
|
||||
dest_files=[ "res://.import/floor.png-bad02a3061f4734a68e01c2ddec9b22e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
BIN
kristofers/test/Game_1/Sprites/jedi.png
Normal file
BIN
kristofers/test/Game_1/Sprites/jedi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
34
kristofers/test/Game_1/Sprites/jedi.png.import
Normal file
34
kristofers/test/Game_1/Sprites/jedi.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/jedi.png-f9be092cc27114ea04f99ed2335d3100.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/jedi.png"
|
||||
dest_files=[ "res://.import/jedi.png-f9be092cc27114ea04f99ed2335d3100.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
BIN
kristofers/test/Game_1/Sprites/lava.png
Normal file
BIN
kristofers/test/Game_1/Sprites/lava.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
34
kristofers/test/Game_1/Sprites/lava.png.import
Normal file
34
kristofers/test/Game_1/Sprites/lava.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/lava.png-68ab43619d46c5f3cf0fd86b7248d922.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/lava.png"
|
||||
dest_files=[ "res://.import/lava.png-68ab43619d46c5f3cf0fd86b7248d922.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
7
kristofers/test/Game_1/default_env.tres
Normal file
7
kristofers/test/Game_1/default_env.tres
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
24
kristofers/test/Game_1/export_presets.cfg
Normal file
24
kristofers/test/Game_1/export_presets.cfg
Normal file
@@ -0,0 +1,24 @@
|
||||
[preset.0]
|
||||
|
||||
name="Test Game Linux"
|
||||
platform="Linux/X11"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="./Game #1.x86_64"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
binary_format/64_bits=true
|
||||
binary_format/embed_pck=false
|
||||
texture_format/bptc=false
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
texture_format/no_bptc_fallbacks=true
|
||||
BIN
kristofers/test/Game_1/icon.png
Normal file
BIN
kristofers/test/Game_1/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
34
kristofers/test/Game_1/icon.png.import
Normal file
34
kristofers/test/Game_1/icon.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
54
kristofers/test/Game_1/project.godot
Normal file
54
kristofers/test/Game_1/project.godot
Normal file
@@ -0,0 +1,54 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Game_1"
|
||||
run/main_scene="res://Main.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=1920
|
||||
window/size/height=1080
|
||||
window/size/test_width=1024
|
||||
window/size/test_height=600
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
player_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
BIN
kristofers/test/Game_2/.DS_Store
vendored
Normal file
BIN
kristofers/test/Game_2/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="4cad95fdec75c9ca4ccb4dffd3618e3d"
|
||||
dest_md5="feb11866be70b87189c6fc2a990d302c"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="b4673334fcd364983e9f90d7958d9605"
|
||||
dest_md5="15a694f81cb6bd90fe34ec1e5fe917b6"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="7e41bf3051b18e392a4bb6c0cc45cd7c"
|
||||
dest_md5="92eb858faaa1840609e0a1d10f0a2ab1"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="d041073fd312eaece94ece7a2e6a8821"
|
||||
dest_md5="427e434562f75e13eb6b4cedf1822e6f"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="2455caa5d2ead6b686a3fec6e96ef413"
|
||||
dest_md5="541bc05b7e2edec0658f8c79fad564b7"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="2455caa5d2ead6b686a3fec6e96ef413"
|
||||
dest_md5="541bc05b7e2edec0658f8c79fad564b7"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="28d8736ab3510f40a01d43dd5c4ac28c"
|
||||
dest_md5="e07675e876c6c7d612f82727e1a0cd13"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="a58c7825dac59bc84dcead975892ba63"
|
||||
dest_md5="bafa63f8cd6b53e4adc8f1cc657cbf5e"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="fe87c435b38e851a185eeffd71e605ee"
|
||||
dest_md5="afcf87f339aac44d0baf2b31708b41a4"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="ce58c02e3e6951afe8af32fb801bb071"
|
||||
dest_md5="b1ba8cf3a66d7a9475455d86216b1491"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="5f1a7c7aa82dcbcbe369644006676178"
|
||||
dest_md5="5853c7687fd1dcb80054b98074bceb87"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="2455caa5d2ead6b686a3fec6e96ef413"
|
||||
dest_md5="541bc05b7e2edec0658f8c79fad564b7"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="9686a3d25d42c05c127df13e8b508f7f"
|
||||
dest_md5="5200aeab0e4bf3f100914fe37b563b26"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="a6af615bb38b6c2fee78ab04fa233325"
|
||||
dest_md5="050434b036c3e897eb9b2a33ff1db8b8"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="19fe22a26dade2930fccd650c0d16ef8"
|
||||
dest_md5="08cef941eb5c82c7161f3d52e216e5f7"
|
||||
|
||||
Binary file not shown.
186
kristofers/test/Game_2/HTML/Game #2 3D.audio.worklet.js
Normal file
186
kristofers/test/Game_2/HTML/Game #2 3D.audio.worklet.js
Normal file
@@ -0,0 +1,186 @@
|
||||
/*************************************************************************/
|
||||
/* audio.worklet.js */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
class RingBuffer {
|
||||
constructor(p_buffer, p_state) {
|
||||
this.buffer = p_buffer;
|
||||
this.avail = p_state;
|
||||
this.rpos = 0;
|
||||
this.wpos = 0;
|
||||
}
|
||||
|
||||
data_left() {
|
||||
return Atomics.load(this.avail, 0);
|
||||
}
|
||||
|
||||
space_left() {
|
||||
return this.buffer.length - this.data_left();
|
||||
}
|
||||
|
||||
read(output) {
|
||||
const size = this.buffer.length;
|
||||
let from = 0;
|
||||
let to_write = output.length;
|
||||
if (this.rpos + to_write > size) {
|
||||
const high = size - this.rpos;
|
||||
output.set(this.buffer.subarray(this.rpos, size));
|
||||
from = high;
|
||||
to_write -= high;
|
||||
this.rpos = 0;
|
||||
}
|
||||
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
||||
this.rpos += to_write;
|
||||
Atomics.add(this.avail, 0, -output.length);
|
||||
Atomics.notify(this.avail, 0);
|
||||
}
|
||||
|
||||
write(p_buffer) {
|
||||
const to_write = p_buffer.length;
|
||||
const mw = this.buffer.length - this.wpos;
|
||||
if (mw >= to_write) {
|
||||
this.buffer.set(p_buffer, this.wpos);
|
||||
} else {
|
||||
const high = p_buffer.subarray(0, to_write - mw);
|
||||
const low = p_buffer.subarray(to_write - mw);
|
||||
this.buffer.set(high, this.wpos);
|
||||
this.buffer.set(low);
|
||||
}
|
||||
let diff = to_write;
|
||||
if (this.wpos + diff >= this.buffer.length) {
|
||||
diff -= this.buffer.length;
|
||||
}
|
||||
this.wpos += diff;
|
||||
Atomics.add(this.avail, 0, to_write);
|
||||
Atomics.notify(this.avail, 0);
|
||||
}
|
||||
}
|
||||
|
||||
class GodotProcessor extends AudioWorkletProcessor {
|
||||
constructor() {
|
||||
super();
|
||||
this.running = true;
|
||||
this.lock = null;
|
||||
this.notifier = null;
|
||||
this.output = null;
|
||||
this.output_buffer = new Float32Array();
|
||||
this.input = null;
|
||||
this.input_buffer = new Float32Array();
|
||||
this.port.onmessage = (event) => {
|
||||
const cmd = event.data['cmd'];
|
||||
const data = event.data['data'];
|
||||
this.parse_message(cmd, data);
|
||||
};
|
||||
}
|
||||
|
||||
process_notify() {
|
||||
Atomics.add(this.notifier, 0, 1);
|
||||
Atomics.notify(this.notifier, 0);
|
||||
}
|
||||
|
||||
parse_message(p_cmd, p_data) {
|
||||
if (p_cmd === 'start' && p_data) {
|
||||
const state = p_data[0];
|
||||
let idx = 0;
|
||||
this.lock = state.subarray(idx, ++idx);
|
||||
this.notifier = state.subarray(idx, ++idx);
|
||||
const avail_in = state.subarray(idx, ++idx);
|
||||
const avail_out = state.subarray(idx, ++idx);
|
||||
this.input = new RingBuffer(p_data[1], avail_in);
|
||||
this.output = new RingBuffer(p_data[2], avail_out);
|
||||
} else if (p_cmd === 'stop') {
|
||||
this.runing = false;
|
||||
this.output = null;
|
||||
this.input = null;
|
||||
}
|
||||
}
|
||||
|
||||
static array_has_data(arr) {
|
||||
return arr.length && arr[0].length && arr[0][0].length;
|
||||
}
|
||||
|
||||
process(inputs, outputs, parameters) {
|
||||
if (!this.running) {
|
||||
return false; // Stop processing.
|
||||
}
|
||||
if (this.output === null) {
|
||||
return true; // Not ready yet, keep processing.
|
||||
}
|
||||
const process_input = GodotProcessor.array_has_data(inputs);
|
||||
if (process_input) {
|
||||
const input = inputs[0];
|
||||
const chunk = input[0].length * input.length;
|
||||
if (this.input_buffer.length !== chunk) {
|
||||
this.input_buffer = new Float32Array(chunk);
|
||||
}
|
||||
if (this.input.space_left() >= chunk) {
|
||||
GodotProcessor.write_input(this.input_buffer, input);
|
||||
this.input.write(this.input_buffer);
|
||||
} else {
|
||||
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
||||
}
|
||||
}
|
||||
const process_output = GodotProcessor.array_has_data(outputs);
|
||||
if (process_output) {
|
||||
const output = outputs[0];
|
||||
const chunk = output[0].length * output.length;
|
||||
if (this.output_buffer.length !== chunk) {
|
||||
this.output_buffer = new Float32Array(chunk);
|
||||
}
|
||||
if (this.output.data_left() >= chunk) {
|
||||
this.output.read(this.output_buffer);
|
||||
GodotProcessor.write_output(output, this.output_buffer);
|
||||
} else {
|
||||
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
||||
}
|
||||
}
|
||||
this.process_notify();
|
||||
return true;
|
||||
}
|
||||
|
||||
static write_output(dest, source) {
|
||||
const channels = dest.length;
|
||||
for (let ch = 0; ch < channels; ch++) {
|
||||
for (let sample = 0; sample < dest[ch].length; sample++) {
|
||||
dest[ch][sample] = source[sample * channels + ch];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static write_input(dest, source) {
|
||||
const channels = source.length;
|
||||
for (let ch = 0; ch < channels; ch++) {
|
||||
for (let sample = 0; sample < source[ch].length; sample++) {
|
||||
dest[sample * channels + ch] = source[ch][sample];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerProcessor('godot-processor', GodotProcessor);
|
||||
246
kristofers/test/Game_2/HTML/Game #2 3D.html
Normal file
246
kristofers/test/Game_2/HTML/Game #2 3D.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
||||
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
|
||||
<title>Game Project</title>
|
||||
<style type='text/css'>
|
||||
|
||||
body {
|
||||
touch-action: none;
|
||||
margin: 0;
|
||||
border: 0 none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
display: block;
|
||||
margin: 0;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#canvas:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.godot {
|
||||
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
||||
color: #e0e0e0;
|
||||
background-color: #3b3943;
|
||||
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
||||
border: 1px solid #45434e;
|
||||
box-shadow: 0 0 1px 1px #2f2d35;
|
||||
}
|
||||
|
||||
|
||||
/* Status display
|
||||
* ============== */
|
||||
|
||||
#status {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* don't consume click events - make children visible explicitly */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#status-progress {
|
||||
width: 366px;
|
||||
height: 7px;
|
||||
background-color: #38363A;
|
||||
border: 1px solid #444246;
|
||||
padding: 1px;
|
||||
box-shadow: 0 0 2px 1px #1B1C22;
|
||||
border-radius: 2px;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
@media only screen and (orientation:portrait) {
|
||||
#status-progress {
|
||||
width: 61.8%;
|
||||
}
|
||||
}
|
||||
|
||||
#status-progress-inner {
|
||||
height: 100%;
|
||||
width: 0;
|
||||
box-sizing: border-box;
|
||||
transition: width 0.5s linear;
|
||||
background-color: #202020;
|
||||
border: 1px solid #222223;
|
||||
box-shadow: 0 0 1px 1px #27282E;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#status-indeterminate {
|
||||
visibility: visible;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#status-indeterminate > div {
|
||||
width: 4.5px;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 9px 3px 0 3px;
|
||||
border-color: #2b2b2b transparent transparent transparent;
|
||||
transform-origin: center 21px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
||||
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
||||
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
||||
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
||||
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
||||
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
||||
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
||||
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
||||
|
||||
#status-notice {
|
||||
margin: 0 100px;
|
||||
line-height: 1.3;
|
||||
visibility: visible;
|
||||
padding: 4px 6px;
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<canvas id='canvas'>
|
||||
HTML5 canvas appears to be unsupported in the current browser.<br />
|
||||
Please try updating or use a different browser.
|
||||
</canvas>
|
||||
<div id='status'>
|
||||
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
||||
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div id='status-notice' class='godot' style='display: none;'></div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript' src='Game #2 3D.js'></script>
|
||||
<script type='text/javascript'>//<![CDATA[
|
||||
|
||||
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"Game #2 3D","experimentalVK":false,"fileSizes":{"Game #2 3D.pck":106707920,"Game #2 3D.wasm":12665632},"gdnativeLibs":[]};
|
||||
var engine = new Engine(GODOT_CONFIG);
|
||||
|
||||
(function() {
|
||||
const INDETERMINATE_STATUS_STEP_MS = 100;
|
||||
var statusProgress = document.getElementById('status-progress');
|
||||
var statusProgressInner = document.getElementById('status-progress-inner');
|
||||
var statusIndeterminate = document.getElementById('status-indeterminate');
|
||||
var statusNotice = document.getElementById('status-notice');
|
||||
|
||||
var initializing = true;
|
||||
var statusMode = 'hidden';
|
||||
|
||||
var animationCallbacks = [];
|
||||
function animate(time) {
|
||||
animationCallbacks.forEach(callback => callback(time));
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
function setStatusMode(mode) {
|
||||
|
||||
if (statusMode === mode || !initializing)
|
||||
return;
|
||||
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
||||
elem.style.display = 'none';
|
||||
});
|
||||
animationCallbacks = animationCallbacks.filter(function(value) {
|
||||
return (value != animateStatusIndeterminate);
|
||||
});
|
||||
switch (mode) {
|
||||
case 'progress':
|
||||
statusProgress.style.display = 'block';
|
||||
break;
|
||||
case 'indeterminate':
|
||||
statusIndeterminate.style.display = 'block';
|
||||
animationCallbacks.push(animateStatusIndeterminate);
|
||||
break;
|
||||
case 'notice':
|
||||
statusNotice.style.display = 'block';
|
||||
break;
|
||||
case 'hidden':
|
||||
break;
|
||||
default:
|
||||
throw new Error('Invalid status mode');
|
||||
}
|
||||
statusMode = mode;
|
||||
}
|
||||
|
||||
function animateStatusIndeterminate(ms) {
|
||||
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
||||
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
||||
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
||||
child.style.borderTopColor = '';
|
||||
});
|
||||
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
||||
}
|
||||
}
|
||||
|
||||
function setStatusNotice(text) {
|
||||
while (statusNotice.lastChild) {
|
||||
statusNotice.removeChild(statusNotice.lastChild);
|
||||
}
|
||||
var lines = text.split('\n');
|
||||
lines.forEach((line) => {
|
||||
statusNotice.appendChild(document.createTextNode(line));
|
||||
statusNotice.appendChild(document.createElement('br'));
|
||||
});
|
||||
};
|
||||
|
||||
function displayFailureNotice(err) {
|
||||
var msg = err.message || err;
|
||||
console.error(msg);
|
||||
setStatusNotice(msg);
|
||||
setStatusMode('notice');
|
||||
initializing = false;
|
||||
};
|
||||
|
||||
if (!Engine.isWebGLAvailable()) {
|
||||
displayFailureNotice('WebGL not available');
|
||||
} else {
|
||||
setStatusMode('indeterminate');
|
||||
engine.startGame({
|
||||
'onProgress': function (current, total) {
|
||||
if (total > 0) {
|
||||
statusProgressInner.style.width = current/total * 100 + '%';
|
||||
setStatusMode('progress');
|
||||
if (current === total) {
|
||||
// wait for progress bar animation
|
||||
setTimeout(() => {
|
||||
setStatusMode('indeterminate');
|
||||
}, 500);
|
||||
}
|
||||
} else {
|
||||
setStatusMode('indeterminate');
|
||||
}
|
||||
},
|
||||
}).then(() => {
|
||||
setStatusMode('hidden');
|
||||
initializing = false;
|
||||
}, displayFailureNotice);
|
||||
}
|
||||
})();
|
||||
//]]></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
772
kristofers/test/Game_2/HTML/Game #2 3D.js
Normal file
772
kristofers/test/Game_2/HTML/Game #2 3D.js
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user