.
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
using Godot;
|
||||
using GodotHostTest.Helpers;
|
||||
using GodotHostTest.Interfaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OwofGames.AetherBind;
|
||||
using R3;
|
||||
|
||||
namespace GodotHostTest.Game.Projectile;
|
||||
|
||||
public partial class Projectile : Node2D
|
||||
{
|
||||
[Inject] private ILogger<Projectile> _logger = null!;
|
||||
[Inject] private ITargetSpawner _targetSpawner = null!;
|
||||
[Export] private float _speed = 100;
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
_targetSpawner.TargetSpawned
|
||||
.Subscribe(_ => _logger.LogInformation("Projectile got informed of target spawning")).AddTo(this);
|
||||
Position += (float)delta * _speed * Vector2.Up.Rotated(Rotation);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
[gd_scene format=3 uid="uid://brbufibn7hi3o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dc5mvle8lc40j" path="res://Game/Projectile/Projectile.cs" id="1_g2gsk"]
|
||||
[ext_resource type="Script" uid="uid://qjonl8stia46" path="res://addons/AetherBind/ServiceSource.cs" id="2_g4q5f"]
|
||||
[ext_resource type="Texture2D" uid="uid://blwkfvcupjt0v" path="res://Game/Projectile/towerDefense_tile252.png" id="3_r0joc"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_u8d0v"]
|
||||
size = Vector2(22, 39)
|
||||
|
||||
[node name="Projectile" type="Node2D" unique_id=1686616504]
|
||||
script = ExtResource("1_g2gsk")
|
||||
_speed = 600.0
|
||||
|
||||
[node name="Scope" type="Node" parent="." unique_id=513224818 node_paths=PackedStringArray("InjectedNodes")]
|
||||
script = ExtResource("2_g4q5f")
|
||||
InjectedNodes = [NodePath("..")]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1021740171]
|
||||
texture = ExtResource("3_r0joc")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." unique_id=863162079]
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1209287052]
|
||||
position = Vector2(0, 0.5)
|
||||
shape = SubResource("RectangleShape2D_u8d0v")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 702 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://blwkfvcupjt0v"
|
||||
path="res://.godot/imported/towerDefense_tile252.png-d5810a59d75c81747798b425c2f018dc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Game/Projectile/towerDefense_tile252.png"
|
||||
dest_files=["res://.godot/imported/towerDefense_tile252.png-d5810a59d75c81747798b425c2f018dc.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
|
||||
Reference in New Issue
Block a user