Moved scripts to namespaces
This commit is contained in:
parent
fd7060e5c5
commit
de2c6261b0
51 changed files with 128 additions and 29 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
|
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/LinearProjectile.cs" id="1_3kc4s"]
|
[ext_resource type="Script" path="res://scripts/components/LinearProjectile.cs" id="1_3kc4s"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
|
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
public partial class Cursor : Node
|
public partial class Cursor : Node
|
||||||
{
|
{
|
||||||
public static Cursor Instance { get; private set; }
|
public static Cursor Instance { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Button that contains level to load
|
// Button that contains level to load
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Class that gives access to level data, pools and etc.
|
// Class that gives access to level data, pools and etc.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
public partial class Sun : Area2D
|
public partial class Sun : Area2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Class for general-used constants and utility tools
|
// Class for general-used constants and utility tools
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon.Components;
|
||||||
|
|
||||||
public partial class FlashComponent : CanvasGroup
|
public partial class FlashComponent : CanvasGroup
|
||||||
{
|
{
|
||||||
[Export] private float _flashDuration = 0.1f;
|
[Export] private float _flashDuration = 0.1f;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Base interface for entities
|
// Base interface for entities
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Base interface for entities
|
// Base interface for entities
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon.Components;
|
||||||
|
|
||||||
public partial class LevelGUIElements : Control
|
public partial class LevelGUIElements : Control
|
||||||
{
|
{
|
||||||
public static LevelGUIElements Instance;
|
public static LevelGUIElements Instance;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon.Components;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Projectile that travels from left to right
|
// Projectile that travels from left to right
|
||||||
//
|
//
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class FastForwardButton : Button
|
public partial class FastForwardButton : Button
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Plants;
|
||||||
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class ShovelButton : TextureButton
|
public partial class ShovelButton : TextureButton
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class SunCounter : Label
|
public partial class SunCounter : Label
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class VeilResizer : TextureProgressBar
|
public partial class VeilResizer : TextureProgressBar
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class GridLoader : GridContainer
|
public partial class GridLoader : GridContainer
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.GUI;
|
||||||
|
|
||||||
public partial class LevelRunButton : Button
|
public partial class LevelRunButton : Button
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public class ChoosableHandler : SeedpacketHandler, ISeedpacketPress
|
public class ChoosableHandler : SeedpacketHandler, ISeedpacketPress
|
||||||
{
|
{
|
||||||
public ChoosableHandler(Seedpacket owner) : base(owner)
|
public ChoosableHandler(Seedpacket owner) : base(owner)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
using Godot;
|
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public class HotbarHandler : SeedpacketHandler, ISeedpacketPress, ISeedpacketProcess, ISeedpacketUnfocus
|
public class HotbarHandler : SeedpacketHandler, ISeedpacketPress, ISeedpacketProcess, ISeedpacketUnfocus
|
||||||
{
|
{
|
||||||
public HotbarHandler(Seedpacket owner) : base(owner)
|
public HotbarHandler(Seedpacket owner) : base(owner)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using Godot;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public class HotbarPregameHandler : SeedpacketHandler, ISeedpacketPress
|
public class HotbarPregameHandler : SeedpacketHandler, ISeedpacketPress
|
||||||
{
|
{
|
||||||
public HotbarPregameHandler(Seedpacket owner) : base(owner)
|
public HotbarPregameHandler(Seedpacket owner) : base(owner)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public interface ISeedpacketPress
|
public interface ISeedpacketPress
|
||||||
{
|
{
|
||||||
public void Pressed();
|
public void Pressed();
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public interface ISeedpacketProcess
|
public interface ISeedpacketProcess
|
||||||
{
|
{
|
||||||
public void Process();
|
public void Process();
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public interface ISeedpacketUnfocus
|
public interface ISeedpacketUnfocus
|
||||||
{
|
{
|
||||||
public void OnUnfocused();
|
public void OnUnfocused();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public partial class Seedpacket : TextureButton
|
public partial class Seedpacket : TextureButton
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
namespace Newlon.Components.GUI.Seedpackets;
|
||||||
|
|
||||||
public class SeedpacketHandler
|
public class SeedpacketHandler
|
||||||
{
|
{
|
||||||
protected Seedpacket _owner;
|
protected Seedpacket _owner;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Newlon.Components.GUI.Seedpackets;
|
||||||
|
using Newlon.Components.Plants;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Level;
|
||||||
|
|
||||||
public partial class PlantField : Node2D
|
public partial class PlantField : Node2D
|
||||||
{
|
{
|
||||||
|
|
@ -64,7 +68,7 @@ public partial class PlantField : Node2D
|
||||||
|
|
||||||
if (canPlace)
|
if (canPlace)
|
||||||
_plantSetter.GlobalPosition = expected_pos;
|
_plantSetter.GlobalPosition = expected_pos;
|
||||||
_plantSetter.Texture = _resource == null ? null : _resource.Preview;
|
_plantSetter.Texture = _resource?.Preview;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _UnhandledInput(InputEvent @event)
|
public override void _UnhandledInput(InputEvent @event)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Level;
|
||||||
|
|
||||||
//
|
//
|
||||||
// PoolContainer contains nodes that contain different elemnts that generate during runtime
|
// PoolContainer contains nodes that contain different elemnts that generate during runtime
|
||||||
// Is not pool in traditional sense, but named like that to prevent repetition
|
// Is not pool in traditional sense, but named like that to prevent repetition
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using Godot;
|
using Godot;
|
||||||
//using Godot.Collections;
|
|
||||||
|
namespace Newlon.Components.Level;
|
||||||
|
|
||||||
public partial class RuntimeLevelData : Node
|
public partial class RuntimeLevelData : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Level;
|
||||||
|
|
||||||
public partial class SunSpawner : Node
|
public partial class SunSpawner : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Zombies;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
public partial class AreaAttack : Area2D
|
public partial class AreaAttack : Area2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Newlon.Components.Zombies;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
public partial class ExplosionComponent : Area2D
|
public partial class ExplosionComponent : Area2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
public partial class Eyesight : Area2D
|
public partial class Eyesight : Area2D
|
||||||
{
|
{
|
||||||
private bool _enemyDetected;
|
private bool _enemyDetected;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
public partial class PlantEyesightLimiter : CollisionShape2D
|
public partial class PlantEyesightLimiter : CollisionShape2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
public partial class PlantSunSpawner : Node2D
|
public partial class PlantSunSpawner : Node2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Data that plant stores during runtime
|
// Data that plant stores during runtime
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
// Shoot component of some plants
|
// Shoot component of some plants
|
||||||
public partial class Shooter : Node2D
|
public partial class Shooter : Node2D
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Plants.Behaviours;
|
||||||
|
|
||||||
public partial class PeashooterBehaviour : Node
|
public partial class PeashooterBehaviour : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants.Behaviours;
|
||||||
|
|
||||||
public partial class PotatomineBehaviour : Node
|
public partial class PotatomineBehaviour : Node
|
||||||
{
|
{
|
||||||
[Export] private AnimationPlayer _player;
|
[Export] private AnimationPlayer _player;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Plants.Behaviours;
|
||||||
|
|
||||||
public partial class SpikeweedBehaviour : Node
|
public partial class SpikeweedBehaviour : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Plants.Behaviours;
|
||||||
|
|
||||||
public partial class SunflowerBehaviour : Node
|
public partial class SunflowerBehaviour : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Plants.Behaviours;
|
||||||
|
|
||||||
public partial class WallnutBehaviour : Node
|
public partial class WallnutBehaviour : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Zombies;
|
||||||
|
|
||||||
public partial class AudioDamage : AudioStreamPlayer2D
|
public partial class AudioDamage : AudioStreamPlayer2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Plants;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Newlon.Components.Zombies;
|
||||||
|
|
||||||
public partial class EatBox : Area2D
|
public partial class EatBox : Area2D
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Zombies;
|
||||||
|
|
||||||
public partial class RuntimeZombieData : Node2D, IEntity
|
public partial class RuntimeZombieData : Node2D, IEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Zombies;
|
||||||
|
|
||||||
public partial class ZombieMover : Node
|
public partial class ZombieMover : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon.Components.Zombies.Behaviours;
|
||||||
|
|
||||||
public partial class BasicZombieBehaviour : Node
|
public partial class BasicZombieBehaviour : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using Newlon.Components.Level;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Newlon.Debug;
|
||||||
|
|
||||||
public partial class Cheats : Node
|
public partial class Cheats : Node
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon.Debug;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Debug tool to check time since clock loaded
|
// Debug tool to check time since clock loaded
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
|
namespace Newlon;
|
||||||
|
|
||||||
[GlobalClass]
|
[GlobalClass]
|
||||||
public partial class PlantResource : Resource
|
public partial class PlantResource : Resource
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
namespace Newlon.Systems.Effects;
|
||||||
|
|
||||||
public abstract partial class Effect : Resource
|
public abstract partial class Effect : Resource
|
||||||
{
|
{
|
||||||
public abstract void Enter();
|
public abstract void Enter();
|
||||||
|
|
|
||||||
6
scripts/systems/effects/IEffectHandler.cs
Normal file
6
scripts/systems/effects/IEffectHandler.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Newlon.Systems.Effects;
|
||||||
|
|
||||||
|
public interface IEffectHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue