This is the real initial commit with all the code I have until now. Networking: A server and 2 clients connect and then control their players. This is still buggy. For example, every client controls the /same/ player. FPS controls: WSAD, Jump, and Look with mouse are all implemented (Taken from Caliou's demo). This includes collisions.master
| @ -0,0 +1,101 @@ | |||||
| [gd_resource type="Environment" load_steps=2 format=2] | |||||
| [sub_resource type="ProceduralSky" id=1] | |||||
| radiance_size = 4 | |||||
| sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) | |||||
| sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) | |||||
| sky_curve = 0.25 | |||||
| sky_energy = 1.0 | |||||
| ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) | |||||
| ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) | |||||
| ground_curve = 0.01 | |||||
| ground_energy = 1.0 | |||||
| sun_color = Color( 1, 1, 1, 1 ) | |||||
| sun_latitude = 35.0 | |||||
| sun_longitude = 0.0 | |||||
| sun_angle_min = 1.0 | |||||
| sun_angle_max = 100.0 | |||||
| sun_curve = 0.05 | |||||
| sun_energy = 16.0 | |||||
| texture_size = 2 | |||||
| [resource] | |||||
| background_mode = 2 | |||||
| background_sky = SubResource( 1 ) | |||||
| background_sky_custom_fov = 0.0 | |||||
| background_color = Color( 0, 0, 0, 1 ) | |||||
| background_energy = 1.0 | |||||
| background_canvas_max_layer = 0 | |||||
| ambient_light_color = Color( 0, 0, 0, 1 ) | |||||
| ambient_light_energy = 1.0 | |||||
| ambient_light_sky_contribution = 1.0 | |||||
| fog_enabled = false | |||||
| fog_color = Color( 0.5, 0.6, 0.7, 1 ) | |||||
| fog_sun_color = Color( 1, 0.9, 0.7, 1 ) | |||||
| fog_sun_amount = 0.0 | |||||
| fog_depth_enabled = true | |||||
| fog_depth_begin = 10.0 | |||||
| fog_depth_curve = 1.0 | |||||
| fog_transmit_enabled = false | |||||
| fog_transmit_curve = 1.0 | |||||
| fog_height_enabled = false | |||||
| fog_height_min = 0.0 | |||||
| fog_height_max = 100.0 | |||||
| fog_height_curve = 1.0 | |||||
| tonemap_mode = 0 | |||||
| tonemap_exposure = 1.0 | |||||
| tonemap_white = 1.0 | |||||
| auto_exposure_enabled = false | |||||
| auto_exposure_scale = 0.4 | |||||
| auto_exposure_min_luma = 0.05 | |||||
| auto_exposure_max_luma = 8.0 | |||||
| auto_exposure_speed = 0.5 | |||||
| ss_reflections_enabled = false | |||||
| ss_reflections_max_steps = 64 | |||||
| ss_reflections_fade_in = 0.15 | |||||
| ss_reflections_fade_out = 2.0 | |||||
| ss_reflections_depth_tolerance = 0.2 | |||||
| ss_reflections_roughness = true | |||||
| ssao_enabled = false | |||||
| ssao_radius = 1.0 | |||||
| ssao_intensity = 1.0 | |||||
| ssao_radius2 = 0.0 | |||||
| ssao_intensity2 = 1.0 | |||||
| ssao_bias = 0.01 | |||||
| ssao_light_affect = 0.0 | |||||
| ssao_color = Color( 0, 0, 0, 1 ) | |||||
| ssao_quality = 0 | |||||
| ssao_blur = 3 | |||||
| ssao_edge_sharpness = 4.0 | |||||
| dof_blur_far_enabled = false | |||||
| dof_blur_far_distance = 10.0 | |||||
| dof_blur_far_transition = 5.0 | |||||
| dof_blur_far_amount = 0.1 | |||||
| dof_blur_far_quality = 1 | |||||
| dof_blur_near_enabled = false | |||||
| dof_blur_near_distance = 2.0 | |||||
| dof_blur_near_transition = 1.0 | |||||
| dof_blur_near_amount = 0.1 | |||||
| dof_blur_near_quality = 1 | |||||
| glow_enabled = false | |||||
| glow_levels/1 = false | |||||
| glow_levels/2 = false | |||||
| glow_levels/3 = true | |||||
| glow_levels/4 = false | |||||
| glow_levels/5 = true | |||||
| glow_levels/6 = false | |||||
| glow_levels/7 = false | |||||
| glow_intensity = 0.8 | |||||
| glow_strength = 1.0 | |||||
| glow_bloom = 0.0 | |||||
| glow_blend_mode = 2 | |||||
| glow_hdr_threshold = 1.0 | |||||
| glow_hdr_scale = 2.0 | |||||
| glow_bicubic_upscale = false | |||||
| adjustment_enabled = false | |||||
| adjustment_brightness = 1.0 | |||||
| adjustment_contrast = 1.0 | |||||
| adjustment_saturation = 1.0 | |||||
| @ -0,0 +1,28 @@ | |||||
| [remap] | |||||
| importer="texture" | |||||
| type="StreamTexture" | |||||
| path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" | |||||
| [deps] | |||||
| source_md5="ae7e641067601e2184afcade49abd283" | |||||
| [params] | |||||
| compress/mode=0 | |||||
| compress/lossy_quality=0.7 | |||||
| compress/hdr_mode=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 | |||||
| stream=false | |||||
| size_limit=0 | |||||
| detect_3d=true | |||||
| svg/scale=1.0 | |||||
| @ -0,0 +1,89 @@ | |||||
| extends Control | |||||
| # class member variables go here, for example: | |||||
| # var a = 2 | |||||
| # var b = "textvar" | |||||
| var SERVER_IP = "127.0.0.1" | |||||
| var SERVER_PORT = 2467 | |||||
| var MAX_PLAYERS = 2 | |||||
| var player_info = {} | |||||
| var my_info = {} | |||||
| func _ready(): | |||||
| # Called every time the node is added to the scene. | |||||
| # Initialization here | |||||
| get_node("Server").connect("pressed", self, "_server_init") | |||||
| get_node("Client").connect("pressed", self, "_client_init") | |||||
| get_node("Singleplayer").connect("pressed", self, "_singleplayer_init") | |||||
| get_tree().connect("network_peer_connected", self, "_player_connected") | |||||
| get_tree().connect("connected_to_server", self, "_connected_ok") | |||||
| func _client_init(): | |||||
| my_info.username = get_node("Username").get_text() | |||||
| var peer = NetworkedMultiplayerENet.new() | |||||
| peer.create_client(SERVER_IP, SERVER_PORT) | |||||
| get_tree().set_network_peer(peer) | |||||
| get_node("Client").set_text("Clienting!") | |||||
| func _singleplayer_init(): | |||||
| my_info.username = get_node("Username").get_text() | |||||
| var peer = NetworkedMultiplayerENet.new() | |||||
| peer.create_server(SERVER_PORT, 1) | |||||
| get_tree().set_network_peer(peer) | |||||
| pre_configure_game() | |||||
| func _server_init(): | |||||
| var peer = NetworkedMultiplayerENet.new() | |||||
| peer.create_server(SERVER_PORT, MAX_PLAYERS) | |||||
| get_tree().set_network_peer(peer) | |||||
| get_node("Server").set_text("Serving!") | |||||
| func _player_connected(id): | |||||
| print("Connect, my friend: " + str(id)) | |||||
| func _connected_ok(): | |||||
| rpc("register_player", get_tree().get_network_unique_id(), my_info) | |||||
| remote func register_player(id, info): | |||||
| player_info[id] = info | |||||
| if (get_tree().is_network_server()): | |||||
| rpc_id(id, "register_player", 1, my_info) | |||||
| # Send current players' info to new player | |||||
| for peer_id in player_info: | |||||
| rpc_id(id, "register_player", peer_id, player_info[peer_id]) | |||||
| if (player_info.size() == MAX_PLAYERS): | |||||
| rpc("pre_configure_game") | |||||
| pre_configure_game() | |||||
| var players_done = [] | |||||
| remote func done_preconfiguring(who): | |||||
| players_done.append(who) | |||||
| if (players_done.size() == player_info.size()): | |||||
| rpc("post_configure_game") | |||||
| remote func pre_configure_game(): | |||||
| var self_peer_id = get_tree().get_network_unique_id() | |||||
| get_node("/root/Control").queue_free() | |||||
| var world = load("res://world.tscn").instance() | |||||
| get_node("/root").add_child(world) | |||||
| var my_player = preload("res://player.tscn").instance() | |||||
| my_player.set_name(str(self_peer_id)) | |||||
| my_player.set_network_master(self_peer_id) | |||||
| get_node("/root/world/players").add_child(my_player) | |||||
| # Load other players | |||||
| for p in player_info: | |||||
| var player = preload("res://player.tscn").instance() | |||||
| player.set_name(str(p)) | |||||
| get_node("/root/world/players").add_child(player) | |||||
| rpc_id(1, "done_preconfiguring", self_peer_id) | |||||
| #func _process(delta): | |||||
| # # Called every frame. Delta is time since last frame. | |||||
| # # Update game logic here. | |||||
| # pass | |||||
| @ -0,0 +1,124 @@ | |||||
| [gd_scene load_steps=2 format=2] | |||||
| [ext_resource path="res://lobby.gd" type="Script" id=1] | |||||
| [node name="Control" type="Control" index="0"] | |||||
| anchor_left = 0.0 | |||||
| anchor_top = 0.0 | |||||
| anchor_right = 0.0 | |||||
| anchor_bottom = 0.0 | |||||
| margin_right = 40.0 | |||||
| margin_bottom = 40.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| mouse_filter = 0 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 1 | |||||
| script = ExtResource( 1 ) | |||||
| [node name="Server" type="Button" parent="." index="0"] | |||||
| anchor_left = 0.0 | |||||
| anchor_top = 0.0 | |||||
| anchor_right = 0.0 | |||||
| anchor_bottom = 0.0 | |||||
| margin_top = 6.0 | |||||
| margin_right = 52.0 | |||||
| margin_bottom = 26.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| focus_mode = 2 | |||||
| mouse_filter = 0 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 1 | |||||
| toggle_mode = false | |||||
| enabled_focus_mode = 2 | |||||
| shortcut = null | |||||
| group = null | |||||
| text = "Server" | |||||
| flat = false | |||||
| align = 1 | |||||
| [node name="Client" type="Button" parent="." index="1"] | |||||
| anchor_left = 0.0 | |||||
| anchor_top = 0.0 | |||||
| anchor_right = 0.0 | |||||
| anchor_bottom = 0.0 | |||||
| margin_left = 1.0 | |||||
| margin_top = 44.0 | |||||
| margin_right = 50.0 | |||||
| margin_bottom = 64.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| focus_mode = 2 | |||||
| mouse_filter = 0 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 1 | |||||
| toggle_mode = false | |||||
| enabled_focus_mode = 2 | |||||
| shortcut = null | |||||
| group = null | |||||
| text = "Client" | |||||
| flat = false | |||||
| align = 1 | |||||
| [node name="Username" type="TextEdit" parent="." index="2"] | |||||
| anchor_left = 0.0 | |||||
| anchor_top = 0.0 | |||||
| anchor_right = 0.0 | |||||
| anchor_bottom = 0.0 | |||||
| margin_left = 3.0 | |||||
| margin_top = 88.0 | |||||
| margin_right = 182.0 | |||||
| margin_bottom = 108.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| focus_mode = 2 | |||||
| mouse_filter = 0 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 1 | |||||
| text = "" | |||||
| readonly = false | |||||
| highlight_current_line = false | |||||
| syntax_highlighting = false | |||||
| show_line_numbers = false | |||||
| highlight_all_occurrences = false | |||||
| override_selected_font_color = false | |||||
| context_menu_enabled = true | |||||
| smooth_scrolling = false | |||||
| v_scroll_speed = 80.0 | |||||
| hiding_enabled = 0 | |||||
| wrap_lines = false | |||||
| caret_block_mode = false | |||||
| caret_blink = false | |||||
| caret_blink_speed = 0.65 | |||||
| caret_moving_by_right_click = true | |||||
| [node name="Singleplayer" type="Button" parent="." index="3"] | |||||
| anchor_left = 0.0 | |||||
| anchor_top = 0.0 | |||||
| anchor_right = 0.0 | |||||
| anchor_bottom = 0.0 | |||||
| margin_left = 72.0 | |||||
| margin_top = 8.0 | |||||
| margin_right = 161.0 | |||||
| margin_bottom = 28.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| focus_mode = 2 | |||||
| mouse_filter = 0 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 1 | |||||
| toggle_mode = false | |||||
| enabled_focus_mode = 2 | |||||
| shortcut = null | |||||
| group = null | |||||
| text = "Singleplayer" | |||||
| flat = false | |||||
| align = 1 | |||||
| @ -0,0 +1,170 @@ | |||||
| # Copyright (c) 2015 Calinou | |||||
| # This source code form is governed by the MIT license. | |||||
| # Original: https://raw.githubusercontent.com/Calinou/fps-test/master/scripts/player.gd | |||||
| extends RigidBody | |||||
| var view_sensitivity = 0.25 | |||||
| var yaw = 0 | |||||
| var pitch = 0 | |||||
| var is_moving = false | |||||
| const max_accel = 0.005 | |||||
| const air_accel = 0.02 | |||||
| var timer = 0 | |||||
| # Walking speed and jumping height are defined later. | |||||
| var walk_speed | |||||
| var jump_speed | |||||
| var health = 100 | |||||
| var stamina = 10000 | |||||
| var ray_length = 10 | |||||
| slave var slave_transform = Basis() | |||||
| slave var slave_lin_v = Vector3() | |||||
| slave var slave_ang_v = Vector3() | |||||
| func _ready(): | |||||
| set_process_input(true) | |||||
| # Capture mouse once game is started: | |||||
| Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) | |||||
| #set_physics_process(true) | |||||
| get_node("Crosshair").set_text("+") | |||||
| if is_network_master(): | |||||
| get_node("Yaw/Camera").make_current() | |||||
| func _input(event): | |||||
| if is_network_master(): | |||||
| if event is InputEventMouseMotion: | |||||
| yaw = fmod(yaw - event.relative.x * view_sensitivity, 360) | |||||
| pitch = max(min(pitch - event.relative.y * view_sensitivity, 85), -85) | |||||
| get_node("Yaw").set_rotation(Vector3(0, deg2rad(yaw), 0)) | |||||
| get_node("Yaw/Camera").set_rotation(Vector3(deg2rad(pitch), 0, 0)) | |||||
| # Toggle mouse capture: | |||||
| if Input.is_action_pressed("toggle_mouse_capture"): | |||||
| if (Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED): | |||||
| Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) | |||||
| view_sensitivity = 0 | |||||
| else: | |||||
| Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) | |||||
| view_sensitivity = 0.25 | |||||
| # Quit the game: | |||||
| if Input.is_action_pressed("quit"): | |||||
| quit() | |||||
| func _physics_process(delta): | |||||
| #get_node("FPS").set_text(str(OS.get_frames_per_second(), " FPS")) | |||||
| #get_node("Stamina").set_value(stamina) | |||||
| is_moving = false | |||||
| func _integrate_forces(state): | |||||
| if is_network_master(): | |||||
| control_player(state) | |||||
| rset_unreliable("slave_transform", get_transform()) | |||||
| rset_unreliable("slave_lin_v", get_linear_velocity()) | |||||
| rset_unreliable("slave_ang_v", get_angular_velocity()) | |||||
| else: | |||||
| set_transform(slave_transform) | |||||
| set_linear_velocity(slave_lin_v) | |||||
| set_angular_velocity(slave_ang_v) | |||||
| func control_player(state): | |||||
| # Default walk speed: | |||||
| walk_speed = 5 | |||||
| # Default jump height: | |||||
| jump_speed = 3 | |||||
| var aim = get_node("Yaw").get_global_transform().basis | |||||
| var direction = Vector3() | |||||
| if Input.is_action_pressed("move_forwards"): | |||||
| direction -= aim[2] | |||||
| is_moving = true | |||||
| if Input.is_action_pressed("move_backwards"): | |||||
| direction += aim[2] | |||||
| is_moving = true | |||||
| if Input.is_action_pressed("move_left"): | |||||
| direction -= aim[0] | |||||
| is_moving = true | |||||
| if Input.is_action_pressed("move_right"): | |||||
| direction += aim[0] | |||||
| is_moving = true | |||||
| direction = direction.normalized() | |||||
| var ray = get_node("Ray") | |||||
| # Increase walk speed and jump height while running and decrement stamina: | |||||
| if Input.is_action_pressed("run") and is_moving and ray.is_colliding(): | |||||
| walk_speed *= 1.4 | |||||
| jump_speed *= 1.2 | |||||
| print("---") | |||||
| print(state.get_linear_velocity()) | |||||
| if ray.is_colliding(): | |||||
| var up = state.get_total_gravity().normalized() | |||||
| var normal = ray.get_collision_normal() | |||||
| var floor_velocity = Vector3() | |||||
| var object = ray.get_collider() | |||||
| if object is RigidBody or object is StaticBody: | |||||
| var point = ray.get_collision_point() - object.get_translation() | |||||
| var floor_angular_vel = Vector3() | |||||
| if object is RigidBody: | |||||
| floor_velocity = object.get_linear_velocity() | |||||
| floor_angular_vel = object.get_angular_velocity() | |||||
| elif object is StaticBody: | |||||
| floor_velocity = object.get_constant_linear_velocity() | |||||
| floor_angular_vel = object.get_constant_angular_velocity() | |||||
| # Surely there should be a function to convert Euler angles to a 3x3 matrix | |||||
| var tf = Basis(Vector3(1, 0, 0), floor_angular_vel.x) | |||||
| tf = tf.rotated(Vector3(0, 1, 0), floor_angular_vel.y) | |||||
| tf = tf.rotated(Vector3(0, 0, 1), floor_angular_vel.z) | |||||
| floor_velocity += tf.xform_inv(point) - point | |||||
| yaw = fmod(yaw + rad2deg(floor_angular_vel.y) * state.get_step(), 360) | |||||
| get_node("Yaw").set_rotation(Vector3(0, deg2rad(yaw), 0)) | |||||
| print("isRB||isSB") | |||||
| var diff = floor_velocity + direction * walk_speed - state.get_linear_velocity() | |||||
| var vertdiff = aim[1] * diff.dot(aim[1]) | |||||
| print("VD: " + str(vertdiff)) | |||||
| diff -= vertdiff | |||||
| diff = diff.normalized() * clamp(diff.length(), 0, max_accel / state.get_step()) | |||||
| diff += vertdiff | |||||
| print("D: " + str(diff)) | |||||
| apply_impulse(Vector3(), diff * get_mass()) | |||||
| if Input.is_action_pressed("jump"): | |||||
| apply_impulse(Vector3(), normal * jump_speed * get_mass()) | |||||
| else: | |||||
| apply_impulse(Vector3(), direction * air_accel * get_mass()) | |||||
| print(get_translation()) | |||||
| print(state.get_linear_velocity()) | |||||
| state.integrate_forces() | |||||
| func _exit_scene(): | |||||
| Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) | |||||
| # Functions | |||||
| # ========= | |||||
| # Quits the game: | |||||
| func quit(): | |||||
| get_tree().quit() | |||||
| @ -0,0 +1,12 @@ | |||||
| # Blender MTL File: 'player.blend' | |||||
| # Material Count: 1 | |||||
| newmtl Material | |||||
| Ns 96.078431 | |||||
| Ka 1.000000 1.000000 1.000000 | |||||
| Kd 0.640000 0.640000 0.640000 | |||||
| Ks 0.500000 0.500000 0.500000 | |||||
| Ke 0.000000 0.000000 0.000000 | |||||
| Ni 1.000000 | |||||
| d 1.000000 | |||||
| illum 2 | |||||
| @ -0,0 +1,15 @@ | |||||
| [remap] | |||||
| importer="wavefront_obj" | |||||
| type="Mesh" | |||||
| path="res://.import/player.obj-6e2f17c0007f45d03dba8b8cecc6f696.mesh" | |||||
| [deps] | |||||
| files=[ "res://.import/player.obj-6e2f17c0007f45d03dba8b8cecc6f696.mesh" ] | |||||
| source_md5="7074ae8221d3b083f4f95e70e1ee446f" | |||||
| [params] | |||||
| generate_tangents=true | |||||
| @ -0,0 +1,133 @@ | |||||
| [gd_scene load_steps=5 format=2] | |||||
| [ext_resource path="res://player.gd" type="Script" id=1] | |||||
| [sub_resource type="CapsuleShape" id=1] | |||||
| radius = 0.4 | |||||
| height = 0.5 | |||||
| [sub_resource type="RayShape" id=2] | |||||
| length = 0.3 | |||||
| _sections_unfolded = [ "Resource" ] | |||||
| [sub_resource type="CapsuleMesh" id=3] | |||||
| radius = 0.4 | |||||
| mid_height = 0.5 | |||||
| radial_segments = 64 | |||||
| rings = 8 | |||||
| _sections_unfolded = [ "Resource" ] | |||||
| [node name="RigidBody" type="RigidBody" index="0"] | |||||
| input_ray_pickable = true | |||||
| input_capture_on_drag = false | |||||
| collision_layer = 1 | |||||
| collision_mask = 1 | |||||
| mode = 2 | |||||
| mass = 1.0 | |||||
| friction = 0.0 | |||||
| bounce = 0.0 | |||||
| gravity_scale = 1.0 | |||||
| custom_integrator = true | |||||
| continuous_cd = true | |||||
| contacts_reported = 8 | |||||
| contact_monitor = true | |||||
| sleeping = false | |||||
| can_sleep = false | |||||
| axis_lock_linear_x = false | |||||
| axis_lock_linear_y = false | |||||
| axis_lock_linear_z = false | |||||
| axis_lock_angular_x = false | |||||
| axis_lock_angular_y = false | |||||
| axis_lock_angular_z = false | |||||
| linear_velocity = Vector3( 0, 0, 0 ) | |||||
| linear_damp = -1.0 | |||||
| angular_velocity = Vector3( 0, 0, 0 ) | |||||
| angular_damp = -1.0 | |||||
| script = ExtResource( 1 ) | |||||
| _sections_unfolded = [ "Angular", "Collision", "Linear", "Transform", "Visibility" ] | |||||
| [node name="Body" type="CollisionShape" parent="." index="0"] | |||||
| transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.95, 0 ) | |||||
| shape = SubResource( 1 ) | |||||
| disabled = false | |||||
| _sections_unfolded = [ "Pause", "Transform", "Visibility" ] | |||||
| [node name="Leg" type="CollisionShape" parent="." index="1"] | |||||
| transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0.05, 0.35, 0 ) | |||||
| shape = SubResource( 2 ) | |||||
| disabled = false | |||||
| _sections_unfolded = [ "Transform", "Visibility" ] | |||||
| [node name="Ray" type="RayCast" parent="." index="2"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0 ) | |||||
| enabled = true | |||||
| exclude_parent = true | |||||
| cast_to = Vector3( 0, -0.3, 0 ) | |||||
| collision_mask = 1 | |||||
| _sections_unfolded = [ "Transform", "Visibility" ] | |||||
| [node name="Yaw" type="Spatial" parent="." index="3"] | |||||
| _sections_unfolded = [ "Transform", "Visibility" ] | |||||
| [node name="Camera" type="Camera" parent="Yaw" index="0"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, 0 ) | |||||
| keep_aspect = 0 | |||||
| cull_mask = 1048575 | |||||
| environment = null | |||||
| h_offset = 0.0 | |||||
| v_offset = 0.0 | |||||
| doppler_tracking = 0 | |||||
| projection = 0 | |||||
| current = false | |||||
| fov = 70.0 | |||||
| size = 1.0 | |||||
| near = 0.05 | |||||
| far = 100.0 | |||||
| _sections_unfolded = [ "Transform", "Visibility" ] | |||||
| [node name="Crosshair" type="Label" parent="." index="4"] | |||||
| anchor_left = 0.5 | |||||
| anchor_top = 0.5 | |||||
| anchor_right = 0.5 | |||||
| anchor_bottom = 0.5 | |||||
| margin_left = -20.0 | |||||
| margin_top = -7.0 | |||||
| margin_right = 20.0 | |||||
| margin_bottom = 7.0 | |||||
| rect_pivot_offset = Vector2( 0, 0 ) | |||||
| mouse_filter = 2 | |||||
| mouse_default_cursor_shape = 0 | |||||
| size_flags_horizontal = 1 | |||||
| size_flags_vertical = 4 | |||||
| percent_visible = 1.0 | |||||
| lines_skipped = 0 | |||||
| max_lines_visible = -1 | |||||
| [node name="MeshInstance" type="MeshInstance" parent="." index="5"] | |||||
| transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.95, 0 ) | |||||
| layers = 1 | |||||
| material_override = null | |||||
| cast_shadow = 1 | |||||
| extra_cull_margin = 0.0 | |||||
| use_in_baked_light = false | |||||
| lod_min_distance = 0.0 | |||||
| lod_min_hysteresis = 0.0 | |||||
| lod_max_distance = 0.0 | |||||
| lod_max_hysteresis = 0.0 | |||||
| mesh = SubResource( 3 ) | |||||
| skeleton = NodePath("..") | |||||
| material/0 = null | |||||
| _sections_unfolded = [ "Transform" ] | |||||
| @ -0,0 +1,36 @@ | |||||
| ; 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=3 | |||||
| [application] | |||||
| config/name="mv-moba" | |||||
| run/main_scene="res://lobby.tscn" | |||||
| config/icon="res://icon.png" | |||||
| [debug] | |||||
| =false | |||||
| [input] | |||||
| move_forwards=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":44,"unicode":0,"echo":false,"script":null) | |||||
| ] | |||||
| move_backwards=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":79,"unicode":0,"echo":false,"script":null) | |||||
| ] | |||||
| move_left=[ 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=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null) | |||||
| ] | |||||
| jump=[ 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) | |||||
| ] | |||||
| [rendering] | |||||
| environment/default_environment="res://default_env.tres" | |||||
| @ -0,0 +1,127 @@ | |||||
| [gd_scene load_steps=3 format=2] | |||||
| [ext_resource path="res://player.obj" type="ArrayMesh" id=1] | |||||
| [sub_resource type="BoxShape" id=1] | |||||
| extents = Vector3( 50, 10, 50 ) | |||||
| [node name="world" type="Spatial"] | |||||
| [node name="DirectionalLight" type="DirectionalLight" parent="." index="0"] | |||||
| transform = Transform( 0.784405, 0.193347, -0.589343, 0.315866, 0.693208, 0.647836, 0.533794, -0.694319, 0.482684, -7.6643, 1.97737, 0 ) | |||||
| layers = 1 | |||||
| light_color = Color( 1, 1, 1, 1 ) | |||||
| light_energy = 1.0 | |||||
| light_indirect_energy = 1.0 | |||||
| light_negative = false | |||||
| light_specular = 0.5 | |||||
| light_bake_mode = 1 | |||||
| light_cull_mask = -1 | |||||
| shadow_enabled = false | |||||
| shadow_color = Color( 0, 0, 0, 1 ) | |||||
| shadow_bias = 0.1 | |||||
| shadow_contact = 0.0 | |||||
| shadow_reverse_cull_face = false | |||||
| editor_only = false | |||||
| directional_shadow_mode = 2 | |||||
| directional_shadow_split_1 = 0.1 | |||||
| directional_shadow_split_2 = 0.2 | |||||
| directional_shadow_split_3 = 0.5 | |||||
| directional_shadow_blend_splits = false | |||||
| directional_shadow_normal_bias = 0.8 | |||||
| directional_shadow_bias_split_scale = 0.25 | |||||
| directional_shadow_depth_range = 0 | |||||
| directional_shadow_max_distance = 200.0 | |||||
| [node name="players" type="Spatial" parent="." index="1"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 11.4634, 0 ) | |||||
| [node name="MeshInstance" type="MeshInstance" parent="." index="2"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.88045, 1.58404, 0 ) | |||||
| layers = 1 | |||||
| material_override = null | |||||
| cast_shadow = 1 | |||||
| extra_cull_margin = 0.0 | |||||
| use_in_baked_light = false | |||||
| lod_min_distance = 0.0 | |||||
| lod_min_hysteresis = 0.0 | |||||
| lod_max_distance = 0.0 | |||||
| lod_max_hysteresis = 0.0 | |||||
| mesh = ExtResource( 1 ) | |||||
| skeleton = NodePath("..") | |||||
| material/0 = null | |||||
| [node name="MeshInstance2" type="MeshInstance" parent="." index="3"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7.15372, 1.58404, 0 ) | |||||
| layers = 1 | |||||
| material_override = null | |||||
| cast_shadow = 1 | |||||
| extra_cull_margin = 0.0 | |||||
| use_in_baked_light = false | |||||
| lod_min_distance = 0.0 | |||||
| lod_min_hysteresis = 0.0 | |||||
| lod_max_distance = 0.0 | |||||
| lod_max_hysteresis = 0.0 | |||||
| mesh = ExtResource( 1 ) | |||||
| skeleton = NodePath("..") | |||||
| material/0 = null | |||||
| [node name="MeshInstance3" type="MeshInstance" parent="." index="4"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.05031, 1.58404, -9.94615 ) | |||||
| layers = 1 | |||||
| material_override = null | |||||
| cast_shadow = 1 | |||||
| extra_cull_margin = 0.0 | |||||
| use_in_baked_light = false | |||||
| lod_min_distance = 0.0 | |||||
| lod_min_hysteresis = 0.0 | |||||
| lod_max_distance = 0.0 | |||||
| lod_max_hysteresis = 0.0 | |||||
| mesh = ExtResource( 1 ) | |||||
| skeleton = NodePath("..") | |||||
| material/0 = null | |||||
| [node name="MeshInstance4" type="MeshInstance" parent="." index="5"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.05031, 1.58404, 7.02516 ) | |||||
| layers = 1 | |||||
| material_override = null | |||||
| cast_shadow = 1 | |||||
| extra_cull_margin = 0.0 | |||||
| use_in_baked_light = false | |||||
| lod_min_distance = 0.0 | |||||
| lod_min_hysteresis = 0.0 | |||||
| lod_max_distance = 0.0 | |||||
| lod_max_hysteresis = 0.0 | |||||
| mesh = ExtResource( 1 ) | |||||
| skeleton = NodePath("..") | |||||
| material/0 = null | |||||
| [node name="Spatial" type="Spatial" parent="." index="6"] | |||||
| transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -10, 0 ) | |||||
| _sections_unfolded = [ "Transform" ] | |||||
| [node name="StaticBody" type="StaticBody" parent="Spatial" index="0"] | |||||
| input_ray_pickable = true | |||||
| input_capture_on_drag = false | |||||
| collision_layer = 1 | |||||
| collision_mask = 1 | |||||
| friction = 1.0 | |||||
| bounce = 0.0 | |||||
| constant_linear_velocity = Vector3( 0, 0, 0 ) | |||||
| constant_angular_velocity = Vector3( 0, 0, 0 ) | |||||
| [node name="CollisionShape" type="CollisionShape" parent="Spatial/StaticBody" index="0"] | |||||
| shape = SubResource( 1 ) | |||||
| disabled = false | |||||