forked from interstellar_development/freeftf
Milestone 9 Development
This commit is contained in:
parent
5dc3f6f5c7
commit
785bbd8f05
83 changed files with 1089 additions and 4525 deletions
|
|
@ -1,18 +1,25 @@
|
|||
## freeftf
|
||||
## Copyright (C) 2024 Patrick_Pluto
|
||||
## FreeFTF
|
||||
## Copyright (C) 2024 Interstellar Development
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
extends Node
|
||||
|
||||
var settings = {"save_version" = 4, "fps_counter" = 1, "port" = 35000, "ip" = "127.0.0.1", "username" = "DefaultName"}
|
||||
var settings = {"save_version" = 5, "fps_counter" = 1, "port" = 35000, "ip" = "interstellardevelopment.org", "username" = "DefaultName", "sensitivity" = 0.5}
|
||||
var computers = 0
|
||||
var players = 0
|
||||
var map_name = "mansion"
|
||||
var map_name = "test"
|
||||
var is_running = false
|
||||
var frozen = 0
|
||||
var dead = 0
|
||||
|
|
@ -20,6 +27,9 @@ var escaped = 0
|
|||
var result = "You Lose"
|
||||
var player_escaped = false
|
||||
var is_beast = false
|
||||
|
||||
var prison = preload("res://objects/freezer.tscn")
|
||||
var objective = preload("res://objects/computer.tscn")
|
||||
var character = preload("res://objects/player.tscn")
|
||||
# Server Variables
|
||||
var player_name
|
||||
|
|
@ -79,6 +89,7 @@ func reset():
|
|||
player_list = {}
|
||||
room_name = null
|
||||
is_server = false
|
||||
map_name = "test"
|
||||
multiplayer.multiplayer_peer = Client.offline
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
|
@ -95,13 +106,20 @@ func start_game():
|
|||
while !get_tree().root.has_node("./"+map_name+"/"):
|
||||
await get_tree().create_timer(0.001).timeout
|
||||
var map = get_tree().root.get_node("./"+map_name+"/")
|
||||
for i in range(player_list.size()):
|
||||
var obj = objective.instantiate()
|
||||
obj.position = get_tree().root.get_node("./"+map_name+"/objective_spawns/"+str(i)).position
|
||||
map.add_child(obj)
|
||||
for i in range(player_list.size()):
|
||||
var obj = prison.instantiate()
|
||||
obj.position = get_tree().root.get_node("./"+map_name+"/prison_spawns/"+str(i)).position
|
||||
map.add_child(obj)
|
||||
var i = 0
|
||||
for w in player_list:
|
||||
var player = character.instantiate()
|
||||
player.name = "player" + str(i)
|
||||
player.position = get_tree().root.get_node("./"+map_name+"/player_spawns/"+str(i)).position
|
||||
i += 1
|
||||
player.position.z = -i*2.5
|
||||
player.position.y = 1
|
||||
map.add_child(player)
|
||||
if is_server:
|
||||
var random = randi() % player_list.size()
|
||||
|
|
@ -116,11 +134,12 @@ func player_hit(target, beast):
|
|||
target.captured(beast)
|
||||
beast.got_one(target)
|
||||
|
||||
func sync_player(node_path, position, rotation):
|
||||
func sync_player(node_path, position, rotation, rotation2):
|
||||
if get_tree().root.has_node(node_path):
|
||||
var current_character = get_tree().root.get_node(node_path)
|
||||
current_character.position = position
|
||||
current_character.rotation = rotation
|
||||
get_tree().root.get_node(node_path).find_child("collision").rotation = rotation2
|
||||
|
||||
func sync_hammer(node_path, rotation):
|
||||
var current_character = get_tree().root.get_node(node_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue