Compare commits
No commits in common. "a267f2240619ed62970bc8e159f33e5ee181d591" and "8886a0d99d719ffdff7fb46a7e5b3d92e0046ab4" have entirely different histories.
a267f22406
...
8886a0d99d
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
@ -1,42 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bn21glvbfmyvd"
|
|
||||||
path.s3tc="res://.godot/imported/goal_icon.png-1fe98cf554c289fa7a08923cb33858c6.s3tc.ctex"
|
|
||||||
path.etc2="res://.godot/imported/goal_icon.png-1fe98cf554c289fa7a08923cb33858c6.etc2.ctex"
|
|
||||||
metadata={
|
|
||||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
|
||||||
"vram_texture": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/goal_icon.png"
|
|
||||||
dest_files=["res://.godot/imported/goal_icon.png-1fe98cf554c289fa7a08923cb33858c6.s3tc.ctex", "res://.godot/imported/goal_icon.png-1fe98cf554c289fa7a08923cb33858c6.etc2.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=2
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=true
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=0
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
width="210mm"
|
|
||||||
height="297mm"
|
|
||||||
viewBox="0 0 210 297"
|
|
||||||
version="1.1"
|
|
||||||
id="svg1"
|
|
||||||
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
|
||||||
sodipodi:docname="goal_icon.svg"
|
|
||||||
inkscape:export-filename="../assets/goal_icon.png"
|
|
||||||
inkscape:export-xdpi="120"
|
|
||||||
inkscape:export-ydpi="120"
|
|
||||||
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="namedview1"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:showpageshadow="2"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pagecheckerboard="0"
|
|
||||||
inkscape:deskcolor="#d1d1d1"
|
|
||||||
inkscape:document-units="mm"
|
|
||||||
inkscape:zoom="2.0157702"
|
|
||||||
inkscape:cx="222.24756"
|
|
||||||
inkscape:cy="442.01468"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1011"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="0"
|
|
||||||
inkscape:window-maximized="1"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
inkscape:export-bgcolor="#ffffff00" />
|
|
||||||
<defs
|
|
||||||
id="defs1" />
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<ellipse
|
|
||||||
style="fill:none;stroke:#000000;stroke-width:2.67372;stroke-dasharray:none"
|
|
||||||
id="path2"
|
|
||||||
cx="61.296879"
|
|
||||||
cy="144.29915"
|
|
||||||
rx="22.951746"
|
|
||||||
ry="8.0717163" />
|
|
||||||
<rect
|
|
||||||
style="fill:none;stroke:#000000;stroke-width:2.4738;stroke-dasharray:none"
|
|
||||||
id="rect3"
|
|
||||||
width="0.059541382"
|
|
||||||
height="22.098837"
|
|
||||||
x="38.385548"
|
|
||||||
y="121.17725" />
|
|
||||||
<rect
|
|
||||||
style="fill:none;stroke:#000000;stroke-width:2.4738;stroke-dasharray:none"
|
|
||||||
id="rect3-3"
|
|
||||||
width="0.059541382"
|
|
||||||
height="22.098837"
|
|
||||||
x="84.232483"
|
|
||||||
y="120.43052" />
|
|
||||||
<circle
|
|
||||||
style="fill:none;stroke:#000000;stroke-width:2.5;stroke-dasharray:none"
|
|
||||||
id="path3"
|
|
||||||
cx="59.262398"
|
|
||||||
cy="115.04649"
|
|
||||||
r="6.103436" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:12, 1.5;stroke-dashoffset:0;stroke-opacity:1"
|
|
||||||
d="m 63.922011,106.84295 c 10.216192,-9.632488 16.737034,-11.948724 34.52051,1.57507"
|
|
||||||
id="path4"
|
|
||||||
sodipodi:nodetypes="cc" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
@ -1,43 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cmmtk8f4vvpdf"
|
|
||||||
path="res://.godot/imported/goal_icon.svg-48e59e693e428cdafd0d963c1996b76d.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://raw_assets/goal_icon.svg"
|
|
||||||
dest_files=["res://.godot/imported/goal_icon.svg-48e59e693e428cdafd0d963c1996b76d.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://c1r8nk58cci3a"]
|
[gd_scene format=3 uid="uid://c1r8nk58cci3a"]
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://bafca0fr7yxgo" path="res://shaders/goal_shader.gdshader" id="1_vdq5s"]
|
[ext_resource type="Shader" uid="uid://bafca0fr7yxgo" path="res://shaders/goal_shader.gdshader" id="1_vdq5s"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bn21glvbfmyvd" path="res://assets/goal_icon.png" id="2_sxx5i"]
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sxx5i"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sxx5i"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
@ -20,9 +19,8 @@ cap_bottom = false
|
|||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1cgct"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1cgct"]
|
||||||
radius = 2.0
|
radius = 2.0
|
||||||
|
|
||||||
[node name="goal" type="Goal" unique_id=177528504 node_paths=PackedStringArray("mesh", "icon")]
|
[node name="goal" type="Goal" unique_id=177528504 node_paths=PackedStringArray("mesh")]
|
||||||
mesh = NodePath("mesh_instance_3d")
|
mesh = NodePath("mesh_instance_3d")
|
||||||
icon = NodePath("goal_icon")
|
|
||||||
collision_layer = 8
|
collision_layer = 8
|
||||||
collision_mask = 11
|
collision_mask = 11
|
||||||
|
|
||||||
@ -33,10 +31,3 @@ mesh = SubResource("CylinderMesh_1cgct")
|
|||||||
[node name="collision_shape_3d" type="CollisionShape3D" parent="." unique_id=2021568043]
|
[node name="collision_shape_3d" type="CollisionShape3D" parent="." unique_id=2021568043]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
shape = SubResource("CylinderShape3D_1cgct")
|
shape = SubResource("CylinderShape3D_1cgct")
|
||||||
|
|
||||||
[node name="goal_icon" type="Sprite3D" parent="." unique_id=625339734]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.9555063, 0)
|
|
||||||
pixel_size = 0.005
|
|
||||||
billboard = 1
|
|
||||||
no_depth_test = true
|
|
||||||
texture = ExtResource("2_sxx5i")
|
|
||||||
|
|||||||
@ -336,10 +336,6 @@ impl Game {
|
|||||||
pub fn on_player_killed(player: u16);
|
pub fn on_player_killed(player: u16);
|
||||||
#[signal]
|
#[signal]
|
||||||
pub fn on_map_loaded(map: Gd<Map>);
|
pub fn on_map_loaded(map: Gd<Map>);
|
||||||
#[signal]
|
|
||||||
pub fn on_pickup_ball(player_id: u16);
|
|
||||||
#[signal]
|
|
||||||
pub fn on_drop_ball();
|
|
||||||
|
|
||||||
pub fn singleton() -> Option<Gd<Game>> {
|
pub fn singleton() -> Option<Gd<Game>> {
|
||||||
if GameManager::singleton().get_children().len() > 0 {
|
if GameManager::singleton().get_children().len() > 0 {
|
||||||
@ -738,7 +734,6 @@ impl Game {
|
|||||||
velocity: Option<NetVector3>,
|
velocity: Option<NetVector3>,
|
||||||
player_id: Option<u16>,
|
player_id: Option<u16>,
|
||||||
) {
|
) {
|
||||||
godot_print!("Spawned ball");
|
|
||||||
if let Some(map) = &mut self.current_map {
|
if let Some(map) = &mut self.current_map {
|
||||||
let mut ball = map.bind_mut().spawn_ball(transform, velocity, player_id);
|
let mut ball = map.bind_mut().spawn_ball(transform, velocity, player_id);
|
||||||
if let Some(ball) = &mut ball {
|
if let Some(ball) = &mut ball {
|
||||||
@ -764,7 +759,6 @@ impl Game {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
self.signals().on_drop_ball().emit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn despawn_ball(&mut self) {
|
pub fn despawn_ball(&mut self) {
|
||||||
@ -866,21 +860,6 @@ impl Game {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if weapon_type == WeaponType::Ball {
|
|
||||||
self.run_deferred(move |s| s.signals().on_pickup_ball().emit(player_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(player) = self.find_player(player_id).clone()
|
|
||||||
&& let Some(character) = player.character.clone()
|
|
||||||
{
|
|
||||||
if let Some(weapon) = character.dyn_bind().get_weapon()
|
|
||||||
&& weapon.dyn_bind().get_type() == WeaponType::Ball
|
|
||||||
&& weapon_type != WeaponType::Ball
|
|
||||||
{
|
|
||||||
self.run_deferred(move |s| s.signals().on_drop_ball().emit());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(player) = self.find_player_mut(player_id)
|
if let Some(player) = self.find_player_mut(player_id)
|
||||||
&& let Some(character) = &mut player.character
|
&& let Some(character) = &mut player.character
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use godot::{
|
use godot::{
|
||||||
classes::{Area3D, IArea3D, MeshInstance3D, ShaderMaterial, Sprite3D},
|
classes::{Area3D, IArea3D, MeshInstance3D, ShaderMaterial},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,8 +17,6 @@ pub struct Goal {
|
|||||||
pub team: u8,
|
pub team: u8,
|
||||||
#[export]
|
#[export]
|
||||||
pub mesh: Option<Gd<MeshInstance3D>>,
|
pub mesh: Option<Gd<MeshInstance3D>>,
|
||||||
#[export]
|
|
||||||
pub icon: Option<Gd<Sprite3D>>,
|
|
||||||
|
|
||||||
base: Base<Area3D>,
|
base: Base<Area3D>,
|
||||||
}
|
}
|
||||||
@ -26,19 +24,6 @@ pub struct Goal {
|
|||||||
#[godot_api]
|
#[godot_api]
|
||||||
impl IArea3D for Goal {
|
impl IArea3D for Goal {
|
||||||
fn ready(&mut self) {
|
fn ready(&mut self) {
|
||||||
self.update_icon_visibility();
|
|
||||||
|
|
||||||
if let Some(game) = &mut Game::singleton() {
|
|
||||||
game.bind_mut()
|
|
||||||
.signals()
|
|
||||||
.on_pickup_ball()
|
|
||||||
.connect_other(self, |s, _| s.run_deferred(|s| s.update_icon_visibility()));
|
|
||||||
game.bind_mut()
|
|
||||||
.signals()
|
|
||||||
.on_drop_ball()
|
|
||||||
.connect_other(self, |s| s.run_deferred(|s| s.update_icon_visibility()));
|
|
||||||
}
|
|
||||||
|
|
||||||
self.update_color();
|
self.update_color();
|
||||||
self.base()
|
self.base()
|
||||||
.signals()
|
.signals()
|
||||||
@ -54,48 +39,24 @@ impl IArea3D for Goal {
|
|||||||
|
|
||||||
impl Goal {
|
impl Goal {
|
||||||
fn update_color(&mut self) {
|
fn update_color(&mut self) {
|
||||||
let color = if let Some(game) = Game::singleton()
|
|
||||||
&& let Some(team) = game.bind().get_team(self.team)
|
|
||||||
{
|
|
||||||
Some(team.bind().color())
|
|
||||||
} else if let Some(playback) = &StandaloneReplayManager::singleton().bind().playback
|
|
||||||
&& let Some(team) = playback.bind().replay.teams.get(self.team as usize)
|
|
||||||
{
|
|
||||||
let color: Color = team.color.clone().into();
|
|
||||||
Some(color)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(color) = color {
|
|
||||||
if let Some(mesh) = &mut self.mesh
|
if let Some(mesh) = &mut self.mesh
|
||||||
&& let Some(mat) = mesh.get_active_material(0)
|
&& let Some(mat) = mesh.get_active_material(0)
|
||||||
&& let Ok(mut mat) = mat.try_cast::<ShaderMaterial>()
|
&& let Ok(mut mat) = mat.try_cast::<ShaderMaterial>()
|
||||||
{
|
{
|
||||||
|
if let Some(game) = Game::singleton()
|
||||||
|
&& let Some(team) = game.bind().get_team(self.team)
|
||||||
|
{
|
||||||
|
mat.set_shader_parameter("goal_color", &team.bind().color().to_variant());
|
||||||
|
} else if let Some(playback) = &StandaloneReplayManager::singleton().bind().playback
|
||||||
|
&& let Some(team) = playback.bind().replay.teams.get(self.team as usize)
|
||||||
|
{
|
||||||
|
let color: Color = team.color.clone().into();
|
||||||
mat.set_shader_parameter("goal_color", &color.to_variant());
|
mat.set_shader_parameter("goal_color", &color.to_variant());
|
||||||
}
|
}
|
||||||
if let Some(icon) = &mut self.icon {
|
|
||||||
icon.set_modulate(color);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_icon_visibility(&mut self) {
|
fn on_enter(&self, node: Gd<Node3D>) {
|
||||||
if let Some(icon) = &mut self.icon {
|
|
||||||
if let Some(game) = Game::singleton()
|
|
||||||
&& let Some(ball_holder) = game.bind().ball_holder
|
|
||||||
&& let Some(player) = game.bind().find_player(ball_holder)
|
|
||||||
&& ball_holder == game.bind().self_id.unwrap_or(0)
|
|
||||||
&& player.data.team != self.team
|
|
||||||
{
|
|
||||||
icon.set_visible(true);
|
|
||||||
} else {
|
|
||||||
icon.set_visible(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_enter(&mut self, node: Gd<Node3D>) {
|
|
||||||
if !NetworkManager::singleton().bind().is_host() {
|
if !NetworkManager::singleton().bind().is_host() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -113,7 +74,7 @@ impl Goal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(player_id) = is_goal {
|
if let Some(player_id) = is_goal {
|
||||||
if let Some(game) = Game::singleton() {
|
if let Some(mut game) = Game::singleton() {
|
||||||
let teams = game
|
let teams = game
|
||||||
.bind()
|
.bind()
|
||||||
.get_teams()
|
.get_teams()
|
||||||
@ -122,13 +83,9 @@ impl Goal {
|
|||||||
.map(|(id, _)| id as u8)
|
.map(|(id, _)| id as u8)
|
||||||
.filter(|id| *id != self.team)
|
.filter(|id| *id != self.team)
|
||||||
.collect();
|
.collect();
|
||||||
self.run_deferred_gd(move |_| {
|
|
||||||
if let Some(game) = &mut Game::singleton() {
|
|
||||||
game.bind_mut().respawn_ball();
|
game.bind_mut().respawn_ball();
|
||||||
game.bind_mut().handle_goal(player_id, teams);
|
game.bind_mut().handle_goal(player_id, teams);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,9 +154,6 @@ impl<T: IPlayer + ICharacterBody3D + WithBaseField> PlayerCommon for T {
|
|||||||
{
|
{
|
||||||
s.swap_weapon(player.last_held_weapon, false);
|
s.swap_weapon(player.last_held_weapon, false);
|
||||||
}
|
}
|
||||||
if let Some(game) = &mut Game::singleton() {
|
|
||||||
game.bind_mut().ball_holder.take();
|
|
||||||
}
|
|
||||||
if NetworkManager::singleton().bind().is_host() {
|
if NetworkManager::singleton().bind().is_host() {
|
||||||
if let Some(mut game) = Game::singleton() {
|
if let Some(mut game) = Game::singleton() {
|
||||||
if let Some(ball_origin) = &s.get_camera_origin() {
|
if let Some(ball_origin) = &s.get_camera_origin() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user