mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2026-03-22 00:26:23 +00:00
game#4 commit
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
|
||||
|
||||
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1,34 +0,0 @@
|
||||
[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
|
||||
@@ -1,83 +0,0 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://roboto2.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://main_menu.gd" type="Script" id=3]
|
||||
|
||||
[node name="network_setup" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="multiplayer_configure" type="Control" parent="."]
|
||||
margin_left = 982.0
|
||||
margin_top = 486.0
|
||||
margin_right = 1022.0
|
||||
margin_bottom = 526.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="host_button" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -170.0
|
||||
margin_top = -42.0
|
||||
margin_right = 130.0
|
||||
margin_bottom = 37.9999
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Host game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="join_button" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -170.0
|
||||
margin_top = 70.0
|
||||
margin_right = 130.0
|
||||
margin_bottom = 150.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Join game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="server_ip_address" type="LineEdit" parent="multiplayer_configure"]
|
||||
anchor_left = -24.55
|
||||
anchor_top = -12.15
|
||||
anchor_right = 23.45
|
||||
anchor_bottom = 14.85
|
||||
margin_left = 776.0
|
||||
margin_top = 728.0
|
||||
margin_right = -744.0
|
||||
margin_bottom = -302.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
align = 1
|
||||
placeholder_text = "Enter IP address"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="CanvasLayer"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -150.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="multiplayer_configure/host_button" to="." method="_on_host_button_pressed"]
|
||||
[connection signal="pressed" from="multiplayer_configure/join_button" to="." method="_on_join_button_pressed"]
|
||||
@@ -1,76 +0,0 @@
|
||||
; 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 #3.5"
|
||||
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=1024
|
||||
window/size/test_height=600
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
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)
|
||||
]
|
||||
}
|
||||
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)
|
||||
]
|
||||
}
|
||||
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_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_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)
|
||||
]
|
||||
}
|
||||
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)
|
||||
]
|
||||
}
|
||||
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)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
@@ -1,3 +0,0 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="Players" type="Node2D"]
|
||||
@@ -1,15 +0,0 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://game.gd" type="Script" id=1]
|
||||
[ext_resource path="res://floor.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="game" type="Node2D"]
|
||||
position = Vector2( -16, 0 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="floor" parent="." instance=ExtResource( 4 )]
|
||||
position = Vector2( 958.693, 1053.79 )
|
||||
scale = Vector2( 2, 1 )
|
||||
|
||||
[node name="PostitionPlayer_1" type="Position2D" parent="."]
|
||||
position = Vector2( 953.341, 910.982 )
|
||||
@@ -1,91 +0,0 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Roboto-Regular.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://font/roboto.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://code/main_menu.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 32
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="network_setup" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 1.33496
|
||||
margin_right = 1.33496
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="multiplayer_configure" type="Control" parent="."]
|
||||
margin_left = 982.0
|
||||
margin_top = 486.0
|
||||
margin_right = 1022.0
|
||||
margin_bottom = 526.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="host_button" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -194.027
|
||||
margin_top = -27.3168
|
||||
margin_right = 105.973
|
||||
margin_bottom = 52.6831
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Host game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="join_button" type="Button" parent="multiplayer_configure"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -178.009
|
||||
margin_top = 73.7132
|
||||
margin_right = 121.991
|
||||
margin_bottom = 153.713
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Join game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="server_ip_address" type="LineEdit" parent="multiplayer_configure"]
|
||||
anchor_left = -24.55
|
||||
anchor_top = -12.15
|
||||
anchor_right = 23.45
|
||||
anchor_bottom = 14.85
|
||||
margin_left = 776.0
|
||||
margin_top = 728.0
|
||||
margin_right = -744.0
|
||||
margin_bottom = -302.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
align = 1
|
||||
placeholder_text = "Enter IP address"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="CanvasLayer"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -150.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="multiplayer_configure/host_button" to="." method="_on_host_button_pressed"]
|
||||
[connection signal="pressed" from="multiplayer_configure/join_button" to="." method="_on_join_button_pressed"]
|
||||
@@ -1,23 +0,0 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/sphere.png" type="Texture" id=1]
|
||||
[ext_resource path="res://player.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id=1]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=2]
|
||||
radius = 22.8565
|
||||
|
||||
[node name="player" type="KinematicBody2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="sphere" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
modulate = Color( 1, 0, 0, 1 )
|
||||
self_modulate = Color( 1, 0, 0, 1 )
|
||||
light_mask = 0
|
||||
material = SubResource( 1 )
|
||||
shape = SubResource( 2 )
|
||||
@@ -11,6 +11,8 @@ var ip_address = ""
|
||||
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]
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
extends Control
|
||||
|
||||
var player = load("res://scenes/player.tscn")
|
||||
|
||||
onready var multiplayer_config_ui = $multiplayer_configure
|
||||
onready var server_ip_address = $multiplayer_configure/server_ip_address
|
||||
onready var device_ip_address = $CanvasLayer/device_ip_address
|
||||
|
||||
var player = load("res://scenes/player.tscn")
|
||||
|
||||
func _ready():
|
||||
get_tree().connect("network_peer_connected", self, "_player_connected")
|
||||
@@ -24,15 +25,15 @@ func _player_disconnected(id) -> void:
|
||||
Players.get_node(str(id)).queue_free()
|
||||
|
||||
|
||||
func _on_host_button_pressed():
|
||||
func _on_create_server_pressed():
|
||||
multiplayer_config_ui.hide()
|
||||
Network.create_server()
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func _on_join_button_pressed():
|
||||
func _on_join_server_pressed():
|
||||
if server_ip_address.text != "":
|
||||
hide()
|
||||
multiplayer_config_ui.hide()
|
||||
Network.ip_address = server_ip_address.text
|
||||
Network.join_server()
|
||||
|
||||
@@ -9,12 +9,9 @@ var velocity = Vector2()
|
||||
var fly = false
|
||||
|
||||
puppet var puppet_position = Vector2(0, 0) setget puppet_position_set
|
||||
|
||||
onready var tween = get_node("player")
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
puppet var puppet_velocity = Vector2()
|
||||
puppet var puppet_rotaion = 0
|
||||
onready var tween = $Tween
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
@@ -22,17 +19,6 @@ func _physics_process(delta):
|
||||
mode_switch(delta)
|
||||
screen_wrap()
|
||||
|
||||
func puppet_position_set(new_value) -> void:
|
||||
puppet_position = new_value
|
||||
|
||||
tween.inturpolate_polarity(self, "global_position", global_position, puppet_position, 0.1)
|
||||
tween.start()
|
||||
|
||||
|
||||
func _on_network_tick_rate_timeout():
|
||||
if is_network_master():
|
||||
rset_unreliable("puppet_position", global_position)
|
||||
|
||||
|
||||
func mode_switch(delta):
|
||||
if Input.is_action_just_pressed("mode_switch") and fly == false:
|
||||
@@ -67,7 +53,7 @@ func movement(delta):
|
||||
|
||||
|
||||
func flying():
|
||||
speed = 500
|
||||
speed = 1000
|
||||
var velocity = Vector2()
|
||||
if Input.is_action_pressed("move_right"):
|
||||
velocity.x += 1
|
||||
@@ -80,12 +66,23 @@ func flying():
|
||||
velocity = velocity.normalized() * speed
|
||||
|
||||
velocity = move_and_slide(velocity)
|
||||
print(velocity)
|
||||
|
||||
|
||||
func screen_wrap():
|
||||
if position.x <= 0:
|
||||
if position.x <= -10:
|
||||
position.x = get_viewport_rect().size.x
|
||||
if 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.inturpolate_polarity(self, "global_position", global_position, puppet_position, 0.1)
|
||||
tween.start()
|
||||
|
||||
|
||||
func _on_network_tick_rate_timeout():
|
||||
if is_network_master():
|
||||
rset_unreliable("puppet_position", global_position)
|
||||
rset_unreliable("puppet_velocity", velocity)
|
||||
@@ -1,5 +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
Game #4/export_presets.cfg
Normal file
24
Game #4/export_presets.cfg
Normal file
@@ -0,0 +1,24 @@
|
||||
[preset.0]
|
||||
|
||||
name="Linux/X11"
|
||||
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
|
||||
@@ -3,7 +3,7 @@
|
||||
[ext_resource path="res://font/Roboto-Regular.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 32
|
||||
size = 64
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
@@ -11,17 +11,82 @@ 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=1024
|
||||
window/size/test_height=600
|
||||
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
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/floor.png" type="Texture" id=1]
|
||||
[ext_resource path="res://sprites/floor.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 960.259, 24.9333 )
|
||||
extents = Vector2( 960, 24 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D"]
|
||||
[node name="floor" type="StaticBody2D"]
|
||||
|
||||
[node name="floor" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
82
Game #4/scenes/main_menu.tscn
Normal file
82
Game #4/scenes/main_menu.tscn
Normal file
@@ -0,0 +1,82 @@
|
||||
[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://scenes/floor.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="network_setup" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[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="server_ip_address" 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 IP address"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="CanvasLayer"]
|
||||
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
|
||||
}
|
||||
|
||||
[node name="floor" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 960, 1056 )
|
||||
scale = Vector2( 2, 1 )
|
||||
|
||||
[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"]
|
||||
24
Game #4/scenes/player.tscn
Normal file
24
Game #4/scenes/player.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://sprites/sphere.png" type="Texture" id=1]
|
||||
[ext_resource path="res://code/player.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 45.7813
|
||||
|
||||
[node name="player" type="KinematicBody2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="sphere" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
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
Game #4/scenes/players.tscn
Normal file
3
Game #4/scenes/players.tscn
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="players" type="Node"]
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -2,15 +2,15 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/floor.png-bad02a3061f4734a68e01c2ddec9b22e.stex"
|
||||
path="res://.import/floor.png-8870646e23ec8c3ad77089faabc9e773.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/floor.png"
|
||||
dest_files=[ "res://.import/floor.png-bad02a3061f4734a68e01c2ddec9b22e.stex" ]
|
||||
source_file="res://sprites/floor.png"
|
||||
dest_files=[ "res://.import/floor.png-8870646e23ec8c3ad77089faabc9e773.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -2,15 +2,15 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/sphere.png-b7490a5e3cfc87a7a150d30e23b12756.stex"
|
||||
path="res://.import/sphere.png-b735a7d58a47546099ef1144a282cd43.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/sphere.png"
|
||||
dest_files=[ "res://.import/sphere.png-b7490a5e3cfc87a7a150d30e23b12756.stex" ]
|
||||
source_file="res://sprites/sphere.png"
|
||||
dest_files=[ "res://.import/sphere.png-b735a7d58a47546099ef1144a282cd43.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
Reference in New Issue
Block a user