Compare commits

..

12 Commits

Author SHA1 Message Date
c34b9bc16f Refactor ChargeProgressBar and SkillManager; update skill handling and improve component interactions 2025-08-27 00:14:41 +02:00
421a31917d Enhance ChargeProgressBar and Marketplace functionality; add owner exit handling and update skill button states 2025-08-26 23:52:30 +02:00
55c3ae212b Add skill upgrade system and refactor skill components for enhanced functionality; update resource paths and configurations 2025-08-26 23:48:59 +02:00
afca70e6c6 Add next level command and refactor player retrieval in GameManager; update scene files for consistency 2025-08-26 23:23:02 +02:00
6c733d3159 Add new UID files and update scene configurations for dialogue components; refactor skill management and input handling 2025-08-26 23:05:30 +02:00
6e71c321f7 Refactor skill components and update resource paths for consistency; enhance skill management in scenes 2025-08-26 20:10:18 +02:00
4c15f50f6e Add PhantomCamera components and UI elements for improved scene management; refactor existing components for better integration 2025-08-26 19:48:48 +02:00
cea3956fbb Refactor GameManager and PlayerDeathComponent for improved state management and logging; update scene connections for player death handling 2025-08-26 18:00:27 +02:00
ad53ef9715 Update node paths and group assignments for consistency across scenes 2025-08-26 17:45:00 +02:00
ca0d21e40a Refactor UI components to inherit from Control and update node paths for consistency 2025-08-26 16:20:01 +02:00
1d4948e5b4 Update resource paths and refactor properties for consistency 2025-08-21 20:05:26 +02:00
9d0f502cc2 Refactor collectable components to C# and update resource scripts for consistency 2025-08-21 18:01:13 +02:00
395 changed files with 2955 additions and 14377 deletions

2
.gitattributes vendored
View File

@@ -1,4 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
addons/* linguist-vendored
*.gd linguist-vendored

1
.gitignore vendored
View File

@@ -2,4 +2,3 @@
.godot/
/android/
builds/
.worktrees/

View File

@@ -1,110 +0,0 @@
using Godot;
using Mr.BrickAdventures.scripts.Resources;
using Mr.BrickAdventures.scripts.State;
namespace Mr.BrickAdventures.Autoloads;
/// <summary>
/// Manages achievements using GameStateStore.
/// </summary>
public partial class AchievementManager : Node
{
public static AchievementManager Instance { get; private set; }
[Export] private string AchievementsFolderPath = "res://achievements/";
[Export] private PackedScene AchievementPopupScene { get; set; }
private System.Collections.Generic.Dictionary<string, AchievementResource> _achievements = new();
public override void _Ready()
{
Instance = this;
LoadAchievementsFromFolder();
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
private void LoadAchievementsFromFolder()
{
using var dir = DirAccess.Open(AchievementsFolderPath);
if (dir == null)
{
GD.PrintErr($"AchievementManager: Could not open achievements folder at '{AchievementsFolderPath}'");
return;
}
dir.ListDirBegin();
var fileName = dir.GetNext();
while (fileName != "")
{
if (!dir.CurrentIsDir() && fileName.EndsWith(".tres"))
{
var achievement = GD.Load<AchievementResource>(AchievementsFolderPath + fileName);
if (achievement != null)
{
_achievements.TryAdd(achievement.Id, achievement);
}
}
fileName = dir.GetNext();
}
}
/// <summary>
/// Gets the list of unlocked achievement IDs from the store.
/// </summary>
private System.Collections.Generic.List<string> GetUnlockedIds()
{
return GameStateStore.Instance?.Player.UnlockedAchievements ?? new System.Collections.Generic.List<string>();
}
public void UnlockAchievement(string achievementId)
{
if (!_achievements.TryGetValue(achievementId, out var achievement))
{
GD.PrintErr($"Attempted to unlock non-existent achievement: '{achievementId}'");
return;
}
var unlockedIds = GetUnlockedIds();
if (unlockedIds.Contains(achievementId))
{
return; // Already unlocked
}
// 1. Mark as unlocked
unlockedIds.Add(achievementId);
GD.Print($"Achievement Unlocked: {achievement.DisplayName}");
EventBus.EmitAchievementUnlocked(achievementId);
// 2. Show the UI popup
if (AchievementPopupScene != null)
{
var popup = AchievementPopupScene.Instantiate<scripts.UI.AchievementPopup>();
GetTree().Root.AddChild(popup);
_ = popup.ShowAchievement(achievement);
}
// 3. Call SteamManager if it's available
if (SteamManager.IsSteamInitialized)
{
SteamManager.UnlockAchievement(achievement.Id);
}
}
public void LockAchievement(string achievementId)
{
var unlockedIds = GetUnlockedIds();
if (unlockedIds.Contains(achievementId))
{
unlockedIds.Remove(achievementId);
}
}
public bool IsAchievementUnlocked(string achievementId)
{
return GetUnlockedIds().Contains(achievementId);
}
}

View File

@@ -1 +0,0 @@
uid://c4vvuqnx5y33u

View File

@@ -4,8 +4,6 @@ namespace Mr.BrickAdventures.Autoloads;
public partial class ConfigFileHandler : Node
{
public static ConfigFileHandler Instance { get; private set; }
private ConfigFile _settingsConfig = new();
public const string SettingsPath = "user://settings.ini";
@@ -13,7 +11,6 @@ public partial class ConfigFileHandler : Node
public override void _Ready()
{
Instance = this;
if (!FileAccess.FileExists(SettingsPath))
{
var err = _settingsConfig.Save(SettingsPath);
@@ -27,9 +24,4 @@ public partial class ConfigFileHandler : Node
GD.PushError($"Failed to load settings file at {SettingsPath}: {err}");
}
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
}

View File

@@ -1,120 +1,158 @@
using Godot;
using Limbo.Console.Sharp;
using Mr.BrickAdventures.scripts;
using Mr.BrickAdventures.scripts.components;
namespace Mr.BrickAdventures.Autoloads;
public partial class ConsoleManager : Node
{
private GameStateStore Store => GameStateStore.Instance;
private GameManager GameManager => GameManager.Instance;
private AchievementManager AchievementManager => AchievementManager.Instance;
private GameManager _gameManager;
private SkillManager _skillManager;
private SkillUnlockerComponent _skillUnlockerComponent;
public override void _Ready()
{
_skillManager = SkillManager.Instance;
_gameManager = GetNode<GameManager>("/root/GameManager");
RegisterConsoleCommands();
}
public override void _ExitTree()
{
UnregisterConsoleCommands();
}
[ConsoleCommand("add_coins", "Adds a specified amount of coins to the player's total.")]
private void AddCoinsCommand(int amount)
{
if (Store == null) return;
Store.Player.Coins += amount;
EventBus.EmitCoinsChanged(Store.GetTotalCoins());
_gameManager.AddCoins(amount);
LimboConsole.Info($"Increased coins by {amount}. Total coins: {_gameManager.GetCoins()}");
}
[ConsoleCommand("set_coins", "Sets the player's total coins to a specified amount.")]
private void SetCoinsCommand(int amount)
{
if (Store == null) return;
Store.Player.Coins = Mathf.Max(0, amount);
EventBus.EmitCoinsChanged(Store.GetTotalCoins());
_gameManager.SetCoins(amount);
LimboConsole.Info($"Set coins to {amount}. Total coins: {_gameManager.GetCoins()}");
}
[ConsoleCommand("set_lives", "Sets the player's total lives to a specified amount.")]
private void SetLivesCommand(int amount)
{
if (Store == null) return;
Store.Player.Lives = amount;
EventBus.EmitLivesChanged(amount);
_gameManager.SetLives(amount);
LimboConsole.Info($"Set lives to {amount}.");
}
[ConsoleCommand("add_lives", "Adds a specified amount of lives to the player's total.")]
private void AddLivesCommand(int amount)
{
Store?.AddLives(amount);
_gameManager.AddLives(amount);
LimboConsole.Info($"Increased lives by {amount}. Total lives: {_gameManager.GetLives()}");
}
[ConsoleCommand("set_health", "Sets the player's health to a specified amount.")]
private void SetHealthCommand(float amount)
{
var playerHealthComponent = GameManager?.Player?.GetNode<HealthComponent>("HealthComponent");
var playerHealthComponent = _gameManager.Player.GetNode<HealthComponent>("HealthComponent");
if (playerHealthComponent != null)
playerHealthComponent.Health = amount;
}
private void ResetSessionCommand()
{
Store?.ResetSession();
}
private void UnlockSkillCommand(string skillName)
{
if (!EnsureSkillManagement()) return;
var skill = _skillManager.GetSkillByName(skillName);
if (skill == null) return;
Store?.UnlockSkillPermanently(skill);
_skillManager.ActivateSkill(skill);
_skillUnlockerComponent.EmitSignal(SkillUnlockerComponent.SignalName.SkillUnlocked, skill);
}
private void UnlockAllSkillsCommand()
{
if (!EnsureSkillManagement()) return;
_skillUnlockerComponent.UnlockAllSkills();
}
private void RemoveSkillCommand(string skillName)
{
if (!EnsureSkillManagement()) return;
var skill = _skillManager.GetSkillByName(skillName);
if (skill == null) return;
Store?.RemoveUnlockedSkill(skill.Name);
_skillManager.DeactivateSkill(skill);
}
private void RemoveAllSkillsCommand()
{
if (!EnsureSkillManagement()) return;
foreach (var skill in _skillManager.AvailableSkills)
{
Store?.RemoveUnlockedSkill(skill.Name);
_skillManager.DeactivateSkill(skill);
playerHealthComponent.Health = amount;
LimboConsole.Info($"Set player health to {amount}.");
}
else
{
LimboConsole.Warn("Player HealthComponent not found.");
}
}
[ConsoleCommand("reset_session", "Resets the current session state.")]
private void ResetSessionCommand()
{
_gameManager.ResetCurrentSessionState();
LimboConsole.Info("Current session state has been reset.");
}
[ConsoleCommand("unlock_skill", "Unlocks and activates a skill by its name.")]
private void UnlockSkillCommand(string skillName)
{
if (!GetSkillManagement()) return;
var skill = _skillManager.GetSkillByName(skillName);
if (skill == null)
{
LimboConsole.Warn($"Skill '{skillName}' not found.");
return;
}
_gameManager.UnlockSkill(skill);
_skillManager.ActivateSkill(skill);
_skillUnlockerComponent.EmitSignal(SkillUnlockerComponent.SignalName.SkillUnlocked, skill);
LimboConsole.Info($"Skill '{skillName}' has been unlocked and activated.");
}
private bool GetSkillManagement()
{
var player = _gameManager.Player;
if (player == null)
{
LimboConsole.Warn("Player node not found.");
return false;
}
_skillManager ??= player.GetNode<SkillManager>("SkillManager");
_skillUnlockerComponent ??= player.GetNode<SkillUnlockerComponent>("SkillUnlockerComponent");
if (_skillManager != null && _skillUnlockerComponent != null) return true;
LimboConsole.Warn("SkillManager or SkillUnlockerComponent not found on the player.");
return false;
}
[ConsoleCommand("unlock_all_skills", "Unlocks and activates all available skills.")]
private void UnlockAllSkillsCommand()
{
if (!GetSkillManagement()) return;
_skillUnlockerComponent.UnlockAllSkills();
LimboConsole.Info("All skills have been unlocked and activated.");
}
[ConsoleCommand("remove_skill", "Deactivates and removes a skill by its name.")]
private void RemoveSkillCommand(string skillName)
{
if (!GetSkillManagement()) return;
var skill = _skillManager.GetSkillByName(skillName);
if (skill == null)
{
LimboConsole.Warn($"Skill '{skillName}' not found.");
return;
}
_gameManager.RemoveSkill(skill.Name);
_skillManager.DeactivateSkill(skill);
LimboConsole.Info($"Skill '{skillName}' has been deactivated.");
}
[ConsoleCommand("remove_all_skills", "Deactivates and removes all skills.")]
private void RemoveAllSkillsCommand()
{
if (!GetSkillManagement()) return;
foreach (var skill in _skillManager.AvailableSkills)
{
_gameManager.RemoveSkill(skill.Name);
_skillManager.DeactivateSkill(skill);
}
LimboConsole.Info("All skills have been deactivated.");
}
[ConsoleCommand("next_level", "Advances the game to the next level.")]
private void GoToNextLevelCommand()
{
GameManager?.OnLevelComplete();
_gameManager.OnLevelComplete();
}
private void UnlockAchievementCommand(string achievementId)
{
AchievementManager?.UnlockAchievement(achievementId);
}
private void ResetAchievementCommand(string achievementId)
{
AchievementManager?.LockAchievement(achievementId);
}
private bool EnsureSkillManagement()
{
var player = GameManager?.Player;
if (player == null || !IsInstanceValid(player)) return false;
_skillUnlockerComponent ??= player.GetNode<SkillUnlockerComponent>("SkillUnlockerComponent");
return _skillManager != null && _skillUnlockerComponent != null;
}
}

View File

@@ -1,164 +0,0 @@
using Godot;
using Mr.BrickAdventures.scripts.components;
using Mr.BrickAdventures.scripts.Resources;
namespace Mr.BrickAdventures.Autoloads;
/// <summary>
/// Global event bus for decoupled communication between game systems.
/// Use the static Instance property for easy access from anywhere.
/// </summary>
public partial class EventBus : Node
{
/// <summary>
/// Singleton instance. Available after the autoload is initialized.
/// </summary>
public static EventBus Instance { get; private set; }
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this)
Instance = null;
}
#region Level Events
[Signal] public delegate void LevelStartedEventHandler(int levelIndex, Node currentScene);
[Signal] public delegate void LevelCompletedEventHandler(int levelIndex, Node currentScene, double completionTime);
[Signal] public delegate void LevelRestartedEventHandler(int levelIndex);
public static void EmitLevelStarted(int levelIndex, Node currentScene)
=> Instance?.EmitSignal(SignalName.LevelStarted, levelIndex, currentScene);
public static void EmitLevelCompleted(int levelIndex, Node currentScene, double completionTime)
=> Instance?.EmitSignal(SignalName.LevelCompleted, levelIndex, currentScene, completionTime);
public static void EmitLevelRestarted(int levelIndex)
=> Instance?.EmitSignal(SignalName.LevelRestarted, levelIndex);
#endregion
#region Player Events
[Signal] public delegate void PlayerSpawnedEventHandler(PlayerController player);
[Signal] public delegate void PlayerDiedEventHandler(Vector2 position);
[Signal] public delegate void PlayerDamagedEventHandler(float damage, float remainingHealth, Vector2 position);
[Signal] public delegate void PlayerHealedEventHandler(float amount, float newHealth, Vector2 position);
public static void EmitPlayerSpawned(PlayerController player)
=> Instance?.EmitSignal(SignalName.PlayerSpawned, player);
public static void EmitPlayerDied(Vector2 position)
=> Instance?.EmitSignal(SignalName.PlayerDied, position);
public static void EmitPlayerDamaged(float damage, float remainingHealth, Vector2 position)
=> Instance?.EmitSignal(SignalName.PlayerDamaged, damage, remainingHealth, position);
public static void EmitPlayerHealed(float amount, float newHealth, Vector2 position)
=> Instance?.EmitSignal(SignalName.PlayerHealed, amount, newHealth, position);
#endregion
#region Combat Events
[Signal] public delegate void EnemyDefeatedEventHandler(Node enemy, Vector2 position);
[Signal] public delegate void EnemyDamagedEventHandler(Node enemy, float damage, Vector2 position);
public static void EmitEnemyDefeated(Node enemy, Vector2 position)
=> Instance?.EmitSignal(SignalName.EnemyDefeated, enemy, position);
public static void EmitEnemyDamaged(Node enemy, float damage, Vector2 position)
=> Instance?.EmitSignal(SignalName.EnemyDamaged, enemy, damage, position);
#endregion
#region Collection Events
[Signal] public delegate void CoinCollectedEventHandler(int amount, Vector2 position);
[Signal] public delegate void ItemCollectedEventHandler(CollectableType itemType, float amount, Vector2 position);
[Signal] public delegate void ChildRescuedEventHandler(Vector2 position);
[Signal] public delegate void SkillCollectedEventHandler(SkillData skill, Vector2 position);
public static void EmitCoinCollected(int amount, Vector2 position)
=> Instance?.EmitSignal(SignalName.CoinCollected, amount, position);
public static void EmitItemCollected(CollectableType itemType, float amount, Vector2 position)
=> Instance?.EmitSignal(SignalName.ItemCollected, (int)itemType, amount, position);
public static void EmitChildRescued(Vector2 position)
=> Instance?.EmitSignal(SignalName.ChildRescued, position);
public static void EmitSkillCollected(SkillData skill, Vector2 position)
=> Instance?.EmitSignal(SignalName.SkillCollected, skill, position);
#endregion
#region Skill Events
[Signal] public delegate void SkillUnlockedEventHandler(string skillName, int level);
[Signal] public delegate void SkillActivatedEventHandler(string skillName);
[Signal] public delegate void SkillDeactivatedEventHandler(string skillName);
public static void EmitSkillUnlocked(string skillName, int level = 1)
=> Instance?.EmitSignal(SignalName.SkillUnlocked, skillName, level);
public static void EmitSkillActivated(string skillName)
=> Instance?.EmitSignal(SignalName.SkillActivated, skillName);
public static void EmitSkillDeactivated(string skillName)
=> Instance?.EmitSignal(SignalName.SkillDeactivated, skillName);
#endregion
#region Game State Events
[Signal] public delegate void GamePausedEventHandler();
[Signal] public delegate void GameResumedEventHandler();
[Signal] public delegate void GameSavedEventHandler();
[Signal] public delegate void GameStartedEventHandler();
[Signal] public delegate void GameContinuedEventHandler();
public static void EmitGamePaused()
=> Instance?.EmitSignal(SignalName.GamePaused);
public static void EmitGameResumed()
=> Instance?.EmitSignal(SignalName.GameResumed);
public static void EmitGameSaved()
=> Instance?.EmitSignal(SignalName.GameSaved);
public static void EmitGameStarted()
=> Instance?.EmitSignal(SignalName.GameStarted);
public static void EmitGameContinued()
=> Instance?.EmitSignal(SignalName.GameContinued);
#endregion
#region Achievement Events
[Signal] public delegate void AchievementUnlockedEventHandler(string achievementId);
public static void EmitAchievementUnlocked(string achievementId)
=> Instance?.EmitSignal(SignalName.AchievementUnlocked, achievementId);
#endregion
#region State Change Events
[Signal] public delegate void CoinsChangedEventHandler(int totalCoins);
[Signal] public delegate void LivesChangedEventHandler(int lives);
public static void EmitCoinsChanged(int totalCoins)
=> Instance?.EmitSignal(SignalName.CoinsChanged, totalCoins);
public static void EmitLivesChanged(int lives)
=> Instance?.EmitSignal(SignalName.LivesChanged, lives);
#endregion
}

View File

@@ -1 +0,0 @@
uid://bb2yq5wggdw3w

View File

@@ -1,66 +0,0 @@
using System;
using System.Globalization;
using Godot;
using Mr.BrickAdventures.scripts.Resources;
using Mr.BrickAdventures.scripts.UI;
namespace Mr.BrickAdventures.Autoloads;
public partial class FloatingTextManager : Node
{
[Export] public PackedScene FloatingTextScene { get; set; }
[ExportGroup("Colors")]
[Export] public Color DamageColor { get; set; } = new Color("#b21030"); // Red
[Export] public Color HealColor { get; set; } = new Color("#71f341"); // Green
[Export] public Color CoinColor { get; set; } = new Color("#ebd320"); // Gold
[Export] public Color MessageColor { get; set; } = new Color("#ffffff"); // White
public static FloatingTextManager Instance { get; private set; }
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
public void ShowDamage(float amount, Vector2 position)
{
var text = Mathf.Round(amount * 100f).ToString(CultureInfo.InvariantCulture);
CreateFloatingText(text, position, DamageColor);
}
public void ShowHeal(float amount, Vector2 position)
{
var text = $"+{Mathf.Round(amount * 100f).ToString(CultureInfo.InvariantCulture)}";
CreateFloatingText(text, position, HealColor);
}
public void ShowCoin(int amount, Vector2 position)
{
var text = $"+{amount}";
CreateFloatingText(text, position, CoinColor);
}
public void ShowMessage(string message, Vector2 position)
{
CreateFloatingText(message, position, MessageColor);
}
private void CreateFloatingText(string text, Vector2 position, Color color)
{
if (FloatingTextScene == null)
{
GD.PushError("FloatingTextManager: FloatingTextScene is not set!");
return;
}
var popup = FloatingTextScene.Instantiate<FloatingText>();
GetTree().CurrentScene.AddChild(popup);
popup.Show(text, position, color);
}
}

View File

@@ -1 +0,0 @@
uid://cobgfsr3gw7cn

View File

@@ -1,62 +1,195 @@
using System.Collections.Generic;
using System.Linq;
using Godot;
using Godot.Collections;
using Mr.BrickAdventures.scripts.components;
using Mr.BrickAdventures.scripts.Resources;
namespace Mr.BrickAdventures.Autoloads;
/// <summary>
/// Game orchestrator - handles scene transitions and game flow.
/// State lives in GameStateStore; query it directly for reads/writes.
/// </summary>
public partial class GameManager : Node
{
[Export] public Array<PackedScene> LevelScenes { get; set; } = [];
public PlayerController Player
{
public PlayerController Player {
get => GetPlayer();
private set => _player = value;
}
private List<Node> _sceneNodes = [];
private PlayerController _player;
private SpeedRunManager SpeedRunManager => SpeedRunManager.Instance;
private GameStateStore Store => GameStateStore.Instance;
public static GameManager Instance { get; private set; }
public override void _Ready()
[Export]
public Dictionary PlayerState { get; set; } = new()
{
Instance = this;
EventBus.Instance.PlayerSpawned += OnPlayerSpawned;
{ "coins", 0 },
{ "lives", 3 },
{ "current_level", 0 },
{ "completed_levels", new Array<int>() },
{ "unlocked_levels", new Array<int>() {0}},
{ "unlocked_skills", new Array<SkillData>() }
};
[Export]
public Dictionary CurrentSessionState { get; private set; } = new()
{
{ "coins_collected", 0 },
{ "skills_unlocked", new Array<SkillData>() }
};
public override void _EnterTree()
{
GetTree().NodeAdded += OnNodeAdded;
GetTree().NodeRemoved += OnNodeRemoved;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
if (EventBus.Instance != null)
EventBus.Instance.PlayerSpawned -= OnPlayerSpawned;
GetTree().NodeAdded -= OnNodeAdded;
GetTree().NodeRemoved -= OnNodeRemoved;
_sceneNodes.Clear();
}
private void OnPlayerSpawned(PlayerController player)
private void OnNodeAdded(Node node)
{
_player = player;
player.TreeExiting += () => { if (_player == player) _player = null; };
_sceneNodes.Add(node);
}
#region Game Flow
private void OnNodeRemoved(Node node)
{
_sceneNodes.Remove(node);
}
public void AddCoins(int amount)
{
PlayerState["coins"] = Mathf.Max(0, (int)PlayerState["coins"] + amount);
}
public void SetCoins(int amount) => PlayerState["coins"] = Mathf.Max(0, amount);
public int GetCoins() => (int)PlayerState["coins"] + (int)CurrentSessionState["coins_collected"];
public void RemoveCoins(int amount)
{
var sessionCoins = (int)CurrentSessionState["coins_collected"];
if (amount <= sessionCoins)
{
CurrentSessionState["coins_collected"] = sessionCoins - amount;
}
else
{
var remaining = amount - sessionCoins;
CurrentSessionState["coins_collected"] = 0;
PlayerState["coins"] = Mathf.Max(0, (int)PlayerState["coins"] - remaining);
}
PlayerState["coins"] = Mathf.Max(0, (int)PlayerState["coins"]);
}
public void AddLives(int amount) => PlayerState["lives"] = (int)PlayerState["lives"] + amount;
public void RemoveLives(int amount) => PlayerState["lives"] = (int)PlayerState["lives"] - amount;
public void SetLives(int amount) => PlayerState["lives"] = amount;
public int GetLives() => (int)PlayerState["lives"];
public bool IsSkillUnlocked(SkillData skill)
{
return ((Array)PlayerState["unlocked_skills"]).Contains(skill)
|| ((Array)CurrentSessionState["skills_unlocked"]).Contains(skill);
}
public void UnlockSkill(SkillData skill)
{
if (!IsSkillUnlocked(skill))
((Array)PlayerState["unlocked_skills"]).Add(skill);
}
public void RemoveSkill(string skillName)
{
var arr = (Array)PlayerState["unlocked_skills"];
foreach (SkillData s in arr)
{
if (s.Name != skillName) continue;
arr.Remove(s);
break;
}
}
public void UnlockSkills(Array<SkillData> skills)
{
foreach (var s in skills)
UnlockSkill(s);
}
public void ResetPlayerState()
{
PlayerState = new Dictionary
{
{ "coins", 0 },
{ "lives", 3 },
{ "current_level", 0 },
{ "completed_levels", new Array<int>() },
{ "unlocked_levels", new Array<int>() {0}},
{ "unlocked_skills", new Array<SkillData>() }
};
}
public void UnlockLevel(int levelIndex)
{
var unlocked = (Array)PlayerState["unlocked_levels"];
if (!unlocked.Contains(levelIndex)) unlocked.Add(levelIndex);
}
public void TryToGoToNextLevel()
{
var next = (int)PlayerState["current_level"] + 1;
var unlocked = (Array)PlayerState["unlocked_levels"];
if (next < LevelScenes.Count && unlocked.Contains(next))
{
PlayerState["current_level"] = next;
GetTree().ChangeSceneToPacked(LevelScenes[next]);
}
}
public void MarkLevelComplete(int levelIndex)
{
UnlockLevel(levelIndex + 1);
var completed = (Array)PlayerState["completed_levels"];
if (!completed.Contains(levelIndex)) completed.Add(levelIndex);
}
public void ResetCurrentSessionState()
{
CurrentSessionState = new Dictionary
{
{ "coins_collected", 0 },
{ "skills_unlocked", new Array<SkillData>() }
};
}
public void RestartGame()
{
ResetPlayerState();
ResetCurrentSessionState();
GetTree().ChangeSceneToPacked(LevelScenes[0]);
GetNode<SaveSystem>("/root/SaveSystem").SaveGame();
}
public void QuitGame() => GetTree().Quit();
public void PauseGame() => Engine.TimeScale = 0;
public void ResumeGame() => Engine.TimeScale = 1;
public void StartNewGame()
{
Store?.ResetAll();
SpeedRunManager?.StartTimer();
ResetPlayerState();
ResetCurrentSessionState();
GetTree().ChangeSceneToPacked(LevelScenes[0]);
SaveSystem.Instance.SaveGame();
EventBus.EmitGameStarted();
GetNode<SaveSystem>("/root/SaveSystem").SaveGame();
}
public void ContinueGame()
{
var save = SaveSystem.Instance;
var save = GetNode<SaveSystem>("/root/SaveSystem");
if (!save.LoadGame())
{
GD.PrintErr("Failed to load game. Starting a new game instead.");
@@ -64,79 +197,51 @@ public partial class GameManager : Node
return;
}
var idx = Store?.Player.CurrentLevel ?? 0;
var idx = (int)PlayerState["current_level"];
if (idx < LevelScenes.Count)
{
GetTree().ChangeSceneToPacked(LevelScenes[idx]);
EventBus.EmitGameContinued();
}
else
{
GD.PrintErr("No levels unlocked to continue.");
}
}
public void RestartGame()
{
Store?.ResetAll();
GetTree().ChangeSceneToPacked(LevelScenes[0]);
SaveSystem.Instance.SaveGame();
}
public void OnLevelComplete()
{
if (Store == null) return;
var levelIndex = (int)PlayerState["current_level"];
MarkLevelComplete(levelIndex);
AddCoins((int)CurrentSessionState["coins_collected"]);
foreach (var s in (Array)CurrentSessionState["skills_unlocked"])
UnlockSkill((SkillData)s);
var levelIndex = Store.Player.CurrentLevel;
Store.MarkLevelComplete(levelIndex);
Store.CommitSessionCoins();
Store.CommitSessionSkills();
var completionTime = SpeedRunManager?.GetCurrentLevelTime() ?? 0.0;
EventBus.EmitLevelCompleted(levelIndex, GetTree().CurrentScene, completionTime);
Store.ResetSession();
ResetCurrentSessionState();
TryToGoToNextLevel();
SaveSystem.Instance.SaveGame();
GetNode<SaveSystem>("/root/SaveSystem").SaveGame();
}
public void TryToGoToNextLevel()
public Array<SkillData> GetUnlockedSkills()
{
if (Store == null) return;
var next = Store.Player.CurrentLevel + 1;
if (next < LevelScenes.Count && Store.IsLevelUnlocked(next))
{
Store.Player.CurrentLevel = next;
GetTree().ChangeSceneToPacked(LevelScenes[next]);
EventBus.EmitLevelStarted(next, GetTree().CurrentScene);
}
var unlocked = (Array<SkillData>)PlayerState["unlocked_skills"];
var session = (Array<SkillData>)CurrentSessionState["skills_unlocked"];
if (session!.Count == 0) return unlocked;
if (unlocked!.Count == 0) return session;
var joined = new Array<SkillData>();
joined.AddRange(unlocked);
joined.AddRange(session);
return joined;
}
public void PauseGame()
{
Engine.TimeScale = 0;
EventBus.EmitGamePaused();
}
public void ResumeGame()
{
Engine.TimeScale = 1;
EventBus.EmitGameResumed();
}
public void QuitGame() => GetTree().Quit();
#endregion
#region Player Lookup
public PlayerController GetPlayer()
{
if (_player != null && IsInstanceValid(_player)) return _player;
_player = null;
if (_player != null) return _player;
foreach (var node in _sceneNodes)
{
if (node is not PlayerController player) continue;
_player = player;
return _player;
}
GD.PrintErr("PlayerController not found in the scene tree.");
return null;
}
#endregion
}

View File

@@ -1,243 +0,0 @@
using Godot;
using System.Collections.Generic;
using Mr.BrickAdventures.scripts.Resources;
using Mr.BrickAdventures.scripts.State;
namespace Mr.BrickAdventures.Autoloads;
/// <summary>
/// Central store for game state - single source of truth.
/// Use the static Instance property for easy access.
/// </summary>
public partial class GameStateStore : Node
{
/// <summary>
/// Singleton instance.
/// </summary>
public static GameStateStore Instance { get; private set; }
/// <summary>
/// Persistent player state (saved to disk).
/// </summary>
public PlayerState Player { get; set; } = new();
/// <summary>
/// Current session state (transient, reset on death/level complete).
/// </summary>
public SessionState Session { get; set; } = new();
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this)
Instance = null;
}
#region Coin Operations
/// <summary>
/// Gets total coins (saved + session).
/// </summary>
public int GetTotalCoins() => Player.Coins + Session.CoinsCollected;
/// <summary>
/// Adds coins to the session (not saved until level complete).
/// </summary>
public void AddSessionCoins(int amount)
{
Session.CoinsCollected += amount;
EventBus.EmitCoinsChanged(GetTotalCoins());
}
/// <summary>
/// Commits session coins to player state.
/// </summary>
public void CommitSessionCoins()
{
Player.Coins += Session.CoinsCollected;
Session.CoinsCollected = 0;
}
/// <summary>
/// Removes coins, first from session then from saved.
/// </summary>
public void RemoveCoins(int amount)
{
if (amount <= Session.CoinsCollected)
{
Session.CoinsCollected -= amount;
}
else
{
var remaining = amount - Session.CoinsCollected;
Session.CoinsCollected = 0;
Player.Coins = Mathf.Max(0, Player.Coins - remaining);
}
EventBus.EmitCoinsChanged(GetTotalCoins());
}
#endregion
#region Lives Operations
/// <summary>
/// Decrements lives by 1.
/// </summary>
public void RemoveLife()
{
Player.Lives = Mathf.Max(0, Player.Lives - 1);
EventBus.EmitLivesChanged(Player.Lives);
}
/// <summary>
/// Adds lives.
/// </summary>
public void AddLives(int amount)
{
Player.Lives += amount;
EventBus.EmitLivesChanged(Player.Lives);
}
#endregion
#region Level Operations
/// <summary>
/// Unlocks a level for access.
/// </summary>
public void UnlockLevel(int levelIndex)
{
if (!Player.UnlockedLevels.Contains(levelIndex))
Player.UnlockedLevels.Add(levelIndex);
}
/// <summary>
/// Marks a level as completed and unlocks the next.
/// </summary>
public void MarkLevelComplete(int levelIndex)
{
if (!Player.CompletedLevels.Contains(levelIndex))
Player.CompletedLevels.Add(levelIndex);
UnlockLevel(levelIndex + 1);
}
/// <summary>
/// Checks if a level is unlocked.
/// </summary>
public bool IsLevelUnlocked(int levelIndex) => Player.UnlockedLevels.Contains(levelIndex);
#endregion
#region Skill Operations
/// <summary>
/// Checks if a skill is unlocked (saved or session).
/// </summary>
public bool IsSkillUnlocked(SkillData skill)
{
return Player.UnlockedSkills.Contains(skill) || Session.SkillsUnlocked.Contains(skill);
}
/// <summary>
/// Unlocks a skill in the session (lost on death, committed on level complete).
/// </summary>
public void UnlockSkillInSession(SkillData skill)
{
if (!IsSkillUnlocked(skill))
Session.SkillsUnlocked.Add(skill);
}
/// <summary>
/// Permanently unlocks a skill directly in player state (bypasses session, e.g. console commands).
/// </summary>
public void UnlockSkillPermanently(SkillData skill)
{
if (!Player.UnlockedSkills.Contains(skill))
Player.UnlockedSkills.Add(skill);
}
/// <summary>
/// Removes a permanently unlocked skill from player state by name.
/// </summary>
public void RemoveUnlockedSkill(string skillName)
{
for (int i = 0; i < Player.UnlockedSkills.Count; i++)
{
if (Player.UnlockedSkills[i].Name == skillName)
{
Player.UnlockedSkills.RemoveAt(i);
return;
}
}
}
/// <summary>
/// Commits session skills to player state.
/// </summary>
public void CommitSessionSkills()
{
foreach (var skill in Session.SkillsUnlocked)
{
if (!Player.UnlockedSkills.Contains(skill))
Player.UnlockedSkills.Add(skill);
}
Session.SkillsUnlocked.Clear();
}
/// <summary>
/// Gets all unlocked skills from player persistence and current session.
/// </summary>
public List<SkillData> GetAllUnlockedSkills()
{
var result = new List<SkillData>(Player.UnlockedSkills);
foreach (var skill in Session.SkillsUnlocked)
{
if (!result.Contains(skill)) result.Add(skill);
}
return result;
}
#endregion
#region Statistics Operations
public void IncrementStat(string name, int amount = 1)
{
if (Player.Statistics.TryGetValue(name, out var current))
Player.Statistics[name] = current + amount;
else
Player.Statistics[name] = amount;
}
public void SetStat(string name, int value) => Player.Statistics[name] = value;
public int GetStat(string name) =>
Player.Statistics.TryGetValue(name, out var value) ? value : 0;
public System.Collections.Generic.Dictionary<string, int> GetAllStats() =>
new(Player.Statistics);
#endregion
#region Reset Operations
/// <summary>
/// Resets only the session state.
/// </summary>
public void ResetSession() => Session.Reset();
/// <summary>
/// Resets everything to defaults.
/// </summary>
public void ResetAll()
{
Player.Reset();
Session.ResetAll();
}
#endregion
}

View File

@@ -1 +0,0 @@
uid://bwrhkipwecytk

View File

@@ -1,136 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using Godot;
using Mr.BrickAdventures.scripts;
using Mr.BrickAdventures.scripts.State;
namespace Mr.BrickAdventures.Autoloads;
public partial class GhostManager : Node
{
public static GhostManager Instance { get; private set; }
[Export] private PackedScene GhostPlayerScene { get; set; }
public override void _Ready() => Instance = this;
public override void _ExitTree() { if (Instance == this) Instance = null; }
public bool IsRecording { get; private set; } = false;
public bool IsPlaybackEnabled { get; private set; } = true;
private List<GhostFrame> _currentRecording = [];
private double _startTime = 0.0;
private int _currentLevelIndex = -1;
public void StartRecording(int levelIndex)
{
if (!IsPlaybackEnabled) return;
_currentLevelIndex = levelIndex;
_currentRecording.Clear();
_startTime = Time.GetTicksMsec() / 1000.0;
IsRecording = true;
GD.Print("Ghost recording started.");
}
public void StopRecording(bool levelCompleted, double finalTime)
{
if (!IsRecording) return;
IsRecording = false;
if (levelCompleted)
{
var bestTime = LoadBestTime(_currentLevelIndex);
if (finalTime < bestTime)
{
SaveGhostData(_currentLevelIndex, finalTime);
GD.Print($"New best ghost saved for level {_currentLevelIndex}. Time: {finalTime}");
}
}
_currentRecording.Clear();
}
public void RecordFrame(Vector2 position)
{
if (!IsRecording) return;
_currentRecording.Add(new GhostFrame
{
Timestamp = (Time.GetTicksMsec() / 1000.0) - _startTime,
Position = position
});
}
public void SpawnGhostPlayer(int levelIndex, Node parent)
{
if (!IsPlaybackEnabled || GhostPlayerScene == null) return;
var ghostData = LoadGhostData(levelIndex);
if (ghostData.Count > 0)
{
var ghostPlayer = GhostPlayerScene.Instantiate<GhostPlayer>();
parent.AddChild(ghostPlayer);
ghostPlayer.StartPlayback(ghostData);
GD.Print($"Ghost player spawned for level {levelIndex}.");
}
}
private void SaveGhostData(int levelIndex, double time)
{
var path = $"user://ghost_level_{levelIndex}.json";
var saveData = new GhostSaveData { BestTime = time };
foreach (var frame in _currentRecording)
saveData.Frames.Add(new GhostFrameDto { Timestamp = frame.Timestamp, X = frame.Position.X, Y = frame.Position.Y });
try
{
var json = JsonSerializer.Serialize(saveData, SaveSystem.JsonOptions);
using var file = FileAccess.Open(path, FileAccess.ModeFlags.Write);
file.StoreString(json);
}
catch (System.Exception e)
{
GD.PrintErr($"GhostManager: Failed to save ghost data: {e.Message}");
}
}
private List<GhostFrame> LoadGhostData(int levelIndex)
{
var path = $"user://ghost_level_{levelIndex}.json";
if (!FileAccess.FileExists(path)) return [];
try
{
using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read);
var saveData = JsonSerializer.Deserialize<GhostSaveData>(file.GetAsText(), SaveSystem.JsonOptions);
if (saveData == null) return [];
var frames = new List<GhostFrame>();
foreach (var dto in saveData.Frames)
frames.Add(new GhostFrame { Timestamp = dto.Timestamp, Position = new Vector2(dto.X, dto.Y) });
return frames;
}
catch (System.Exception e)
{
GD.PrintErr($"GhostManager: Failed to load ghost data: {e.Message}");
return [];
}
}
private double LoadBestTime(int levelIndex)
{
var path = $"user://ghost_level_{levelIndex}.json";
if (!FileAccess.FileExists(path)) return double.MaxValue;
try
{
using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read);
var saveData = JsonSerializer.Deserialize<GhostSaveData>(file.GetAsText(), SaveSystem.JsonOptions);
return saveData?.BestTime ?? double.MaxValue;
}
catch
{
return double.MaxValue;
}
}
}

View File

@@ -1 +0,0 @@
uid://cgmuod4p2hg5h

View File

@@ -1,54 +0,0 @@
using Godot;
namespace Mr.BrickAdventures.Autoloads;
public partial class InputDeviceManager : Node
{
public enum InputDevice { Mouse, Keyboard, Gamepad }
public static InputDeviceManager Instance { get; private set; }
public InputDevice CurrentDevice { get; private set; } = InputDevice.Mouse;
public bool IsPointerless => CurrentDevice is InputDevice.Keyboard or InputDevice.Gamepad;
[Signal] public delegate void DeviceChangedEventHandler(int device);
public override void _Ready()
{
Instance = this;
Input.MouseMode = Input.MouseModeEnum.Visible;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
public override void _Input(InputEvent @event)
{
InputDevice detected;
if (@event is InputEventMouseMotion or InputEventMouseButton)
detected = InputDevice.Mouse;
else if (@event is InputEventKey)
detected = InputDevice.Keyboard;
else if (@event is InputEventJoypadButton)
detected = InputDevice.Gamepad;
else if (@event is InputEventJoypadMotion joyEvent)
{
if (Mathf.Abs(joyEvent.AxisValue) <= 0.15f) return;
detected = InputDevice.Gamepad;
}
else
return;
if (detected == CurrentDevice) return;
CurrentDevice = detected;
Input.MouseMode = CurrentDevice == InputDevice.Mouse
? Input.MouseModeEnum.Visible
: Input.MouseModeEnum.Hidden;
EmitSignal(SignalName.DeviceChanged, (int)CurrentDevice);
}
}

View File

@@ -1 +0,0 @@
uid://b81610g8fd6p1

View File

@@ -1,176 +1,61 @@
using System.Collections.Generic;
using System.Text.Json;
using Godot;
using Godot.Collections;
using Mr.BrickAdventures.scripts.Resources;
using Mr.BrickAdventures.scripts.State;
namespace Mr.BrickAdventures.Autoloads;
/// <summary>
/// Save system that serializes state to JSON using DTOs.
/// </summary>
public partial class SaveSystem : Node
{
[Export] public string SavePath { get; set; } = "user://savegame.json";
[Export] public int Version { get; set; } = 2;
[Export] public string SavePath { get; set; } = "user://savegame.save";
[Export] public int Version { get; set; } = 1;
public static SaveSystem Instance { get; private set; }
internal static readonly JsonSerializerOptions JsonOptions = new()
{
WriteIndented = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};
private GameManager _gameManager;
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
_gameManager = GetNode<GameManager>("/root/GameManager");
}
public void SaveGame()
{
var store = GameStateStore.Instance;
if (store == null)
var saveData = new Dictionary
{
GD.PrintErr("SaveSystem: GameStateStore not available.");
return;
}
// Convert to DTO (only serializable data)
var saveData = new SaveDataDto
{
Version = Version,
Coins = store.Player.Coins,
Lives = store.Player.Lives,
CurrentLevel = store.Player.CurrentLevel,
CompletedLevels = [.. store.Player.CompletedLevels],
UnlockedLevels = new List<int>(store.Player.UnlockedLevels),
UnlockedSkillNames = GetSkillNames(store.Player.UnlockedSkills),
UnlockedAchievements = new List<string>(store.Player.UnlockedAchievements),
Statistics = new Dictionary<string, int>(store.Player.Statistics)
{ "player_state", _gameManager.PlayerState},
{ "version", Version}
};
try
{
var json = JsonSerializer.Serialize(saveData, JsonOptions);
using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Write);
file.StoreString(json);
GD.Print("Game saved to: ", SavePath);
EventBus.EmitGameSaved();
}
catch (System.Exception e)
{
GD.PrintErr($"SaveSystem: Failed to save game: {e.Message}");
}
using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Write);
file.StoreVar(saveData);
GD.Print("Game state saved to: ", SavePath);
}
public bool LoadGame()
{
if (!FileAccess.FileExists(SavePath))
return false;
using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Read);
var saveDataObj = (Dictionary)file.GetVar();
if (saveDataObj.ContainsKey("version") && (int)saveDataObj["version"] != Version)
{
GD.Print("SaveSystem: No save file found.");
GD.Print($"Save file version mismatch. Expected: {Version}, Found: {saveDataObj["version"]}");
return false;
}
try
GD.Print("Game state loaded from: ", SavePath);
GD.Print("Player state: ", saveDataObj["player_state"]);
_gameManager.PlayerState = (Dictionary)saveDataObj["player_state"];
var skills = new Array<SkillData>();
foreach (var skill in (Array<SkillData>)_gameManager.PlayerState["unlocked_skills"])
{
using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Read);
var json = file.GetAsText();
var saveData = JsonSerializer.Deserialize<SaveDataDto>(json, JsonOptions);
if (saveData == null)
{
GD.PrintErr("SaveSystem: Failed to deserialize save data.");
return false;
}
if (saveData.Version != Version)
{
GD.PrintErr($"SaveSystem: Version mismatch. Expected {Version}, found {saveData.Version}");
return false;
}
var store = GameStateStore.Instance;
if (store == null)
{
GD.PrintErr("SaveSystem: GameStateStore not available.");
return false;
}
// Apply loaded state
store.Player.Coins = saveData.Coins;
store.Player.Lives = saveData.Lives;
store.Player.CurrentLevel = saveData.CurrentLevel;
store.Player.CompletedLevels = saveData.CompletedLevels ?? new List<int>();
store.Player.UnlockedLevels = saveData.UnlockedLevels ?? new List<int> { 0 };
store.Player.UnlockedAchievements = saveData.UnlockedAchievements ?? new List<string>();
store.Player.Statistics = saveData.Statistics ?? new Dictionary<string, int>();
// Reload skills by name from SkillManager
store.Player.UnlockedSkills = LoadSkillsByName(saveData.UnlockedSkillNames);
GD.Print("Game loaded from: ", SavePath);
return true;
}
catch (System.Exception e)
{
GD.PrintErr($"SaveSystem: Failed to load game: {e.Message}");
return false;
}
}
private static List<string> GetSkillNames(List<SkillData> skills)
{
var names = new List<string>();
foreach (var skill in skills)
{
if (skill != null)
names.Add(skill.Name);
}
return names;
}
private List<SkillData> LoadSkillsByName(List<string> skillNames)
{
var skills = new List<SkillData>();
if (skillNames == null) return skills;
var skillManager = SkillManager.Instance;
if (skillManager == null)
{
GD.PrintErr("SaveSystem: SkillManager not available to resolve skill names.");
return skills;
skills.Add(skill);
}
foreach (var name in skillNames)
{
var skill = skillManager.GetSkillByName(name);
if (skill != null)
{
skills.Add(skill);
}
else
{
GD.PrintErr($"SaveSystem: Skill '{name}' not found in SkillManager.");
}
}
return skills;
_gameManager.UnlockSkills(skills);
return true;
}
public bool CheckSaveExists() => FileAccess.FileExists(SavePath);
public void DeleteSave()
{
if (FileAccess.FileExists(SavePath))
{
DirAccess.RemoveAbsolute(ProjectSettings.GlobalizePath(SavePath));
GD.Print("Save file deleted.");
}
}
}

View File

@@ -1,203 +0,0 @@
using Godot;
using System.Collections.Generic;
namespace Mr.BrickAdventures.Autoloads;
public partial class SettingsManager : Node
{
public static SettingsManager Instance { get; private set; }
public float GamepadDeadzone { get; set; } = 0.2f;
public float GamepadSensitivity { get; set; } = 1.0f;
public string WindowMode { get; set; } = "fullscreen";
public Vector2I Resolution { get; set; } = new Vector2I(1920, 1080);
private static readonly List<Vector2I> CuratedResolutions = new()
{
// 4:3
new Vector2I(640, 480),
new Vector2I(800, 600),
new Vector2I(1024, 768),
new Vector2I(1280, 960),
new Vector2I(1600, 1200),
// 16:9
new Vector2I(1280, 720),
new Vector2I(1366, 768),
new Vector2I(1600, 900),
new Vector2I(1920, 1080),
new Vector2I(2560, 1440),
new Vector2I(3840, 2160),
// 16:10
new Vector2I(1280, 800),
new Vector2I(1440, 900),
new Vector2I(1920, 1200),
new Vector2I(2560, 1600),
};
private readonly List<Vector2I> _customResolutions = new();
private static readonly string[] DeadzoneActions = { "left", "right", "up", "down" };
public override void _Ready()
{
Instance = this;
if (ConfigFileHandler.Instance == null)
{
GD.PushError("SettingsManager: ConfigFileHandler.Instance is null");
return;
}
var cfg = ConfigFileHandler.Instance.SettingsConfig;
// --- display_settings ---
WindowMode = cfg.GetValue("display_settings", "window_mode", Variant.From("fullscreen")).AsString();
var resStr = cfg.GetValue("display_settings", "resolution", Variant.From("1920x1080")).AsString();
Resolution = ParseResolution(resStr, new Vector2I(1920, 1080));
var customResStr = cfg.GetValue("display_settings", "custom_resolutions", Variant.From("")).AsString();
if (!string.IsNullOrWhiteSpace(customResStr))
{
foreach (var part in customResStr.Split(','))
{
var r = ParseResolution(part.Trim(), Vector2I.Zero);
if (r != Vector2I.Zero)
_customResolutions.Add(r);
}
}
ApplyDisplaySettings();
// --- gameplay_settings ---
GamepadDeadzone = (float)cfg.GetValue("gameplay_settings", "gamepad_deadzone", Variant.From(0.2)).AsDouble();
GamepadSensitivity = (float)cfg.GetValue("gameplay_settings", "gamepad_sensitivity", Variant.From(1.0)).AsDouble();
ApplyGamepadDeadzone();
// --- input_settings ---
ApplyInputBindings(cfg);
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
// ── public API ───────────────────────────────────────────────────────────
public List<Vector2I> GetAllResolutions()
{
var all = new List<Vector2I>(CuratedResolutions);
all.AddRange(_customResolutions);
return all;
}
public void SaveDisplaySettings()
{
var cfg = ConfigFileHandler.Instance.SettingsConfig;
cfg.SetValue("display_settings", "window_mode", WindowMode);
cfg.SetValue("display_settings", "resolution", $"{Resolution.X}x{Resolution.Y}");
cfg.SetValue("display_settings", "custom_resolutions", BuildCustomResolutionsString());
cfg.Save(ConfigFileHandler.SettingsPath);
}
public void SaveGameplaySettings()
{
var cfg = ConfigFileHandler.Instance.SettingsConfig;
cfg.SetValue("gameplay_settings", "gamepad_deadzone", (double)GamepadDeadzone);
cfg.SetValue("gameplay_settings", "gamepad_sensitivity", (double)GamepadSensitivity);
cfg.Save(ConfigFileHandler.SettingsPath);
}
public void SaveInputSettings()
{
var cfg = ConfigFileHandler.Instance.SettingsConfig;
foreach (var action in InputMap.GetActions())
{
if (action.ToString().StartsWith("ui_")) continue;
foreach (var ev in InputMap.ActionGetEvents(action))
{
if (ev is InputEventKey key)
{
cfg.SetValue("input_settings", action, (long)key.PhysicalKeycode);
break;
}
}
}
cfg.Save(ConfigFileHandler.SettingsPath);
}
// ── apply helpers ────────────────────────────────────────────────────────
public void ApplyDisplaySettings()
{
switch (WindowMode)
{
case "fullscreen":
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
break;
case "borderless":
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, true);
DisplayServer.WindowSetSize(Resolution);
break;
default: // "windowed"
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, false);
DisplayServer.WindowSetSize(Resolution);
break;
}
}
public void ApplyGamepadDeadzone()
{
foreach (var action in DeadzoneActions)
{
if (InputMap.HasAction(action))
InputMap.ActionSetDeadzone(action, GamepadDeadzone);
}
}
private static void ApplyInputBindings(ConfigFile cfg)
{
if (!cfg.HasSection("input_settings")) return;
foreach (var actionName in cfg.GetSectionKeys("input_settings"))
{
if (actionName.StartsWith("ui_")) continue;
if (!InputMap.HasAction(actionName)) continue;
var scancode = (Key)(long)cfg.GetValue("input_settings", actionName);
// Remove existing keyboard events for this action
var events = InputMap.ActionGetEvents(actionName);
foreach (var ev in events)
{
if (ev is InputEventKey)
InputMap.ActionEraseEvent(actionName, ev);
}
// Add the saved key
var newKey = new InputEventKey { PhysicalKeycode = scancode };
InputMap.ActionAddEvent(actionName, newKey);
}
}
// ── util ─────────────────────────────────────────────────────────────────
private static Vector2I ParseResolution(string s, Vector2I fallback)
{
var parts = s.Split('x');
if (parts.Length == 2 && int.TryParse(parts[0], out var w) && int.TryParse(parts[1], out var h))
return new Vector2I(w, h);
return fallback;
}
private string BuildCustomResolutionsString()
{
var parts = new List<string>();
foreach (var r in _customResolutions)
parts.Add($"{r.X}x{r.Y}");
return string.Join(",", parts);
}
}

View File

@@ -1 +0,0 @@
uid://d4jyxtm4jgtka

View File

@@ -1,205 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using Godot;
using Godot.Collections;
using Mr.BrickAdventures.scripts.components;
using Mr.BrickAdventures.scripts.interfaces;
using Mr.BrickAdventures.scripts.Resources;
namespace Mr.BrickAdventures.Autoloads;
public partial class SkillManager : Node
{
private PlayerController _player;
private GameStateStore Store => GameStateStore.Instance;
[Export] public Array<SkillData> AvailableSkills { get; set; } = [];
public Dictionary ActiveComponents { get; private set; } = new();
public static SkillManager Instance { get; private set; }
[Signal]
public delegate void ActiveThrowSkillChangedEventHandler(BrickThrowComponent throwComponent);
[Signal]
public delegate void SkillRemovedEventHandler(SkillData skillData);
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
/// <summary>
/// Called by the PlayerController from its _Ready method to register itself with the manager.
/// </summary>
public void RegisterPlayer(PlayerController player)
{
if (_player == player) return;
// If a player is already registered (e.g., from a previous scene), unregister it first.
if (_player != null && IsInstanceValid(_player))
{
UnregisterPlayer();
}
_player = player;
if (_player != null)
{
// Automatically unregister when the player node is removed from the scene.
_player.TreeExiting += UnregisterPlayer;
ApplyUnlockedSkills();
}
}
/// <summary>
/// Cleans up skills and references related to the current player.
/// </summary>
private void UnregisterPlayer()
{
if (_player != null && IsInstanceValid(_player))
{
_player.TreeExiting -= UnregisterPlayer;
RemoveAllActiveSkills();
}
_player = null;
}
public void AddSkill(SkillData skillData)
{
// Ensure a valid player is registered before adding a skill.
if (_player == null || !IsInstanceValid(_player))
{
GD.Print("SkillManager: Player not available to add skill.");
return;
}
if (ActiveComponents.ContainsKey(skillData.Name))
return;
if (skillData.Type == SkillType.Throw)
{
// Remove any other active throw skill before adding the new one
foreach (var sd in AvailableSkills)
{
if (sd != skillData && sd.Type == SkillType.Throw)
RemoveSkill(sd.Name);
}
}
var instance = skillData.Node.Instantiate();
if (instance is ISkill skill)
{
// Initialize the skill with the registered player instance.
skill.Initialize(_player, skillData);
skill.Activate();
}
else
{
GD.PrintErr($"Skill scene for '{skillData.Name}' does not implement ISkill!");
instance.QueueFree();
return;
}
// Add the skill node as a child of the player.
_player.AddChild(instance);
ActiveComponents[skillData.Name] = instance;
if (instance is BrickThrowComponent btc)
{
EmitSignalActiveThrowSkillChanged(btc);
}
}
public void RemoveSkill(string skillName)
{
if (!ActiveComponents.TryGetValue(skillName, out var component))
return;
if (component.AsGodotObject() is BrickThrowComponent)
{
EmitSignalActiveThrowSkillChanged(null);
}
var inst = (Node)component;
if (inst is ISkill skill)
{
skill.Deactivate();
}
if (IsInstanceValid(inst))
inst.QueueFree();
ActiveComponents.Remove(skillName);
var sd = GetSkillByName(skillName);
if (sd != null) EmitSignalSkillRemoved(sd);
}
private void RemoveAllActiveSkills()
{
// Create a copy of keys to avoid modification during iteration
var keys = ActiveComponents.Keys.ToArray();
var skillNames = keys.Select(key => key.ToString()).ToList();
foreach (var skillName in skillNames)
{
RemoveSkill(skillName);
}
}
public void ApplyUnlockedSkills()
{
if (_player == null || !IsInstanceValid(_player)) return;
if (Store == null) return;
foreach (var sd in AvailableSkills)
{
if (Store.IsSkillUnlocked(sd))
CallDeferred(MethodName.AddSkill, sd);
else
RemoveSkill(sd.Name);
}
}
public SkillData GetSkillByName(string skillName)
{
foreach (var sd in AvailableSkills)
if (sd.Name == skillName) return sd;
return null;
}
public bool IsSkillActive(SkillData skill)
{
return skill != null && ActiveComponents.ContainsKey(skill.Name);
}
public void ActivateSkill(SkillData skill)
{
if (!ActiveComponents.ContainsKey(skill.Name))
{
AddSkill(skill);
}
}
public void DeactivateSkill(SkillData skill)
{
if (ActiveComponents.ContainsKey(skill.Name))
{
RemoveSkill(skill.Name);
}
}
public void ToggleSkillActivation(SkillData skill)
{
if (skill == null) return;
if (ActiveComponents.ContainsKey(skill.Name))
DeactivateSkill(skill);
else
ActivateSkill(skill);
}
}

View File

@@ -1 +0,0 @@
uid://dru77vj07e18s

View File

@@ -1,66 +0,0 @@
using System.Collections.Generic;
using Godot;
namespace Mr.BrickAdventures.Autoloads;
public partial class SpeedRunManager : Node
{
public static SpeedRunManager Instance { get; private set; }
public override void _EnterTree() => Instance = this;
public override void _ExitTree() { if (Instance == this) Instance = null; }
public bool IsRunning { get; private set; } = false;
private double _startTime;
private double _levelStartTime;
private List<double> _splits = [];
[Signal] public delegate void TimeUpdatedEventHandler(double totalTime, double levelTime);
public override void _Process(double delta)
{
if (!IsRunning) return;
EmitSignalTimeUpdated(GetCurrentTotalTime(), GetCurrentLevelTime());
}
public void StartTimer()
{
_startTime = Time.GetTicksMsec() / 1000.0;
_levelStartTime = _startTime;
_splits.Clear();
IsRunning = true;
GD.Print("Speedrun timer started.");
}
public void StopTimer()
{
if (!IsRunning) return;
IsRunning = false;
var finalTime = GetCurrentTotalTime();
GD.Print($"Speedrun finished. Final time: {FormatTime(finalTime)}");
// Save personal best if applicable
}
public void Split()
{
if (!IsRunning) return;
var now = Time.GetTicksMsec() / 1000.0;
var splitTime = now - _levelStartTime;
_splits.Add(splitTime);
_levelStartTime = now;
GD.Print($"Split recorded: {FormatTime(splitTime)}");
}
public double GetCurrentTotalTime() => IsRunning ? (Time.GetTicksMsec() / 1000.0) - _startTime : 0;
public double GetCurrentLevelTime() => IsRunning ? (Time.GetTicksMsec() / 1000.0) - _levelStartTime : 0;
public static string FormatTime(double time)
{
var span = System.TimeSpan.FromSeconds(time);
return $"{(int)span.TotalMinutes:00}:{span.Seconds:00}.{span.Milliseconds:000}";
}
}

View File

@@ -1 +0,0 @@
uid://c6ohe36xw1h21

View File

@@ -1,77 +0,0 @@
using System;
using Godot;
using Steamworks;
using Steamworks.Data;
namespace Mr.BrickAdventures.Autoloads;
public partial class SteamManager : Node
{
private const uint AppId = 3575090;
public static string PlayerName { get; private set; } = "Player";
public static bool IsSteamInitialized { get; private set; } = false;
public override void _Ready()
{
try
{
SteamClient.Init(AppId);
IsSteamInitialized = true;
PlayerName = SteamClient.Name;
GD.Print($"Steam initialized successfully for user: {PlayerName}");
}
catch (Exception e)
{
GD.PushError("Failed to initialize Steamworks. Is Steam running?");
GD.PushError(e.Message);
IsSteamInitialized = false;
}
}
public override void _Process(double delta)
{
if (IsSteamInitialized) SteamClient.RunCallbacks();
}
public override void _Notification(int what)
{
if (what == NotificationWMCloseRequest)
{
if (IsSteamInitialized)
{
SteamClient.Shutdown();
}
GetTree().Quit();
}
}
public static void UnlockAchievement(string achievementId)
{
if (!IsSteamInitialized)
{
GD.Print($"Steam not initialized. Cannot unlock achievement '{achievementId}'.");
return;
}
var ach = new Achievement(achievementId);
if (ach.State)
{
GD.Print($"Achievement '{achievementId}' is already unlocked.");
return;
}
if (ach.Trigger())
{
SteamUserStats.StoreStats();
GD.Print($"Successfully triggered achievement: {ach.Name} ({ach.Identifier})");
}
else
{
GD.PrintErr($"Failed to trigger achievement: {achievementId}");
}
}
}

View File

@@ -1 +0,0 @@
uid://b5abjlnbia63q

View File

@@ -1,22 +1,11 @@
using Godot;
using Godot.Collections;
namespace Mr.BrickAdventures.Autoloads;
public partial class UIManager : Node
{
public static UIManager Instance { get; private set; }
private readonly System.Collections.Generic.List<Control> UiStack = new();
public override void _Ready()
{
Instance = this;
}
public override void _ExitTree()
{
if (Instance == this) Instance = null;
}
[Export] public Array<Control> UiStack { get; set; } = new();
[Signal] public delegate void ScreenPushedEventHandler(Control screen);
[Signal] public delegate void ScreenPoppedEventHandler(Control screen);
@@ -45,19 +34,19 @@ public partial class UIManager : Node
return;
}
var top = UiStack[^1];
var top = (Control)UiStack[^1];
UiStack.RemoveAt(UiStack.Count - 1);
top.Hide();
top.SetProcessInput(false);
EmitSignalScreenPopped(top);
top.AcceptEvent();
if (UiStack.Count > 0) UiStack[^1].GrabFocus();
if (UiStack.Count > 0) ((Control)UiStack[^1]).GrabFocus();
}
public Control TopScreen() => UiStack.Count > 0 ? UiStack[^1] : null;
public Control TopScreen() => UiStack.Count > 0 ? (Control)UiStack[^1] : null;
public bool IsScreenOnTop(Control screen) => UiStack.Count > 0 && UiStack[^1] == screen;
public bool IsScreenOnTop(Control screen) => UiStack.Count > 0 && (Control)UiStack[^1] == screen;
public bool IsVisibleOnStack(Control screen) => UiStack.Contains(screen) && screen.Visible;

View File

@@ -1,12 +1,10 @@
<Project Sdk="Godot.NET.Sdk/4.6.2">
<Project Sdk="Godot.NET.Sdk/4.4.1">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace>Mr.BrickAdventures</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Facepunch.Steamworks" Version="2.3.3" />
<PackageReference Include="Facepunch.Steamworks.Dlls" Version="2.3.2" />
<PackageReference Include="Facepunch.Steamworks.Library" Version="2.3.3" />
<PackageReference Include="LimboConsole.Sharp" Version="0.0.1-beta-008" />
</ItemGroup>
</Project>

View File

@@ -1,17 +1,10 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArea2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F116d8c5f8dae51522ba398e1d89e3d4722f4af7b6e7f071196b928be44af7_003FArea2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACamera2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fa2e12a1a67ad701a97608de6be85250e3e353951ecf8058a02c703490c753_003FCamera2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACanvasItem_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fef7b819b226fab796d1dfe66d415dd7510bcac87675020ddb8f03a828e763_003FCanvasItem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACecovym_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003Ftmp_003FJetBrainsPerUserTemp_002D1000_002D1_003FSandboxFiles_003FSadijuw_003FCecovym_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterBody2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fbba0bbd7a98ee58286e9484fbe86e01afff6232283f6efd3556eb7116453_003FCharacterBody2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACollisionShape2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F2ca9b7334678f5c97c7c2a9fbe4837be71cae11b6a30408dd4791b18f997e4a_003FCollisionShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACSharpInstanceBridge_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F94701b444afa4c3d9a7a53ebcaa35fd1583c00_003F14_003F4b4ade3f_003FCSharpInstanceBridge_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADelegateUtils_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F94701b444afa4c3d9a7a53ebcaa35fd1583c00_003F08_003F45f75e10_003FDelegateUtils_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F94701b444afa4c3d9a7a53ebcaa35fd1583c00_003F47_003Fda1d8d31_003FDictionary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fe747192abb38e2df82cbdb37e721567726f559914a7b81f8b26ba537de632f4_003FList_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMr_002EBrickAdventures_002Escripts_002Ecomponents_002ECollectableComponent_005FScriptSignals_002Egenerated_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F80d9408eb7280c15eb4a12b61cdf8f7f1b0c5a2_003FMr_002EBrickAdventures_002Escripts_002Ecomponents_002ECollectableComponent_005FScriptSignals_002Egenerated_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F86db9cd834346aad02d74c1b66dd9c64d6ef3147435dd9c9c9477b48f7_003FNode2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APhysicsBody2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F4fcd28ddaffa68e6fe53288161b788dea7d402b4a41b9d9f0f0f2c52f9af075_003FPhysicsBody2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARectangleShape2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fa1cc98873548652da0c14ecefa4737431426fcbb24a7f0641e3d9c266c3_003FRectangleShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARigidBody2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F7bc3ccc1ac5bbc68933d64c7b7eb5ab4aecde2b73c686dd6495b68bdf08ba5b2_003FRigidBody2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AShape2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F3671dbbd9b17cdf2bf9075b468b6bd7e3ab13fc3be7a116484085d3b6cc9fe_003FShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

View File

@@ -1,13 +0,0 @@
[gd_resource type="Resource" script_class="AchievementResource" load_steps=3 format=3 uid="uid://3odfkm1ig5"]
[ext_resource type="Texture2D" uid="uid://cebeyr4wnibvk" path="res://sprites/achievement.png" id="1_usw25"]
[ext_resource type="Script" uid="uid://duib5phrmpro5" path="res://scripts/Resources/AchievementResource.cs" id="2_n7ktn"]
[resource]
script = ExtResource("2_n7ktn")
Id = "level_complete_1"
DisplayName = "Complete level 1"
Description = ""
Icon = ExtResource("1_usw25")
IsSecret = false
metadata/_custom_type_script = "uid://duib5phrmpro5"

View File

@@ -1,131 +0,0 @@
using System;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
public static class CaGenerator
{
public static bool[,] Generate(CaGeneratorSettings s)
{
var rng = new Random(s.Seed);
return s.Mode switch
{
CaMode.Cave => GenerateCave(s, rng),
CaMode.Platform => GeneratePlatform(s, rng),
CaMode.Terrain => GenerateTerrain(s, rng),
_ => GenerateCave(s, rng),
};
}
public static bool[,] Smooth(bool[,] grid) => SmoothPass(grid, 5);
// ── Cave ──────────────────────────────────────────────────────────────
private static bool[,] GenerateCave(CaGeneratorSettings s, Random rng)
{
var grid = RandomFill(s.Width, s.Height, s.FillDensity, rng);
if (s.BorderWalls) EnforceBorder(grid);
for (int i = 0; i < s.SmoothingPasses; i++)
{
grid = SmoothPass(grid, 5);
if (s.BorderWalls) EnforceBorder(grid);
}
return grid;
}
// ── Platform ──────────────────────────────────────────────────────────
private static bool[,] GeneratePlatform(CaGeneratorSettings s, Random rng)
{
int w = s.Width, h = s.Height;
var grid = new bool[w, h];
for (int x = 0; x < w; x++)
{
grid[x, h - 1] = true;
grid[x, h - 2] = true;
for (int y = 0; y < h - 2; y++)
{
// Density linearly increases from 10% at top to 60% at bottom,
// scaled by user's FillDensity relative to default 0.48.
float t = (float)y / (h - 3);
float rowDensity = (0.1f + t * 0.5f) * (s.FillDensity / 0.48f);
grid[x, y] = rng.NextDouble() < rowDensity;
}
}
for (int i = 0; i < s.SmoothingPasses; i++)
{
// Threshold 4 (not 5): horizontal platform groups survive, isolated
// vertical pixels collapse into flat platforms.
grid = SmoothPass(grid, 4);
for (int x = 0; x < w; x++) { grid[x, h - 1] = true; grid[x, h - 2] = true; }
}
return grid;
}
// ── Terrain ───────────────────────────────────────────────────────────
private static bool[,] GenerateTerrain(CaGeneratorSettings s, Random rng)
{
int w = s.Width, h = s.Height;
var grid = new bool[w, h];
// Start terrain surface at ~60% from bottom (40% from top)
int surfaceRow = (int)(h * 0.4f);
for (int x = 0; x < w; x++)
{
int delta = rng.Next(-2, 3);
surfaceRow = Math.Clamp(surfaceRow + delta, h / 6, h - 2);
for (int y = surfaceRow; y < h; y++)
grid[x, y] = true;
}
for (int i = 0; i < s.SmoothingPasses; i++)
grid = SmoothPass(grid, 5);
return grid;
}
// ── Shared helpers ────────────────────────────────────────────────
private static bool[,] RandomFill(int w, int h, float density, Random rng)
{
var grid = new bool[w, h];
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
grid[x, y] = rng.NextDouble() < density;
return grid;
}
private static bool[,] SmoothPass(bool[,] grid, int threshold)
{
int w = grid.GetLength(0), h = grid.GetLength(1);
var next = new bool[w, h];
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
next[x, y] = CountSolidNeighbors(grid, x, y) >= threshold;
return next;
}
private static int CountSolidNeighbors(bool[,] grid, int cx, int cy)
{
int w = grid.GetLength(0), h = grid.GetLength(1), count = 0;
for (int dx = -1; dx <= 1; dx++)
for (int dy = -1; dy <= 1; dy++)
{
if (dx == 0 && dy == 0) continue;
int nx = cx + dx, ny = cy + dy;
// Out-of-bounds counts as solid (closes cave edges naturally)
if (nx < 0 || nx >= w || ny < 0 || ny >= h) count++;
else if (grid[nx, ny]) count++;
}
return count;
}
private static void EnforceBorder(bool[,] grid)
{
int w = grid.GetLength(0), h = grid.GetLength(1);
for (int x = 0; x < w; x++) { grid[x, 0] = true; grid[x, h - 1] = true; }
for (int y = 0; y < h; y++) { grid[0, y] = true; grid[w - 1, y] = true; }
}
}

View File

@@ -1 +0,0 @@
uid://exr10b7nmkgn

View File

@@ -1,23 +0,0 @@
using Godot;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
public enum CaMode { Cave, Platform, Terrain }
public class CaGeneratorSettings
{
public CaMode Mode { get; set; } = CaMode.Cave;
public int Width { get; set; } = 40;
public int Height { get; set; } = 22;
public Vector2I Offset { get; set; } = Vector2I.Zero;
public float FillDensity { get; set; } = 0.48f;
public int SmoothingPasses { get; set; } = 4;
public bool BorderWalls { get; set; } = true;
public int Seed { get; set; } = 12345;
// TerrainSet == -1 → raw tile mode
public int TerrainSet { get; set; } = 0;
public int Terrain { get; set; } = 0;
// Used only when TerrainSet == -1
public int SourceId { get; set; } = 0;
public Vector2I AtlasCoords { get; set; } = Vector2I.Zero;
}

View File

@@ -1 +0,0 @@
uid://isnscgr1thvc

View File

@@ -1,79 +0,0 @@
#if TOOLS
using Godot;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
[Tool]
public partial class CaGeneratorTestRunner : Node
{
public override void _Ready()
{
int pass = 0, fail = 0;
void Assert(bool cond, string msg)
{
if (cond) { GD.Print($" PASS: {msg}"); pass++; }
else { GD.PrintErr($" FAIL: {msg}"); fail++; }
}
GD.Print("=== CaGenerator Tests ===");
// Grid dimensions
var s = new CaGeneratorSettings { Width = 20, Height = 15, SmoothingPasses = 0, Seed = 42 };
var g = CaGenerator.Generate(s);
Assert(g.GetLength(0) == 20, "Width == 20");
Assert(g.GetLength(1) == 15, "Height == 15");
// Determinism
var g2 = CaGenerator.Generate(s);
bool det = true;
for (int x = 0; x < 20 && det; x++)
for (int y = 0; y < 15 && det; y++)
if (g[x, y] != g2[x, y]) det = false;
Assert(det, "Same seed → same output");
// Different seeds → different output
var s2 = new CaGeneratorSettings { Width = 20, Height = 15, SmoothingPasses = 0, Seed = 99 };
var g3 = CaGenerator.Generate(s2);
bool diff = false;
for (int x = 0; x < 20 && !diff; x++)
for (int y = 0; y < 15 && !diff; y++)
if (g[x, y] != g3[x, y]) diff = true;
Assert(diff, "Different seeds → different output");
// Cave border walls
var sb = new CaGeneratorSettings { Width = 20, Height = 15, BorderWalls = true, SmoothingPasses = 0, Seed = 42 };
var gb = CaGenerator.Generate(sb);
bool border = true;
for (int x = 0; x < 20; x++) if (!gb[x, 0] || !gb[x, 14]) { border = false; break; }
for (int y = 0; y < 15; y++) if (!gb[0, y] || !gb[19, y]) { border = false; break; }
Assert(border, "Cave: border cells all solid");
// Platform floor
var sp = new CaGeneratorSettings { Mode = CaMode.Platform, Width = 20, Height = 15, SmoothingPasses = 0, Seed = 42 };
var gp = CaGenerator.Generate(sp);
bool floor = true;
for (int x = 0; x < 20; x++) if (!gp[x, 14] || !gp[x, 13]) { floor = false; break; }
Assert(floor, "Platform: bottom 2 rows solid");
// Platform: top row not all solid (mostly empty at top)
int topSolid = 0;
for (int x = 0; x < 20; x++) if (gp[x, 0]) topSolid++;
Assert(topSolid < 15, "Platform: top row mostly empty");
// Terrain: bottom always solid
var st = new CaGeneratorSettings { Mode = CaMode.Terrain, Width = 20, Height = 15, SmoothingPasses = 0, Seed = 42 };
var gt = CaGenerator.Generate(st);
bool terrBottom = true;
for (int x = 0; x < 20; x++) if (!gt[x, 14]) { terrBottom = false; break; }
Assert(terrBottom, "Terrain: bottom row always solid");
// Smooth: output same dimensions
var smoothed = CaGenerator.Smooth(g);
Assert(smoothed.GetLength(0) == 20, "Smooth: width preserved");
Assert(smoothed.GetLength(1) == 15, "Smooth: height preserved");
GD.Print($"=== Results: {pass} passed, {fail} failed ===");
}
}
#endif

View File

@@ -1 +0,0 @@
uid://6y4snwf31boh

View File

@@ -1,360 +0,0 @@
#if TOOLS
using Godot;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
[Tool]
public partial class CaLevelGeneratorDock : Control
{
public CaLevelGeneratorPlugin Plugin { get; set; }
// Controls referenced in Task 8 wiring
private OptionButton _layerDropdown;
private OptionButton _terrainDropdown;
private HBoxContainer _rawTileRow;
private SpinBox _sourceIdSpin;
private SpinBox _atlasXSpin;
private SpinBox _atlasYSpin;
private Button _caveBtn;
private Button _platformBtn;
private Button _terrainBtn;
private SpinBox _widthSpin;
private SpinBox _heightSpin;
private SpinBox _offsetXSpin;
private SpinBox _offsetYSpin;
private HSlider _densitySlider;
private Label _densityLabel;
private HSlider _smoothPassSlider;
private Label _smoothPassLabel;
private CheckBox _borderCheck;
private SpinBox _seedSpin;
private Button _genBtn;
private Button _smoothBtn;
private Button _clearBtn;
private CaMode _mode = CaMode.Cave;
private System.Collections.Generic.List<TileMapLayer> _layers = new();
private TileMapLayer _selectedLayer;
public override void _Ready()
{
CustomMinimumSize = new Vector2(200, 0);
var scroll = new ScrollContainer();
scroll.SetAnchorsAndOffsetsPreset(LayoutPreset.FullRect);
scroll.SizeFlagsVertical = SizeFlags.ExpandFill;
AddChild(scroll);
var vbox = new VBoxContainer();
vbox.SizeFlagsHorizontal = SizeFlags.ExpandFill;
scroll.AddChild(vbox);
// Target Layer
vbox.AddChild(new Label { Text = "Target Layer" });
_layerDropdown = new OptionButton();
_layerDropdown.SizeFlagsHorizontal = SizeFlags.ExpandFill;
vbox.AddChild(_layerDropdown);
// Terrain
vbox.AddChild(new Label { Text = "Terrain" });
_terrainDropdown = new OptionButton();
_terrainDropdown.SizeFlagsHorizontal = SizeFlags.ExpandFill;
vbox.AddChild(_terrainDropdown);
// Raw tile row (hidden when terrain is available)
_rawTileRow = new HBoxContainer();
_rawTileRow.Visible = false;
_rawTileRow.AddChild(new Label { Text = "Src" });
_sourceIdSpin = new SpinBox { MinValue = 0, MaxValue = 99, Value = 0 };
_rawTileRow.AddChild(_sourceIdSpin);
_rawTileRow.AddChild(new Label { Text = "X" });
_atlasXSpin = new SpinBox { MinValue = 0, MaxValue = 99, Value = 0 };
_rawTileRow.AddChild(_atlasXSpin);
_rawTileRow.AddChild(new Label { Text = "Y" });
_atlasYSpin = new SpinBox { MinValue = 0, MaxValue = 99, Value = 0 };
_rawTileRow.AddChild(_atlasYSpin);
vbox.AddChild(_rawTileRow);
// Mode toggle
vbox.AddChild(new Label { Text = "Mode" });
var modeRow = new HBoxContainer();
modeRow.SizeFlagsHorizontal = SizeFlags.ExpandFill;
_caveBtn = MakeModeButton("Cave", () => SetMode(CaMode.Cave));
_platformBtn = MakeModeButton("Platform", () => SetMode(CaMode.Platform));
_terrainBtn = MakeModeButton("Terrain", () => SetMode(CaMode.Terrain));
_caveBtn.ButtonPressed = true;
modeRow.AddChild(_caveBtn);
modeRow.AddChild(_platformBtn);
modeRow.AddChild(_terrainBtn);
vbox.AddChild(modeRow);
vbox.AddChild(new HSeparator());
// Width / Height
var dimRow = new HBoxContainer();
dimRow.AddChild(MakeSpinColumn("Width", out _widthSpin, 5, 500, 40));
dimRow.AddChild(MakeSpinColumn("Height", out _heightSpin, 5, 500, 22));
vbox.AddChild(dimRow);
// Offset X / Y
var offRow = new HBoxContainer();
offRow.AddChild(MakeSpinColumn("Offset X", out _offsetXSpin, -9999, 9999, 0));
offRow.AddChild(MakeSpinColumn("Offset Y", out _offsetYSpin, -9999, 9999, 0));
vbox.AddChild(offRow);
// Fill Density
var densHeader = new HBoxContainer();
densHeader.AddChild(new Label { Text = "Fill Density", SizeFlagsHorizontal = SizeFlags.ExpandFill });
_densityLabel = new Label { Text = "48%" };
densHeader.AddChild(_densityLabel);
vbox.AddChild(densHeader);
_densitySlider = new HSlider { MinValue = 0, MaxValue = 100, Value = 48, Step = 1 };
_densitySlider.ValueChanged += v => _densityLabel.Text = $"{(int)v}%";
vbox.AddChild(_densitySlider);
// Smoothing Passes
var smoothHeader = new HBoxContainer();
smoothHeader.AddChild(new Label { Text = "Smoothing Passes", SizeFlagsHorizontal = SizeFlags.ExpandFill });
_smoothPassLabel = new Label { Text = "4" };
smoothHeader.AddChild(_smoothPassLabel);
vbox.AddChild(smoothHeader);
_smoothPassSlider = new HSlider { MinValue = 0, MaxValue = 10, Value = 4, Step = 1 };
_smoothPassSlider.ValueChanged += v => _smoothPassLabel.Text = $"{(int)v}";
vbox.AddChild(_smoothPassSlider);
// Border walls
_borderCheck = new CheckBox { Text = "Solid border walls", ButtonPressed = true };
vbox.AddChild(_borderCheck);
// Seed
vbox.AddChild(new Label { Text = "Seed" });
var seedRow = new HBoxContainer();
_seedSpin = new SpinBox { MinValue = 0, MaxValue = int.MaxValue, Value = 12345,
AllowGreater = true, SizeFlagsHorizontal = SizeFlags.ExpandFill };
var randBtn = new Button { Text = "🎲" };
randBtn.Pressed += () => _seedSpin.Value = GD.Randi();
seedRow.AddChild(_seedSpin);
seedRow.AddChild(randBtn);
vbox.AddChild(seedRow);
vbox.AddChild(new HSeparator());
// Action buttons
_genBtn = new Button { Text = "▶ Generate", SizeFlagsHorizontal = SizeFlags.ExpandFill };
vbox.AddChild(_genBtn);
var actionRow = new HBoxContainer();
actionRow.SizeFlagsHorizontal = SizeFlags.ExpandFill;
_smoothBtn = new Button { Text = "✦ Smooth", SizeFlagsHorizontal = SizeFlags.ExpandFill };
_clearBtn = new Button { Text = "✕ Clear", SizeFlagsHorizontal = SizeFlags.ExpandFill };
actionRow.AddChild(_smoothBtn);
actionRow.AddChild(_clearBtn);
vbox.AddChild(actionRow);
_layerDropdown.ItemSelected += OnLayerSelected;
_terrainDropdown.ItemSelected += _ => SaveSettings();
_genBtn.Pressed += OnGenerate;
_smoothBtn.Pressed += OnSmooth;
_clearBtn.Pressed += OnClear;
LoadSettings();
}
public void OnSceneChanged(Node sceneRoot)
{
ScanLayers(sceneRoot);
RestoreLastLayer(sceneRoot?.SceneFilePath ?? "");
}
private void SetMode(CaMode mode)
{
_mode = mode;
_caveBtn.ButtonPressed = mode == CaMode.Cave;
_platformBtn.ButtonPressed = mode == CaMode.Platform;
_terrainBtn.ButtonPressed = mode == CaMode.Terrain;
}
private static Button MakeModeButton(string text, System.Action onPressed)
{
var btn = new Button { Text = text, ToggleMode = true,
SizeFlagsHorizontal = SizeFlags.ExpandFill };
btn.Pressed += onPressed;
return btn;
}
private static Control MakeSpinColumn(string label, out SpinBox spin,
double min, double max, double value)
{
var col = new VBoxContainer { SizeFlagsHorizontal = SizeFlags.ExpandFill };
col.AddChild(new Label { Text = label });
spin = new SpinBox { MinValue = min, MaxValue = max, Value = value,
SizeFlagsHorizontal = SizeFlags.ExpandFill };
col.AddChild(spin);
return col;
}
private void ScanLayers(Node root)
{
_layers.Clear();
_layerDropdown.Clear();
if (root == null) return;
CollectLayers(root);
foreach (var layer in _layers)
_layerDropdown.AddItem(layer.Name);
if (_layers.Count > 0) OnLayerSelected(0);
}
private void CollectLayers(Node node)
{
if (node is TileMapLayer layer) _layers.Add(layer);
foreach (Node child in node.GetChildren()) CollectLayers(child);
}
private void OnLayerSelected(long index)
{
if (index < 0 || index >= _layers.Count) return;
_selectedLayer = _layers[(int)index];
PopulateTerrainDropdown(_selectedLayer);
var sceneRoot = EditorInterface.Singleton.GetEditedSceneRoot();
if (sceneRoot != null)
{
var key = $"ca_generator/last_layer_{sceneRoot.SceneFilePath}";
EditorInterface.Singleton.GetEditorSettings()
.SetSetting(key, _selectedLayer.GetPath().ToString());
}
SaveSettings();
}
private void RestoreLastLayer(string sceneFilePath)
{
if (string.IsNullOrEmpty(sceneFilePath) || _layers.Count == 0) return;
var key = $"ca_generator/last_layer_{sceneFilePath}";
var es = EditorInterface.Singleton.GetEditorSettings();
if (!es.HasSetting(key)) return;
var path = es.GetSetting(key).AsString();
for (int i = 0; i < _layers.Count; i++)
{
if (_layers[i].GetPath().ToString() == path)
{
_layerDropdown.Select(i);
OnLayerSelected(i);
return;
}
}
}
private void PopulateTerrainDropdown(TileMapLayer layer)
{
_terrainDropdown.Clear();
var tileSet = layer.TileSet;
bool hasTerrains = false;
if (tileSet != null)
{
for (int ts = 0; ts < tileSet.GetTerrainSetsCount(); ts++)
{
for (int t = 0; t < tileSet.GetTerrainsCount(ts); t++)
{
_terrainDropdown.AddItem(tileSet.GetTerrainName(ts, t));
_terrainDropdown.SetItemMetadata(
_terrainDropdown.ItemCount - 1,
Variant.From((ts << 16) | t));
hasTerrains = true;
}
}
}
_terrainDropdown.Visible = hasTerrains;
_rawTileRow.Visible = !hasTerrains;
}
private CaGeneratorSettings BuildSettings()
{
int terrainSet = -1, terrain = 0;
if (_terrainDropdown.Visible && _terrainDropdown.ItemCount > 0)
{
int packed = _terrainDropdown.GetSelectedMetadata().AsInt32();
terrainSet = packed >> 16;
terrain = packed & 0xFFFF;
}
return new CaGeneratorSettings
{
Mode = _mode,
Width = (int)_widthSpin.Value,
Height = (int)_heightSpin.Value,
Offset = new Vector2I((int)_offsetXSpin.Value, (int)_offsetYSpin.Value),
FillDensity = (float)_densitySlider.Value / 100f,
SmoothingPasses = (int)_smoothPassSlider.Value,
BorderWalls = _borderCheck.ButtonPressed,
Seed = (int)_seedSpin.Value,
TerrainSet = terrainSet,
Terrain = terrain,
SourceId = (int)_sourceIdSpin.Value,
AtlasCoords = new Vector2I((int)_atlasXSpin.Value, (int)_atlasYSpin.Value),
};
}
private void OnGenerate()
{
if (_selectedLayer == null) return;
var settings = BuildSettings();
var grid = CaGenerator.Generate(settings);
TilemapPainter.Paint(_selectedLayer, grid, settings, Plugin.UndoRedo);
SaveSettings();
}
private void OnSmooth()
{
if (_selectedLayer == null) return;
TilemapPainter.Smooth(_selectedLayer, BuildSettings(), Plugin.UndoRedo);
}
private void OnClear()
{
if (_selectedLayer == null) return;
TilemapPainter.Clear(_selectedLayer, BuildSettings(), Plugin.UndoRedo);
}
private void SaveSettings()
{
var es = EditorInterface.Singleton.GetEditorSettings();
es.SetSetting("ca_generator/mode", (int)_mode);
es.SetSetting("ca_generator/width", (int)_widthSpin.Value);
es.SetSetting("ca_generator/height", (int)_heightSpin.Value);
es.SetSetting("ca_generator/offset_x", (int)_offsetXSpin.Value);
es.SetSetting("ca_generator/offset_y", (int)_offsetYSpin.Value);
es.SetSetting("ca_generator/fill_density", _densitySlider.Value);
es.SetSetting("ca_generator/smoothing_passes", (int)_smoothPassSlider.Value);
es.SetSetting("ca_generator/border_walls", _borderCheck.ButtonPressed);
es.SetSetting("ca_generator/seed", (int)_seedSpin.Value);
es.SetSetting("ca_generator/source_id", (int)_sourceIdSpin.Value);
es.SetSetting("ca_generator/atlas_x", (int)_atlasXSpin.Value);
es.SetSetting("ca_generator/atlas_y", (int)_atlasYSpin.Value);
}
private void LoadSettings()
{
var es = EditorInterface.Singleton.GetEditorSettings();
if (es == null) return;
SetMode((CaMode)(es.HasSetting("ca_generator/mode") ? es.GetSetting("ca_generator/mode").AsInt32() : 0));
_widthSpin.Value = es.HasSetting("ca_generator/width") ? es.GetSetting("ca_generator/width").AsDouble() : 40.0;
_heightSpin.Value = es.HasSetting("ca_generator/height") ? es.GetSetting("ca_generator/height").AsDouble() : 22.0;
_offsetXSpin.Value = es.HasSetting("ca_generator/offset_x") ? es.GetSetting("ca_generator/offset_x").AsDouble() : 0.0;
_offsetYSpin.Value = es.HasSetting("ca_generator/offset_y") ? es.GetSetting("ca_generator/offset_y").AsDouble() : 0.0;
_densitySlider.Value = es.HasSetting("ca_generator/fill_density") ? es.GetSetting("ca_generator/fill_density").AsDouble() : 48.0;
_smoothPassSlider.Value = es.HasSetting("ca_generator/smoothing_passes") ? es.GetSetting("ca_generator/smoothing_passes").AsDouble() : 4.0;
_borderCheck.ButtonPressed = es.HasSetting("ca_generator/border_walls") ? es.GetSetting("ca_generator/border_walls").AsBool() : true;
_seedSpin.Value = es.HasSetting("ca_generator/seed") ? es.GetSetting("ca_generator/seed").AsDouble() : 12345.0;
_sourceIdSpin.Value = es.HasSetting("ca_generator/source_id") ? es.GetSetting("ca_generator/source_id").AsDouble() : 0.0;
_atlasXSpin.Value = es.HasSetting("ca_generator/atlas_x") ? es.GetSetting("ca_generator/atlas_x").AsDouble() : 0.0;
_atlasYSpin.Value = es.HasSetting("ca_generator/atlas_y") ? es.GetSetting("ca_generator/atlas_y").AsDouble() : 0.0;
_densityLabel.Text = $"{(int)_densitySlider.Value}%";
_smoothPassLabel.Text = $"{(int)_smoothPassSlider.Value}";
}
}
#endif

View File

@@ -1 +0,0 @@
uid://dnuvfv3rgyywd

View File

@@ -1,37 +0,0 @@
#if TOOLS
using Godot;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
[Tool]
public partial class CaLevelGeneratorPlugin : EditorPlugin
{
private EditorDock _editorDock;
private CaLevelGeneratorDock _dock;
public override void _EnterTree()
{
_dock = new CaLevelGeneratorDock { Plugin = this };
_editorDock = new EditorDock { Title = "CA Level Generator" };
_editorDock.AddChild(_dock);
AddDock(_editorDock);
SceneChanged += OnSceneChanged;
}
public override void _ExitTree()
{
SceneChanged -= OnSceneChanged;
RemoveDock(_editorDock);
_editorDock.QueueFree();
_editorDock = null;
_dock = null;
}
private void OnSceneChanged(Node sceneRoot)
{
_dock?.OnSceneChanged(sceneRoot);
}
public EditorUndoRedoManager UndoRedo => GetUndoRedo();
}
#endif

View File

@@ -1 +0,0 @@
uid://cojnhxpcgepi2

View File

@@ -1,100 +0,0 @@
#if TOOLS
using Godot;
using Godot.Collections;
namespace Mr.BrickAdventures.Tools.CaLevelGenerator;
public static class TilemapPainter
{
public static void Paint(
TileMapLayer layer,
bool[,] grid,
CaGeneratorSettings settings,
EditorUndoRedoManager undoRedo)
{
var before = layer.TileMapData;
ApplyGrid(layer, grid, settings);
var after = layer.TileMapData;
RegisterUndo(layer, before, after, undoRedo, "CA Generate");
}
public static void Smooth(
TileMapLayer layer,
CaGeneratorSettings settings,
EditorUndoRedoManager undoRedo)
{
var grid = ReadGrid(layer, settings.Offset, new Vector2I(settings.Width, settings.Height));
grid = CaGenerator.Smooth(grid);
var before = layer.TileMapData;
ApplyGrid(layer, grid, settings);
var after = layer.TileMapData;
RegisterUndo(layer, before, after, undoRedo, "CA Smooth");
}
public static void Clear(
TileMapLayer layer,
CaGeneratorSettings settings,
EditorUndoRedoManager undoRedo)
{
var before = layer.TileMapData;
for (int x = 0; x < settings.Width; x++)
for (int y = 0; y < settings.Height; y++)
layer.EraseCell(settings.Offset + new Vector2I(x, y));
var after = layer.TileMapData;
RegisterUndo(layer, before, after, undoRedo, "CA Clear");
}
private static bool[,] ReadGrid(TileMapLayer layer, Vector2I offset, Vector2I size)
{
var grid = new bool[size.X, size.Y];
for (int x = 0; x < size.X; x++)
for (int y = 0; y < size.Y; y++)
grid[x, y] = layer.GetCellSourceId(offset + new Vector2I(x, y)) != -1;
return grid;
}
private static void ApplyGrid(TileMapLayer layer, bool[,] grid, CaGeneratorSettings settings)
{
int w = grid.GetLength(0), h = grid.GetLength(1);
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
layer.EraseCell(settings.Offset + new Vector2I(x, y));
if (settings.TerrainSet >= 0)
{
var solidCells = new Array<Vector2I>();
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
if (grid[x, y])
solidCells.Add(settings.Offset + new Vector2I(x, y));
if (solidCells.Count > 0)
layer.SetCellsTerrainConnect(solidCells, settings.TerrainSet, settings.Terrain);
}
else
{
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
if (grid[x, y])
layer.SetCell(
settings.Offset + new Vector2I(x, y),
settings.SourceId,
settings.AtlasCoords);
}
}
private static void RegisterUndo(
TileMapLayer layer,
byte[] before,
byte[] after,
EditorUndoRedoManager undoRedo,
string actionName)
{
undoRedo.CreateAction(actionName);
undoRedo.AddUndoProperty(layer, "tile_map_data", before);
undoRedo.AddDoProperty(layer, "tile_map_data", after);
undoRedo.CommitAction(false);
}
}
#endif

View File

@@ -1 +0,0 @@
uid://y55l4iw35tih

View File

@@ -1,6 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://test_ca_generator"]
[ext_resource type="Script" path="res://addons/ca_level_generator/CaGeneratorTestRunner.cs" id="1_catest"]
[node name="CaGeneratorTestRunner" type="Node"]
script = ExtResource("1_catest")

View File

@@ -1,6 +0,0 @@
[plugin]
name="CA Level Generator"
description="Cellular automata level blockout generator"
author="Gabriel Kaszewski"
version="1.0"
script="CaLevelGeneratorPlugin.cs"

View File

@@ -0,0 +1,22 @@
[configuration]
entry_symbol = "godotsteam_init"
compatibility_minimum = "4.4"
[libraries]
macos.debug = "res://addons/godotsteam/osx/libgodotsteam.macos.template_debug.framework"
macos.release = "res://addons/godotsteam/osx/libgodotsteam.macos.template_release.framework"
windows.debug.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_debug.x86_64.dll"
windows.debug.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_debug.x86_32.dll"
windows.release.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_release.x86_64.dll"
windows.release.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_release.x86_32.dll"
linux.debug.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_debug.x86_64.so"
linux.debug.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_debug.x86_32.so"
linux.release.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_release.x86_64.so"
linux.release.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_release.x86_32.so"
[dependencies]
macos.universal = { "res://addons/godotsteam/osx/libsteam_api.dylib": "" }
windows.x86_64 = { "res://addons/godotsteam/win64/steam_api64.dll": "" }
windows.x86_32 = { "res://addons/godotsteam/win32/steam_api.dll": "" }
linux.x86_64 = { "res://addons/godotsteam/linux64/libsteam_api.so": "" }
linux.x86_32 = { "res://addons/godotsteam/linux32/libsteam_api.so": "" }

View File

@@ -0,0 +1 @@
uid://cbt61wgh4qe5l

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>libgodotsteam.debug</string>
<key>CFBundleIdentifier</key>
<string>org.godotsteam.godotsteam</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgodotsteam.debug</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.15</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>4.15</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>libgodotsteam</string>
<key>CFBundleIdentifier</key>
<string>org.godotsteam.godotsteam</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgodotsteam</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.15</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>4.15</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,10 +6,11 @@ runnable=true
advanced_options=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
export_filter="scenes"
export_files=PackedStringArray("res://scenes/test.tscn", "res://objects/game_manager.tscn")
include_filter=""
exclude_filter=""
export_path="builds/windows/Mr. Brick Adventures.exe"
export_path="builds/optimized_for_size/Mr. Brick Adventures.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
@@ -21,7 +22,7 @@ script_export_mode=2
[preset.0.options]
custom_template/debug=""
custom_template/release=""
custom_template/release="D:/Dev/godot/bin/godot.windows.template_release.x86_64.exe"
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/s3tc_bptc=true
@@ -64,9 +65,6 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
[preset.1]
@@ -111,9 +109,6 @@ progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
[preset.2]
@@ -156,6 +151,3 @@ unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false

View File

@@ -1,8 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://bjdhgdolcxxbq"]
[ext_resource type="Script" uid="uid://c4vvuqnx5y33u" path="res://Autoloads/AchievementManager.cs" id="1_lomle"]
[ext_resource type="PackedScene" uid="uid://tgaadui3lvdc" path="res://objects/ui/achievement_popup.tscn" id="2_k3wdv"]
[node name="AchievementManager" type="Node"]
script = ExtResource("1_lomle")
AchievementPopupScene = ExtResource("2_k3wdv")

View File

@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://rnpsa2u74nio"]
[ext_resource type="Script" uid="uid://deguukal87gcb" path="res://scripts/achievements.gd" id="1_1itsx"]
[node name="Achievements" type="Node"]
script = ExtResource("1_1itsx")

View File

@@ -1,179 +0,0 @@
[gd_scene load_steps=26 format=3 uid="uid://bockkmyn8il4c"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_hh6y0"]
[ext_resource type="Texture2D" uid="uid://duxx56wxmjoxd" path="res://sprites/basic_enemy.png" id="2_laaj3"]
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="3_n6phc"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="4_t0yic"]
[ext_resource type="Script" uid="uid://d2hrr8fruho1d" path="res://scripts/components/SideToSideMovementComponent.cs" id="5_h333r"]
[ext_resource type="Script" uid="uid://cfdugoeduudar" path="res://scripts/components/EnemyDeathComponent.cs" id="8_dbywb"]
[ext_resource type="Script" uid="uid://dvyd26ricriql" path="res://scripts/components/FlashingComponent.cs" id="9_bph85"]
[ext_resource type="Script" uid="uid://bo506l4x0808e" path="res://scripts/components/HitComponent.cs" id="10_4upf6"]
[ext_resource type="Script" uid="uid://t8rsvwdwt8ea" path="res://scripts/components/StatusEffectComponent.cs" id="11_28moq"]
[ext_resource type="Script" uid="uid://cxuig4xh8nfov" path="res://scripts/components/FireEffectComponent.cs" id="12_dgcex"]
[ext_resource type="Script" uid="uid://d1388lhp2gpgr" path="res://scripts/components/IceEffectComponent.cs" id="13_kga14"]
[ext_resource type="AudioStream" uid="uid://b3tsqhr06pbrs" path="res://sfx/enemy_hurt.wav" id="14_ndloc"]
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="15_cg63s"]
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fxs/fire_fx.tscn" id="16_jqaq6"]
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="17_ih01d"]
[ext_resource type="PackedScene" uid="uid://ck6nml06tm6ue" path="res://objects/fxs/ice_fx.tscn" id="17_o7qsb"]
[ext_resource type="PackedScene" uid="uid://b12tppjkkqpt4" path="res://objects/fxs/hit_particles.tscn" id="18_v861c"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(25, 31)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_j18j0"]
shader = ExtResource("1_hh6y0")
shader_parameter/enabled = false
shader_parameter/tint = Color(1, 1, 1, 1)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ejbqt"]
size = Vector2(34, 31)
[sub_resource type="Gradient" id="Gradient_qb72p"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_lvsna"]
gradient = SubResource("Gradient_qb72p")
[sub_resource type="Curve" id="Curve_82d6e"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_pxaaa"]
curve = SubResource("Curve_82d6e")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pxaaa"]
resource_local_to_scene = true
lifetime_randomness = 1.0
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 8.0
direction = Vector3(0.1, -0.5, 0)
initial_velocity_min = 200.0
initial_velocity_max = 400.0
gravity = Vector3(0, 80, 0)
damping_min = 400.0
damping_max = 800.0
scale_max = 3.0
scale_curve = SubResource("CurveTexture_pxaaa")
color = Color(0.635294, 1, 0.952941, 1)
color_ramp = SubResource("GradientTexture1D_lvsna")
[node name="Enemy" type="CharacterBody2D"]
collision_layer = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2(-1.5, 0.5)
shape = SubResource("RectangleShape2D_pwwji")
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_j18j0")
texture = ExtResource("2_laaj3")
[node name="right bullet spawn" type="Node2D" parent="Sprite2D"]
position = Vector2(16, 7)
[node name="left bullet spawn" type="Node2D" parent="Sprite2D"]
position = Vector2(-17, 7)
[node name="HealthComponent" type="Node2D" parent="." node_paths=PackedStringArray("HurtSfx")]
script = ExtResource("3_n6phc")
HurtSfx = NodePath("../sfx_hurt")
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area")]
script = ExtResource("4_t0yic")
Area = NodePath("../Hitbox")
[node name="SideToSideMovement" type="Node" parent="." node_paths=PackedStringArray("Sprite", "LeftRay", "RightRay", "LeftWallRay", "RightWallRay")]
script = ExtResource("5_h333r")
Sprite = NodePath("../Sprite2D")
Speed = 60.0
WaitTime = 0.5
LeftRay = NodePath("../Left Ray")
RightRay = NodePath("../Right Ray")
LeftWallRay = NodePath("../Left Wall Ray")
RightWallRay = NodePath("../Right Wall Ray")
[node name="EnemyDeathComponent" type="Node" parent="." node_paths=PackedStringArray("CollisionShape", "Health")]
script = ExtResource("8_dbywb")
TweenDuration = 0.1
CollisionShape = NodePath("../Hitbox/CollisionShape2D")
Health = NodePath("../HealthComponent")
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 8
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
visible = false
position = Vector2(-2, 0.5)
shape = SubResource("RectangleShape2D_ejbqt")
debug_color = Color(0.913521, 0.265052, 0.323172, 0.42)
[node name="Left Ray" type="RayCast2D" parent="."]
position = Vector2(-16, 13)
target_position = Vector2(0, 8)
[node name="Left Wall Ray" type="RayCast2D" parent="."]
position = Vector2(-16, 0)
target_position = Vector2(-8, 0)
[node name="Right Ray" type="RayCast2D" parent="."]
position = Vector2(16, 13)
target_position = Vector2(0, 8)
[node name="Right Wall Ray" type="RayCast2D" parent="."]
position = Vector2(16, 0)
target_position = Vector2(8, 0)
[node name="FlashingComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "HealthComponent")]
process_mode = 3
script = ExtResource("9_bph85")
Sprite = NodePath("../Sprite2D")
HealthComponent = NodePath("../HealthComponent")
[node name="HitComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Health", "HitFx")]
script = ExtResource("10_4upf6")
Sprite = NodePath("../Sprite2D")
Health = NodePath("../HealthComponent")
HitFx = NodePath("../HitParticles")
[node name="StatusEffectComponent" type="Node" parent="."]
script = ExtResource("11_28moq")
[node name="FireEffectComponent" type="Node" parent="." node_paths=PackedStringArray("Health", "StatusEffectComponent", "FireFX")]
script = ExtResource("12_dgcex")
Health = NodePath("../HealthComponent")
StatusEffectComponent = NodePath("../StatusEffectComponent")
FireFX = NodePath("../FireFX")
[node name="IceEffectComponent" type="Node" parent="." node_paths=PackedStringArray("ComponentsToDisable", "StatusEffectComponent", "IceFx")]
script = ExtResource("13_kga14")
ComponentsToDisable = [NodePath("../SideToSideMovement"), null, NodePath("../DamageComponent")]
StatusEffectComponent = NodePath("../StatusEffectComponent")
IceFx = NodePath("../Ice FX")
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("14_ndloc")
bus = &"sfx"
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("15_cg63s")
bus = &"sfx"
[node name="FireFX" parent="." instance=ExtResource("16_jqaq6")]
position = Vector2(0, 9)
emitting = false
amount = 2048
[node name="Ice FX" parent="." instance=ExtResource("17_o7qsb")]
visible = false
[node name="HitParticles" parent="." instance=ExtResource("18_v861c")]
position = Vector2(0, 1)
process_material = SubResource("ParticleProcessMaterial_pxaaa")
[node name="KnockbackComponent" type="Node" parent="."]
script = ExtResource("17_ih01d")
metadata/_custom_type_script = "uid://cgfynrn68lp12"

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://bargnp4twtmxg"]
[gd_scene load_steps=7 format=3 uid="uid://bargnp4twtmxg"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_aya2w"]
[ext_resource type="Script" uid="uid://r4jybneigfcn" path="res://scripts/components/CollectableComponent.cs" id="2_htmrw"]
@@ -9,33 +9,33 @@
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
[node name="Big Coin" type="Area2D" unique_id=354254828 groups=["coins"]]
[node name="Big Coin" type="Area2D" groups=["coins"]]
scale = Vector2(2, 2)
collision_layer = 2
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2066526597]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_3ask2")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1626463721]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_aya2w")
hframes = 12
vframes = 12
frame = 51
[node name="CollectableComponent" type="Node" parent="." unique_id=1124310030 node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
script = ExtResource("2_htmrw")
Area2D = NodePath("..")
CollisionShape = NodePath("../CollisionShape2D")
Data = ExtResource("3_lk3av")
Sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." unique_id=222617739 node_paths=PackedStringArray("Sprite", "Area")]
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Area")]
script = ExtResource("4_62p7g")
Sprite = NodePath("../Sprite2D")
Area = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="." unique_id=1978747299]
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_dbffd")
volume_db = -5.0
bus = &"sfx"

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://d08dfqmirnd66"]
[gd_scene load_steps=7 format=3 uid="uid://d08dfqmirnd66"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_1co1x"]
[ext_resource type="Script" uid="uid://r4jybneigfcn" path="res://scripts/components/CollectableComponent.cs" id="2_lthbn"]
@@ -9,32 +9,32 @@
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
[node name="Big Treasure" type="Area2D" unique_id=1021217632 groups=["coins"]]
[node name="Big Treasure" type="Area2D" groups=["coins"]]
collision_layer = 2
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=458290011]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_3ask2")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=564060301]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_1co1x")
hframes = 12
vframes = 12
frame = 64
[node name="CollectableComponent" type="Node" parent="." unique_id=2009195182 node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
script = ExtResource("2_lthbn")
Area2D = NodePath("..")
CollisionShape = NodePath("../CollisionShape2D")
Data = ExtResource("3_k64cr")
Sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." unique_id=1809580000 node_paths=PackedStringArray("Sprite", "Area")]
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Area")]
script = ExtResource("4_qwwsj")
Sprite = NodePath("../Sprite2D")
FadeDuration = 0.4
Area = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="." unique_id=466669009]
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_fxf8v")
bus = &"sfx"

View File

@@ -1,31 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://c0j1yun5s7kns"]
[ext_resource type="Texture2D" uid="uid://bu0yv6rktj221" path="res://sprites/bouncing_mushroom.png" id="1_t1exj"]
[ext_resource type="Script" uid="uid://bgbnof7aeydmq" path="res://scripts/components/JumpPadComponent.cs" id="2_w2gbr"]
[ext_resource type="PackedScene" uid="uid://qo2ngbnkix85" path="res://objects/fxs/bounce_gfx.tscn" id="3_w2gbr"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ci3ij"]
size = Vector2(22, 10)
[node name="Bouncing Mushrrom" type="Area2D"]
modulate = Color(1.1, 1.1, 1.1, 1)
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -13)
shape = SubResource("RectangleShape2D_ci3ij")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -8)
texture = ExtResource("1_t1exj")
hframes = 2
[node name="JumpPadComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "Sprite", "Particles")]
script = ExtResource("2_w2gbr")
JumpForce = 600.0
Area = NodePath("..")
Sprite = NodePath("../Sprite2D")
Particles = NodePath("../BounceGFX")
[node name="BounceGFX" parent="." instance=ExtResource("3_w2gbr")]

View File

@@ -1,22 +1,32 @@
[gd_scene format=3 uid="uid://bqi5s710xb1ju"]
[gd_scene load_steps=48 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" uid="uid://csel4s0e4g5uf" path="res://scripts/components/PlayerController.cs" id="1_yysbb"]
[ext_resource type="Resource" uid="uid://vgutbpovj8hc" path="res://resources/movement_presets/platform_movement.tres" id="2_7til7"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="2_lgb3u"]
[ext_resource type="Script" uid="uid://btlm1f3l70il" path="res://scripts/components/PlatformMovementComponent.cs" id="2_o1ihh"]
[ext_resource type="Texture2D" uid="uid://jl1gwqchhpdc" path="res://sprites/left_eye.png" id="3_2srrh"]
[ext_resource type="Script" uid="uid://cty54itmnudfm" path="res://scripts/components/ShipMovementComponent.cs" id="3_ur2y5"]
[ext_resource type="Texture2D" uid="uid://iiawtnwmeny3" path="res://sprites/right_eye.png" id="4_ccn81"]
[ext_resource type="Texture2D" uid="uid://0l454rfplmqg" path="res://sprites/MrBrick_base-sheet.png" id="5_yysbb"]
[ext_resource type="Texture2D" uid="uid://dhkwyv6ayb5qb" path="res://sprites/flying_ship.png" id="8_6lsog"]
[ext_resource type="Script" uid="uid://dy78ak8eykw6e" path="res://scripts/components/FlipComponent.cs" id="9_yysbb"]
[ext_resource type="Script" uid="uid://mnjg3p0aw1ow" path="res://scripts/components/CanPickUpComponent.cs" id="10_yysbb"]
[ext_resource type="Script" uid="uid://ccqb8kd5m0eh7" path="res://scripts/components/ScoreComponent.cs" id="11_o1ihh"]
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="12_ur2y5"]
[ext_resource type="Script" uid="uid://byw1legrv1ep2" path="res://scripts/components/PlayerDeathComponent.cs" id="13_7til7"]
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="14_e5pae"]
[ext_resource type="Script" uid="uid://cecelixl41t3j" path="res://scripts/components/InvulnerabilityComponent.cs" id="15_xuhvf"]
[ext_resource type="Script" uid="uid://dvyd26ricriql" path="res://scripts/components/FlashingComponent.cs" id="16_uno3u"]
[ext_resource type="Script" uid="uid://dtg6115je7b5s" path="res://scripts/components/StompDamageComponent.cs" id="17_bl1gx"]
[ext_resource type="Script" uid="uid://di572axt0c3s8" path="res://scripts/SkillManager.cs" id="18_6lsog"]
[ext_resource type="AudioStream" uid="uid://duj2q0rqytaxg" path="res://sfx/jump.wav" id="18_pysae"]
[ext_resource type="AudioStream" uid="uid://bmfn6p88gy575" path="res://sfx/player_hurt.wav" id="19_7anly"]
[ext_resource type="Script" uid="uid://d4crrfmbgxnqf" path="res://scripts/Resources/SkillData.cs" id="19_yysbb"]
[ext_resource type="AudioStream" uid="uid://ycgtf6wj7mto" path="res://sfx/heal.wav" id="20_bptj5"]
[ext_resource type="Resource" uid="uid://dw5ee2lpeypnb" path="res://resources/skills/brick_throw.tres" id="20_o1ihh"]
[ext_resource type="Resource" uid="uid://cdp8sex36vdq2" path="res://resources/skills/explosive_brick.tres" id="21_ur2y5"]
[ext_resource type="Resource" uid="uid://cr5lo4h8wm0jc" path="res://resources/skills/fire_brick.tres" id="22_7til7"]
[ext_resource type="Resource" uid="uid://ceakv6oqob6m7" path="res://resources/skills/ice_brick.tres" id="23_e5pae"]
[ext_resource type="Resource" uid="uid://d3bjre2etov1n" path="res://resources/skills/magnetic.tres" id="24_xuhvf"]
[ext_resource type="Script" uid="uid://dlh5xcv2sy82s" path="res://scripts/components/SkillUnlockerComponent.cs" id="25_yysbb"]
[ext_resource type="Script" uid="uid://bo506l4x0808e" path="res://scripts/components/HitComponent.cs" id="26_6n1ss"]
[ext_resource type="Script" uid="uid://cjcc7fia15wu3" path="res://scripts/components/CanBeLaunchedComponent.cs" id="27_oefns"]
@@ -26,17 +36,8 @@
[ext_resource type="Script" uid="uid://dr3uv0j7n75s" path="res://scripts/components/ShipShooterComponent.cs" id="30_usc1p"]
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="32_x2b7c"]
[ext_resource type="PackedScene" uid="uid://dtem8jgcyoqar" path="res://objects/entities/green_laser.tscn" id="36_oxudy"]
[ext_resource type="Script" uid="uid://dupnaark1f7gm" path="res://scripts/components/ProgressiveDamageComponent.cs" id="38_dhjci"]
[ext_resource type="Script" uid="uid://dssa2taiwktis" path="res://scripts/components/Movement/PlayerInputHandler.cs" id="42_e5pae"]
[ext_resource type="Script" uid="uid://c00siqtssccr6" path="res://scripts/components/PacXonGridInteractor.cs" id="42_xuhvf"]
[ext_resource type="Script" uid="uid://ceoxet1nqws8w" path="res://scripts/components/SpriteTilterComponent.cs" id="43_xuhvf"]
[ext_resource type="Script" uid="uid://cmk4m7mplqnrm" path="res://scripts/components/PacXonTrailComponent.cs" id="44_uno3u"]
[ext_resource type="PackedScene" uid="uid://de5emerpbiknb" path="res://objects/fxs/foot_step_gfx.tscn" id="45_bl1gx"]
[ext_resource type="Script" uid="uid://d3ksrjt1ek4gi" path="res://scripts/components/FootstepGfx.cs" id="46_6n1ss"]
[ext_resource type="Script" uid="uid://bpopfy6m4a0br" path="res://scripts/components/JumpGfxComponent.cs" id="47_oefns"]
[ext_resource type="PackedScene" uid="uid://bqhondao5bm6k" path="res://objects/fxs/jump_cloud_fx.tscn" id="48_bnap0"]
[ext_resource type="Script" uid="uid://b1h8r5irryxcx" path="res://scripts/components/PlayerSfxComponent.cs" id="49_qec3q"]
[ext_resource type="Script" uid="uid://b2aanqykvdnev" path="res://scripts/components/PlayerGraphicsComponent.cs" id="50_dhjci"]
[ext_resource type="Script" uid="uid://diw6opv6yutgi" path="res://scripts/components/KillPlayerOutOfScreenComponent.cs" id="37_qec3q"]
[ext_resource type="Script" uid="uid://3qy7rm28q66a" path="res://scripts/components/ProgressiveDamageComponent.cs" id="38_dhjci"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xoue7"]
shader = ExtResource("2_lgb3u")
@@ -65,7 +66,7 @@ point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_xoue7"]
curve = SubResource("Curve_82d6e")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_oxudy"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_lgb3u"]
resource_local_to_scene = true
lifetime_randomness = 1.0
particle_flag_disable_z = true
@@ -82,214 +83,202 @@ scale_curve = SubResource("CurveTexture_xoue7")
color = Color(0.764706, 0.443137, 0, 1)
color_ramp = SubResource("GradientTexture1D_lgb3u")
[node name="Brick Player" type="CharacterBody2D" unique_id=634211282 node_paths=PackedStringArray("MovementAbilitiesContainer") groups=["player"]]
[node name="Brick Player" type="CharacterBody2D" node_paths=PackedStringArray("ShipSprite") groups=["player"]]
collision_layer = 4
collision_mask = 107
collision_mask = 43
script = ExtResource("1_yysbb")
MovementAbilitiesContainer = NodePath("Movements")
DefaultPreset = ExtResource("2_7til7")
metadata/_custom_type_script = "uid://csel4s0e4g5uf"
MovementTypes = Dictionary[String, NodePath]({
"platform": NodePath("Movements/PlatformMovement"),
"ship": NodePath("Movements/ShipMovement")
})
ShipSprite = NodePath("Graphics/Ship")
[node name="Movements" type="Node" parent="." unique_id=1545001]
[node name="Movements" type="Node" parent="."]
[node name="Graphics" type="Node2D" parent="." unique_id=271317654]
[node name="PlatformMovement" type="Node2D" parent="Movements" node_paths=PackedStringArray("JumpSfx", "RotationTarget", "Body")]
script = ExtResource("2_o1ihh")
JumpSfx = NodePath("../../sfx_jump")
RotationTarget = NodePath("../../Graphics/Root/Base")
Body = NodePath("../..")
[node name="Root" type="Node2D" parent="Graphics" unique_id=2012260442]
[node name="ShipMovement" type="Node2D" parent="Movements" node_paths=PackedStringArray("Body")]
script = ExtResource("3_ur2y5")
MaxSpeed = 360.0
Acceleration = 1200.0
Friction = 800.0
Body = NodePath("../..")
[node name="Base" type="Sprite2D" parent="Graphics/Root" unique_id=1178176210]
[node name="Graphics" type="Node2D" parent="."]
[node name="Root" type="Node2D" parent="Graphics"]
[node name="Base" type="Sprite2D" parent="Graphics/Root"]
material = SubResource("ShaderMaterial_xoue7")
texture = ExtResource("5_yysbb")
hframes = 5
[node name="Left Eye" type="Sprite2D" parent="Graphics/Root" unique_id=653633051]
[node name="Left Eye" type="Sprite2D" parent="Graphics/Root"]
position = Vector2(-7, -6)
texture = ExtResource("3_2srrh")
hframes = 2
[node name="Right Eye" type="Sprite2D" parent="Graphics/Root" unique_id=721230787]
[node name="Right Eye" type="Sprite2D" parent="Graphics/Root"]
position = Vector2(6, -5)
texture = ExtResource("4_ccn81")
hframes = 2
[node name="Ship" type="Sprite2D" parent="Graphics" unique_id=1074443059]
[node name="Ship" type="Sprite2D" parent="Graphics"]
visible = false
position = Vector2(1, 7)
texture = ExtResource("8_6lsog")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=22428429]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_hdsg1")
[node name="FlipPlayerComponent" type="Node2D" parent="." unique_id=290535881 node_paths=PackedStringArray("LeftEye", "RightEye", "PlayerController")]
[node name="FlipPlayerComponent" type="Node2D" parent="." node_paths=PackedStringArray("LeftEye", "RightEye", "PlatformMovement")]
script = ExtResource("9_yysbb")
LeftEye = NodePath("../Graphics/Root/Left Eye")
RightEye = NodePath("../Graphics/Root/Right Eye")
PlayerController = NodePath("..")
PlatformMovement = NodePath("../Movements/PlatformMovement")
[node name="StompDamageArea" type="Area2D" parent="." unique_id=2071262827]
[node name="StompDamageArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDamageArea" unique_id=1230518642]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDamageArea"]
visible = false
position = Vector2(0, 1)
shape = SubResource("RectangleShape2D_vad0t")
[node name="CanPickUpComponent" type="Node" parent="." unique_id=1912343790]
[node name="CanPickUpComponent" type="Node" parent="."]
script = ExtResource("10_yysbb")
[node name="HealthComponent" type="Node2D" parent="." unique_id=278902432 node_paths=PackedStringArray("HurtSfx", "HealSfx")]
[node name="ScoreComponent" type="Node" parent="."]
script = ExtResource("11_o1ihh")
[node name="HealthComponent" type="Node2D" parent="." node_paths=PackedStringArray("HurtSfx", "HealSfx")]
script = ExtResource("12_ur2y5")
HurtSfx = NodePath("../sfx_hurt")
HealSfx = NodePath("../sfx_heal")
[node name="PlayerDeathComponent" type="Node2D" parent="." unique_id=1989490803 node_paths=PackedStringArray("DeathSfx", "HealthComponent")]
[node name="PlayerDeathComponent" type="Node2D" parent="." node_paths=PackedStringArray("DeathSfx", "HealthComponent")]
process_mode = 3
script = ExtResource("13_7til7")
DeathSfx = NodePath("../sfx_hurt")
HealthComponent = NodePath("../HealthComponent")
[node name="InvulnerabilityComponent" type="Node" parent="." unique_id=963173254 node_paths=PackedStringArray("FlashingComponent")]
[node name="KnockbackComponent" type="Node" parent="." node_paths=PackedStringArray("Body", "HealthComponent")]
script = ExtResource("14_e5pae")
Body = NodePath("..")
KnockbackForce = 1250.0
HealthComponent = NodePath("../HealthComponent")
[node name="InvulnerabilityComponent" type="Node" parent="." node_paths=PackedStringArray("FlashingComponent")]
script = ExtResource("15_xuhvf")
FlashingComponent = NodePath("../FlashingComponent Base")
[node name="FlashingComponent Base" type="Node" parent="." unique_id=533766453 node_paths=PackedStringArray("Sprite", "HealthComponent")]
[node name="FlashingComponent Base" type="Node" parent="." node_paths=PackedStringArray("Sprite", "HealthComponent")]
script = ExtResource("16_uno3u")
Sprite = NodePath("../Graphics/Root/Base")
FlashDuration = 1.0
HealthComponent = NodePath("../HealthComponent")
[node name="FlashingComponent LEye" type="Node" parent="." unique_id=835038717 node_paths=PackedStringArray("Sprite", "HealthComponent")]
[node name="FlashingComponent LEye" type="Node" parent="." node_paths=PackedStringArray("Sprite", "HealthComponent")]
script = ExtResource("16_uno3u")
Sprite = NodePath("../Graphics/Root/Left Eye")
FlashDuration = 1.0
HealthComponent = NodePath("../HealthComponent")
[node name="FlashingComponent REye" type="Node" parent="." unique_id=601265429 node_paths=PackedStringArray("Sprite", "HealthComponent")]
[node name="FlashingComponent REye" type="Node" parent="." node_paths=PackedStringArray("Sprite", "HealthComponent")]
script = ExtResource("16_uno3u")
Sprite = NodePath("../Graphics/Root/Right Eye")
FlashDuration = 1.0
HealthComponent = NodePath("../HealthComponent")
[node name="StompDamageComponent" type="Node" parent="." unique_id=1027107459 node_paths=PackedStringArray("Area", "Root")]
[node name="StompDamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "Root")]
script = ExtResource("17_bl1gx")
Damage = 4.0
Area = NodePath("../StompDamageArea")
Root = NodePath("..")
[node name="SkillUnlockerComponent" type="Node" parent="." unique_id=496647555]
script = ExtResource("25_yysbb")
[node name="SkillManager" type="Node" parent="."]
script = ExtResource("18_6lsog")
AvailableSkills = Array[ExtResource("19_yysbb")]([ExtResource("20_o1ihh"), ExtResource("21_ur2y5"), ExtResource("22_7til7"), ExtResource("23_e5pae"), ExtResource("24_xuhvf")])
[node name="HitComponent" type="Node" parent="." unique_id=131916578 node_paths=PackedStringArray("Sprite", "Health", "HitFx")]
[node name="SkillUnlockerComponent" type="Node" parent="." node_paths=PackedStringArray("SkillManager")]
script = ExtResource("25_yysbb")
SkillManager = NodePath("../SkillManager")
[node name="HitComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Health", "HitFx")]
script = ExtResource("26_6n1ss")
Sprite = NodePath("../Graphics/Root/Base")
Health = NodePath("../HealthComponent")
HitFx = NodePath("../HitParticles")
[node name="MagneticArea" type="Area2D" parent="." unique_id=1477305842]
[node name="MagneticArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="MagneticArea" unique_id=1552683633]
[node name="CollisionShape2D" type="CollisionShape2D" parent="MagneticArea"]
visible = false
shape = SubResource("CircleShape2D_ps31c")
[node name="CanBeLaunchedComponent" type="Node" parent="." unique_id=1998429478]
[node name="CanBeLaunchedComponent" type="Node" parent="."]
script = ExtResource("27_oefns")
[node name="TriggerLeverComponent" type="Node" parent="." unique_id=366225548]
[node name="TriggerLeverComponent" type="Node" parent="."]
script = ExtResource("28_bnap0")
[node name="sfx_jump" type="AudioStreamPlayer2D" parent="." unique_id=218072388]
[node name="sfx_jump" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("18_pysae")
bus = &"sfx"
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="." unique_id=1815263121]
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("19_7anly")
bus = &"sfx"
[node name="sfx_heal" type="AudioStreamPlayer2D" parent="." unique_id=1792916109]
[node name="sfx_heal" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("20_bptj5")
bus = &"sfx"
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="." unique_id=1414786458]
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("32_x2b7c")
bus = &"sfx"
[node name="ChargingBarLayer" parent="." unique_id=664675361 instance=ExtResource("28_3f5nm")]
[node name="ChargingBarLayer" parent="." node_paths=PackedStringArray("_skillManager") instance=ExtResource("28_3f5nm")]
offset_left = -17.0
offset_top = -30.0
offset_right = 23.0
offset_bottom = -20.0
_skillManager = NodePath("../SkillManager")
[node name="HitParticles" parent="." unique_id=1322585720 instance=ExtResource("28_jh5m0")]
process_material = SubResource("ParticleProcessMaterial_oxudy")
[node name="HitParticles" parent="." instance=ExtResource("28_jh5m0")]
process_material = SubResource("ParticleProcessMaterial_lgb3u")
[node name="ShipShooter" type="Node" parent="." unique_id=1147013800 node_paths=PackedStringArray("BulletSpawn", "ShootSfx")]
[node name="ShipShooter" type="Node" parent="." node_paths=PackedStringArray("BulletSpawn", "ShootSfx")]
script = ExtResource("30_usc1p")
BulletScene = ExtResource("36_oxudy")
BulletSpawn = NodePath("../Ship shoot spawn")
ShootSfx = NodePath("../sfx_shoot")
[node name="Ship shoot spawn" type="Marker2D" parent="." unique_id=1653596970]
[node name="Ship shoot spawn" type="Marker2D" parent="."]
position = Vector2(17, 5)
gizmo_extents = 1.0
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="." unique_id=65174812]
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(0, 3)
scale = Vector2(0.8, 1.9)
[node name="PlayerInputHandler" type="Node" parent="." unique_id=1581385683]
script = ExtResource("42_e5pae")
metadata/_custom_type_script = "uid://dssa2taiwktis"
[node name="KillPlayerOutOfScreen" type="Node" parent="." node_paths=PackedStringArray("ScreenNotifier", "HealthComponent")]
script = ExtResource("37_qec3q")
ScreenNotifier = NodePath("../VisibleOnScreenNotifier2D")
HealthComponent = NodePath("../HealthComponent")
[node name="SpriteTilterComponent" type="Node" parent="." unique_id=1433925210 node_paths=PackedStringArray("RotationTarget")]
script = ExtResource("43_xuhvf")
RotationTarget = NodePath("../Graphics/Root/Base")
metadata/_custom_type_script = "uid://ceoxet1nqws8w"
[node name="PlayerSfxComponent" type="Node" parent="." unique_id=1375936690 node_paths=PackedStringArray("JumpSfx")]
script = ExtResource("49_qec3q")
JumpSfx = NodePath("../sfx_jump")
metadata/_custom_type_script = "uid://b1h8r5irryxcx"
[node name="PlayerGraphicsComponent" type="Node" parent="." unique_id=443649347 node_paths=PackedStringArray("DefaultSprite", "SpaceshipSprite")]
script = ExtResource("50_dhjci")
DefaultSprite = NodePath("../Graphics/Root")
SpaceshipSprite = NodePath("../Graphics/Ship")
metadata/_custom_type_script = "uid://b2aanqykvdnev"
[node name="ProgressiveDamageComponent" type="Node" parent="." unique_id=1763641730 node_paths=PackedStringArray("HealthComponent", "Sprite")]
[node name="ProgressiveDamageComponent" type="Node" parent="." node_paths=PackedStringArray("HealthComponent", "Sprite", "PlatformMovement")]
process_mode = 4
script = ExtResource("38_dhjci")
HealthComponent = NodePath("../HealthComponent")
Sprite = NodePath("../Graphics/Root/Base")
metadata/_custom_type_script = "uid://dupnaark1f7gm"
[node name="PacXonGridInteractor" type="Node" parent="." unique_id=1036082136]
script = ExtResource("42_xuhvf")
metadata/_custom_type_script = "uid://c00siqtssccr6"
[node name="PacXonTrailComponent" type="Line2D" parent="." unique_id=100969687]
script = ExtResource("44_uno3u")
metadata/_custom_type_script = "uid://cmk4m7mplqnrm"
[node name="Feet" type="Marker2D" parent="." unique_id=1308840991]
position = Vector2(0, 16)
[node name="FootstepGfx" type="Node2D" parent="." unique_id=362059837 node_paths=PackedStringArray("_controller", "_marker")]
script = ExtResource("46_6n1ss")
_particles = ExtResource("45_bl1gx")
_controller = NodePath("..")
_marker = NodePath("../Feet")
_stepInterval = 0.4
_stepIntervalRandomness = 0.15
_minMoveSpeed = 4.0
_randomOffsetRange = 0.3
metadata/_custom_type_script = "uid://d3ksrjt1ek4gi"
[node name="JumpGfxComponent" type="Node2D" parent="." unique_id=1468920790 node_paths=PackedStringArray("Controller")]
script = ExtResource("47_oefns")
ParticleScene = ExtResource("48_bnap0")
Controller = NodePath("..")
metadata/_custom_type_script = "uid://bpopfy6m4a0br"
PlatformMovement = NodePath("../Movements/PlatformMovement")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://bhc7y4xugu4q7"]
[gd_scene load_steps=10 format=3 uid="uid://bhc7y4xugu4q7"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_w543f"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_6th6w"]
@@ -8,13 +8,12 @@
[ext_resource type="Script" uid="uid://c7p06t0eax8am" path="res://scripts/components/StraightMotionComponent.cs" id="6_lycw2"]
[ext_resource type="Script" uid="uid://cfw8nbrarex0i" path="res://scripts/components/BulletComponent.cs" id="7_2aweg"]
[ext_resource type="PackedScene" uid="uid://c1iorglk708g0" path="res://objects/fxs/terrain_hit_fx.tscn" id="8_6th6w"]
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="9_e0mqp"]
[sub_resource type="CircleShape2D" id="CircleShape2D_txsw8"]
radius = 4.0
[node name="Bullet" type="Area2D"]
collision_layer = 64
collision_layer = 8
collision_mask = 21
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
@@ -51,6 +50,7 @@ LifeTime = 10.0
[node name="LaunchComponent" type="Node2D" parent="."]
script = ExtResource("5_7bijt")
Speed = 120.0
metadata/_custom_type_script = "uid://873un8agkyja"
[node name="StraightMotionComponent" type="Node" parent="." node_paths=PackedStringArray("LaunchComponent")]
script = ExtResource("6_lycw2")
@@ -61,11 +61,7 @@ script = ExtResource("7_2aweg")
Area = NodePath("..")
TerrainHitFx = NodePath("../TerrainHitFX")
BulletSprite = NodePath("../Sprite2D")
metadata/_custom_type_script = "uid://cdnwrn8v05qhi"
[node name="TerrainHitFX" parent="." instance=ExtResource("8_6th6w")]
z_index = 3
[node name="HealthComponent" type="Node2D" parent="."]
script = ExtResource("9_e0mqp")
Health = 0.1
metadata/_custom_type_script = "uid://dgb8bqcri7nsj"

View File

@@ -1,41 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://un55bdc2cg2q"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_1nndd"]
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="2_bljtt"]
[ext_resource type="Script" uid="uid://nhu2xd8611fk" path="res://scripts/components/HazardComponent.cs" id="3_bljtt"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_14ml2"]
size = Vector2(14, 15)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4q8oh"]
size = Vector2(16, 16)
[node name="Cactus" type="StaticBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_14ml2")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_1nndd")
hframes = 12
vframes = 12
frame = 71
[node name="Area2D" type="Area2D" parent="."]
collision_mask = 12
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(-0.5, 0)
shape = SubResource("RectangleShape2D_4q8oh")
debug_color = Color(0.285572, 0.422655, 0.118384, 0.42)
[node name="KnockbackComponent" type="Node" parent="."]
script = ExtResource("2_bljtt")
metadata/_custom_type_script = "uid://cgfynrn68lp12"
[node name="HazardComponent" type="Node2D" parent="." node_paths=PackedStringArray("KnockbackComponent", "HazardArea")]
script = ExtResource("3_bljtt")
KnockbackComponent = NodePath("../KnockbackComponent")
HazardArea = NodePath("../Area2D")
metadata/_custom_type_script = "uid://nhu2xd8611fk"

View File

@@ -0,0 +1,26 @@
[gd_scene load_steps=5 format=3 uid="uid://dstko446qydsc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_6gptm"]
[ext_resource type="Script" uid="uid://ctfrbj52ejay4" path="res://scripts/components/DestroyableComponent.cs" id="2_q37h7"]
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="3_bhwy3"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5sus"]
size = Vector2(16, 16)
[node name="Cannon" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_6gptm")
hframes = 12
vframes = 12
frame = 42
[node name="DestroyableComponent" type="Node" parent="." node_paths=PackedStringArray("Health")]
script = ExtResource("2_q37h7")
Health = NodePath("../HealthComponent")
[node name="HealthComponent" type="Node2D" parent="."]
script = ExtResource("3_bhwy3")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_j5sus")

View File

@@ -1,72 +0,0 @@
[gd_scene load_steps=11 format=3 uid="uid://chetx6gmnwbxi"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_alaj6"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_xmjlg"]
[ext_resource type="Script" uid="uid://cs6u3sh68f43j" path="res://scripts/components/OutOfScreenComponent.cs" id="3_jege3"]
[ext_resource type="Script" uid="uid://oyf25mpc5etr" path="res://scripts/components/LifetimeComponent.cs" id="4_aniyw"]
[ext_resource type="Script" uid="uid://cbexrnnj47f87" path="res://scripts/components/LaunchComponent.cs" id="5_3ks47"]
[ext_resource type="Script" uid="uid://c7p06t0eax8am" path="res://scripts/components/StraightMotionComponent.cs" id="6_4cg6n"]
[ext_resource type="Script" uid="uid://cfw8nbrarex0i" path="res://scripts/components/BulletComponent.cs" id="7_cr5p0"]
[ext_resource type="PackedScene" uid="uid://c1iorglk708g0" path="res://objects/fxs/terrain_hit_fx.tscn" id="8_ivkeb"]
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="9_gx2e5"]
[sub_resource type="CircleShape2D" id="CircleShape2D_txsw8"]
radius = 4.0
[node name="Bullet" type="Area2D"]
collision_layer = 64
collision_mask = 85
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_txsw8")
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(1.5, 1, 1, 1)
scale = Vector2(0.5, 0.5)
texture = ExtResource("1_alaj6")
hframes = 12
vframes = 12
frame = 79
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(2.38419e-07, 2.38419e-07)
scale = Vector2(0.4, 0.4)
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "DamageTimer")]
script = ExtResource("2_xmjlg")
Area = NodePath("..")
DamageTimer = NodePath("../Timer")
[node name="Timer" type="Timer" parent="."]
wait_time = 5.0
autostart = true
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("VisibilityNotifier")]
script = ExtResource("3_jege3")
VisibilityNotifier = NodePath("../VisibleOnScreenNotifier2D")
[node name="LifetimeComponent" type="Node" parent="."]
script = ExtResource("4_aniyw")
LifeTime = 3.0
[node name="LaunchComponent" type="Node2D" parent="."]
script = ExtResource("5_3ks47")
Speed = 160.0
[node name="StraightMotionComponent" type="Node" parent="." node_paths=PackedStringArray("LaunchComponent")]
script = ExtResource("6_4cg6n")
LaunchComponent = NodePath("../LaunchComponent")
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "TerrainHitFx", "BulletSprite")]
script = ExtResource("7_cr5p0")
Area = NodePath("..")
TerrainHitFx = NodePath("../TerrainHitFX")
BulletSprite = NodePath("../Sprite2D")
[node name="TerrainHitFX" parent="." instance=ExtResource("8_ivkeb")]
z_index = 3
[node name="HealthComponent" type="Node2D" parent="."]
script = ExtResource("9_gx2e5")
Health = 0.1
metadata/_custom_type_script = "uid://dgb8bqcri7nsj"

View File

@@ -1,48 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://qrbiu1qo4tt5"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_0efvn"]
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_4ycs1"]
[ext_resource type="PackedScene" uid="uid://chetx6gmnwbxi" path="res://objects/entities/cannon_bullet.tscn" id="3_ab2uh"]
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_tynaf"]
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_0xigu"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5sus"]
size = Vector2(16, 16)
[node name="Cannon" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
[node name="Sprite2D" type="Sprite2D" parent="."]
rotation = 3.14159
texture = ExtResource("1_0efvn")
hframes = 12
vframes = 12
frame = 42
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_j5sus")
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
script = ExtResource("2_4ycs1")
BulletScene = ExtResource("3_ab2uh")
ShootInterval = 3.0
ShootDirection = Vector2(0, 1)
BulletSpawnPointRight = NodePath("../Bullet spawn")
ShootingIntervalVariation = 0.61
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
[node name="Bullet spawn" type="Marker2D" parent="."]
position = Vector2(0, 12)
[node name="RecoilComponent" type="Node" parent="." node_paths=PackedStringArray("RecoilTarget")]
script = ExtResource("4_tynaf")
RecoilTarget = NodePath("../Sprite2D")
RecoilDistance = 4.0
RecoilDuration = 0.12
metadata/_custom_type_script = "uid://b3j23e7b7x8ro"
[node name="SquashAndStretchComponent" type="Node" parent="." node_paths=PackedStringArray("TargetNode")]
script = ExtResource("5_0xigu")
TargetNode = NodePath("../Sprite2D")
metadata/_custom_type_script = "uid://c707c53k7c5ae"

View File

@@ -1,48 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://cm0rd70wafif1"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_hnnrt"]
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_cho7n"]
[ext_resource type="PackedScene" uid="uid://chetx6gmnwbxi" path="res://objects/entities/cannon_bullet.tscn" id="3_kgmtj"]
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_nfk87"]
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_43fqe"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5sus"]
size = Vector2(16, 16)
[node name="Cannon" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
[node name="Sprite2D" type="Sprite2D" parent="."]
rotation = -1.5708
texture = ExtResource("1_hnnrt")
hframes = 12
vframes = 12
frame = 42
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_j5sus")
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
script = ExtResource("2_cho7n")
BulletScene = ExtResource("3_kgmtj")
ShootInterval = 3.0
ShootDirection = Vector2(-1, 0)
BulletSpawnPointRight = NodePath("../Bullet spawn")
ShootingIntervalVariation = 0.61
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
[node name="Bullet spawn" type="Marker2D" parent="."]
position = Vector2(-12, 0)
[node name="RecoilComponent" type="Node" parent="." node_paths=PackedStringArray("RecoilTarget")]
script = ExtResource("4_nfk87")
RecoilTarget = NodePath("../Sprite2D")
RecoilDistance = 4.0
RecoilDuration = 0.12
metadata/_custom_type_script = "uid://b3j23e7b7x8ro"
[node name="SquashAndStretchComponent" type="Node" parent="." node_paths=PackedStringArray("TargetNode")]
script = ExtResource("5_43fqe")
TargetNode = NodePath("../Sprite2D")
metadata/_custom_type_script = "uid://c707c53k7c5ae"

View File

@@ -0,0 +1,33 @@
[gd_scene load_steps=5 format=3 uid="uid://dfwpha0d18dmn"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_rwgpm"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_hrj61"]
[ext_resource type="Script" uid="uid://df1llrbm80e02" path="res://scripts/components/BeamComponent.cs" id="3_hrj61"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ptfn7"]
size = Vector2(8, 16)
[node name="Cannon Ray" type="Area2D"]
collision_layer = 0
collision_mask = 5
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_repeat = 2
texture = ExtResource("1_rwgpm")
region_enabled = true
region_rect = Rect2(176, 64, 16, 16)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ptfn7")
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area")]
script = ExtResource("2_hrj61")
Area = NodePath("..")
[node name="BeamComponent" type="Node2D" parent="." node_paths=PackedStringArray("Root", "Sprite", "CollisionShape")]
position = Vector2(0, -8)
script = ExtResource("3_hrj61")
ExpansionSpeed = 16.0
Root = NodePath(".")
Sprite = NodePath("../Sprite2D")
CollisionShape = NodePath("../CollisionShape2D")

View File

@@ -0,0 +1,35 @@
[gd_scene load_steps=5 format=3 uid="uid://d3lt4rhxduv44"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_l5x2w"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_0kbpg"]
[ext_resource type="Script" uid="uid://df1llrbm80e02" path="res://scripts/components/BeamComponent.cs" id="3_0kbpg"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ptfn7"]
size = Vector2(16, 8)
[node name="Cannon Ray" type="Area2D"]
collision_layer = 0
collision_mask = 5
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_repeat = 2
rotation = 1.5708
texture = ExtResource("1_l5x2w")
region_enabled = true
region_rect = Rect2(176, 64, 16, 16)
region_filter_clip_enabled = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ptfn7")
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area")]
script = ExtResource("2_0kbpg")
Area = NodePath("..")
[node name="BeamComponent" type="Node2D" parent="." node_paths=PackedStringArray("Root", "Sprite", "CollisionShape")]
position = Vector2(8, 0)
script = ExtResource("3_0kbpg")
ExpansionSpeed = 16.0
Root = NodePath("..")
Sprite = NodePath("../Sprite2D")
CollisionShape = NodePath("../CollisionShape2D")

View File

@@ -1,47 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://dr6srln4mckwn"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_r5bjs"]
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_gd3be"]
[ext_resource type="PackedScene" uid="uid://chetx6gmnwbxi" path="res://objects/entities/cannon_bullet.tscn" id="3_1gufj"]
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_hwc6x"]
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_o674s"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5sus"]
size = Vector2(16, 16)
[node name="Cannon" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
[node name="Sprite2D" type="Sprite2D" parent="."]
rotation = 1.5708
texture = ExtResource("1_r5bjs")
hframes = 12
vframes = 12
frame = 42
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_j5sus")
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
script = ExtResource("2_gd3be")
BulletScene = ExtResource("3_1gufj")
ShootInterval = 3.0
BulletSpawnPointRight = NodePath("../Bullet spawn")
ShootingIntervalVariation = 0.61
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
[node name="Bullet spawn" type="Marker2D" parent="."]
position = Vector2(12, 0)
[node name="RecoilComponent" type="Node" parent="." node_paths=PackedStringArray("RecoilTarget")]
script = ExtResource("4_hwc6x")
RecoilTarget = NodePath("../Sprite2D")
RecoilDistance = 4.0
RecoilDuration = 0.12
metadata/_custom_type_script = "uid://b3j23e7b7x8ro"
[node name="SquashAndStretchComponent" type="Node" parent="." node_paths=PackedStringArray("TargetNode")]
script = ExtResource("5_o674s")
TargetNode = NodePath("../Sprite2D")
metadata/_custom_type_script = "uid://c707c53k7c5ae"

View File

@@ -1,47 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://dstko446qydsc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_6gptm"]
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_q37h7"]
[ext_resource type="PackedScene" uid="uid://chetx6gmnwbxi" path="res://objects/entities/cannon_bullet.tscn" id="3_ww0hb"]
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_bhwy3"]
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_ww0hb"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5sus"]
size = Vector2(16, 16)
[node name="Cannon" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_6gptm")
hframes = 12
vframes = 12
frame = 42
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_j5sus")
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
script = ExtResource("2_q37h7")
BulletScene = ExtResource("3_ww0hb")
ShootInterval = 3.0
ShootDirection = Vector2(0, -1)
BulletSpawnPointRight = NodePath("../Bullet spawn")
ShootingIntervalVariation = 0.61
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
[node name="Bullet spawn" type="Marker2D" parent="."]
position = Vector2(0, -16)
[node name="RecoilComponent" type="Node" parent="." node_paths=PackedStringArray("RecoilTarget")]
script = ExtResource("4_bhwy3")
RecoilTarget = NodePath("../Sprite2D")
RecoilDistance = 4.0
RecoilDuration = 0.12
metadata/_custom_type_script = "uid://b3j23e7b7x8ro"
[node name="SquashAndStretchComponent" type="Node" parent="." node_paths=PackedStringArray("TargetNode")]
script = ExtResource("5_ww0hb")
TargetNode = NodePath("../Sprite2D")
metadata/_custom_type_script = "uid://c707c53k7c5ae"

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://54w4wisfj8v8"]
[gd_scene load_steps=7 format=3 uid="uid://54w4wisfj8v8"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_epuj5"]
[ext_resource type="Script" uid="uid://r4jybneigfcn" path="res://scripts/components/CollectableComponent.cs" id="2_gxix7"]
@@ -9,33 +9,33 @@
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
[node name="Coin" type="Area2D" unique_id=1771447403 groups=["coins"]]
[node name="Coin" type="Area2D" groups=["coins"]]
collision_layer = 2
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=707378099]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_3ask2")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=898624458]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_epuj5")
hframes = 12
vframes = 12
frame = 51
[node name="CollectableComponent" type="Node" parent="." unique_id=564726971 node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("Area2D", "CollisionShape", "Sfx")]
script = ExtResource("2_gxix7")
Area2D = NodePath("..")
CollisionShape = NodePath("../CollisionShape2D")
Data = ExtResource("3_fm2fq")
Sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." unique_id=1534239994 node_paths=PackedStringArray("Sprite", "Area")]
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Area")]
script = ExtResource("4_gxix7")
Sprite = NodePath("../Sprite2D")
FadeDuration = 0.4
Area = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="." unique_id=1641717]
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_4jc2c")
volume_db = -10.0
bus = &"sfx"

View File

@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://c40r76qqacqie"]
[gd_scene load_steps=5 format=3 uid="uid://c40r76qqacqie"]
[ext_resource type="Texture2D" uid="uid://cysarpu6snb2y" path="res://sprites/ppc-tileset.png" id="1_jmsgb"]
[ext_resource type="Texture2D" uid="uid://cw42lvnqxubq2" path="res://sprites/PS_Tileset_10_nes.png" id="1_jmsgb"]
[ext_resource type="Script" uid="uid://xqhrb1c7f6y4" path="res://scripts/components/CollapsableComponent.cs" id="2_jmsgb"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_l44jt"]
@@ -9,30 +9,30 @@ size = Vector2(16, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sfbe2"]
size = Vector2(16, 2)
[node name="Collapsing Block" type="StaticBody2D" unique_id=1834310310]
[node name="Collapsing Block" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=2120289038]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_jmsgb")
hframes = 64
vframes = 64
frame = 710
hframes = 16
vframes = 12
frame = 182
[node name="StaticCollisionShape2D" type="CollisionShape2D" parent="." unique_id=196070485]
[node name="StaticCollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_l44jt")
[node name="Collapsable detector" type="Area2D" parent="." unique_id=1910035087]
[node name="Collapsable detector" type="Area2D" parent="."]
collision_mask = 4
[node name="AreaCollisionShape2D" type="CollisionShape2D" parent="Collapsable detector" unique_id=1903927379]
[node name="AreaCollisionShape2D" type="CollisionShape2D" parent="Collapsable detector"]
position = Vector2(0, -8)
shape = SubResource("RectangleShape2D_sfbe2")
[node name="ToCollapseTimer" type="Timer" parent="." unique_id=2109761872]
[node name="ToCollapseTimer" type="Timer" parent="."]
wait_time = 0.5
[node name="ResetTimer" type="Timer" parent="." unique_id=1072118129]
[node name="ResetTimer" type="Timer" parent="."]
[node name="CollapsableComponent" type="Node" parent="." unique_id=1696909259 node_paths=PackedStringArray("ToCollapseTimer", "ResetTimer", "Sprite2D", "CollisionShape")]
[node name="CollapsableComponent" type="Node" parent="." node_paths=PackedStringArray("ToCollapseTimer", "ResetTimer", "Sprite2D", "CollisionShape")]
script = ExtResource("2_jmsgb")
ToCollapseTimer = NodePath("../ToCollapseTimer")
ResetTimer = NodePath("../ResetTimer")

View File

@@ -1,34 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://dk2cu8qs7odib"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_214vd"]
[ext_resource type="Script" uid="uid://r4jybneigfcn" path="res://scripts/components/CollectableComponent.cs" id="2_h7fi3"]
[ext_resource type="Script" uid="uid://bjln6jb1sigx2" path="res://scripts/components/FadeAwayComponent.cs" id="3_b687r"]
[ext_resource type="Resource" path="res://resources/collectables/double_jump_pickup.tres" id="3_h7fi3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pickup"]
radius = 12.0
[node name="SkillPickup" type="Area2D" groups=["Collectables"]]
collision_layer = 2
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_pickup")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_214vd")
hframes = 12
vframes = 12
frame = 24
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("Area2D", "CollisionShape")]
script = ExtResource("2_h7fi3")
Area2D = NodePath("..")
CollisionShape = NodePath("../CollisionShape2D")
Data = ExtResource("3_h7fi3")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Area")]
script = ExtResource("3_b687r")
Sprite = NodePath("../Sprite2D")
FadeDuration = 0.5
Area = NodePath("..")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=29 format=3 uid="uid://bwdlmualj6xbw"]
[gd_scene load_steps=27 format=3 uid="uid://bwdlmualj6xbw"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_ep4yr"]
[ext_resource type="Texture2D" uid="uid://cu72810eyk4dx" path="res://sprites/enemy-robot.png" id="2_hjtwe"]
@@ -18,8 +18,6 @@
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fxs/fire_fx.tscn" id="15_mc6rj"]
[ext_resource type="PackedScene" uid="uid://ck6nml06tm6ue" path="res://objects/fxs/ice_fx.tscn" id="16_68hnm"]
[ext_resource type="PackedScene" uid="uid://b12tppjkkqpt4" path="res://objects/fxs/hit_particles.tscn" id="18_pxaaa"]
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="19_xku20"]
[ext_resource type="Script" uid="uid://bhbgjr8ty2n85" path="res://scripts/components/EnemyControllerComponent.cs" id="20_5lji2"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(25, 31)
@@ -98,12 +96,13 @@ RightRay = NodePath("../Right Ray")
LeftWallRay = NodePath("../Left Wall Ray")
RightWallRay = NodePath("../Right Wall Ray")
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight", "BulletSpawnPointLeft")]
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("SideToSideMovement", "BulletSpawnRight", "BulletSpawnLeft")]
script = ExtResource("6_lgbyy")
BulletScene = ExtResource("7_r48kf")
BulletSpawnPointRight = NodePath("../Sprite2D/right bullet spawn")
BulletSpawnPointLeft = NodePath("../Sprite2D/left bullet spawn")
ShootingIntervalVariation = 0.3
SideToSideMovement = NodePath("../SideToSideMovement")
BulletSpawnRight = NodePath("../Sprite2D/right bullet spawn")
BulletSpawnLeft = NodePath("../Sprite2D/left bullet spawn")
ShootingIntervalVariation = 0.1
[node name="EnemyDeathComponent" type="Node" parent="." node_paths=PackedStringArray("CollisionShape", "Health")]
script = ExtResource("8_pxaaa")
@@ -183,13 +182,3 @@ visible = false
[node name="HitParticles" parent="." instance=ExtResource("18_pxaaa")]
position = Vector2(0, 1)
process_material = SubResource("ParticleProcessMaterial_pxaaa")
[node name="KnockbackComponent" type="Node" parent="."]
script = ExtResource("19_xku20")
metadata/_custom_type_script = "uid://cgfynrn68lp12"
[node name="EnemyControllerComponent" type="Node" parent="." node_paths=PackedStringArray("MovementComponent", "ShootingComponent")]
script = ExtResource("20_5lji2")
MovementComponent = NodePath("../SideToSideMovement")
ShootingComponent = NodePath("../PeriodicShootingComponent")
metadata/_custom_type_script = "uid://bhbgjr8ty2n85"

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://12jnkdygpxwc"]
[gd_scene load_steps=6 format=3 uid="uid://12jnkdygpxwc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_agxwm"]
[ext_resource type="Script" uid="uid://dnh0mekg2vqxi" path="res://scripts/components/RequirementComponent.cs" id="2_ed7mh"]
@@ -8,14 +8,11 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yfu6m"]
size = Vector2(28, 32)
[node name="ExitLevel" type="Area2D" unique_id=1951927125 node_paths=PackedStringArray("DoorSprite")]
[node name="ExitLevel" type="Area2D"]
collision_layer = 0
collision_mask = 4
script = ExtResource("4_06sog")
DoorSprite = NodePath("Sprite2D")
OpenedDoorFrame = 88
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1296410089]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -8)
scale = Vector2(2, 2)
texture = ExtResource("1_agxwm")
@@ -23,15 +20,24 @@ hframes = 12
vframes = 12
frame = 54
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=220927363]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -8)
shape = SubResource("RectangleShape2D_yfu6m")
[node name="RequirementComponent" type="Node" parent="." unique_id=1338124097]
[node name="RequirementComponent" type="Node" parent="."]
script = ExtResource("2_ed7mh")
RequirementType = 2
RequirementType = 1
metadata/_custom_type_script = "uid://cmh8k0rdsyh7j"
[node name="UnlockOnRequirementComponent" type="Node" parent="." unique_id=1279359200 node_paths=PackedStringArray("RequirementComponent", "UnlockTarget")]
[node name="UnlockOnRequirementComponent" type="Node" parent="." node_paths=PackedStringArray("RequirementComponent", "UnlockTarget")]
script = ExtResource("3_ed7mh")
RequirementComponent = NodePath("../RequirementComponent")
UnlockTarget = NodePath("..")
UnlockTarget = NodePath("../ExitDoorComponent")
metadata/_custom_type_script = "uid://c8xhgkg8gcqu6"
[node name="ExitDoorComponent" type="Node" parent="." node_paths=PackedStringArray("ExitArea", "DoorSprite")]
script = ExtResource("4_06sog")
ExitArea = NodePath("..")
DoorSprite = NodePath("../Sprite2D")
OpenedDoorFrame = 88
metadata/_custom_type_script = "uid://bwamqffvpa452"

View File

@@ -1,78 +0,0 @@
[gd_scene load_steps=11 format=3 uid="uid://bmk3ddwv33dud"]
[ext_resource type="Texture2D" uid="uid://ccjihsk6w8sow" path="res://sprites/BFT - Mega Metroidvania Tileset.png" id="1_erbp6"]
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_fq2gn"]
[ext_resource type="Script" uid="uid://v7tt4w6bejux" path="res://scripts/components/CleanupComponent.cs" id="4_mgh1e"]
[ext_resource type="Script" uid="uid://nhu2xd8611fk" path="res://scripts/components/HazardComponent.cs" id="5_8g254"]
[ext_resource type="Script" uid="uid://chusyr5vwgwf0" path="res://scripts/components/CleanupOnCollisionComponent.cs" id="6_2rpon"]
[ext_resource type="Script" uid="uid://cgfynrn68lp12" path="res://scripts/components/KnockbackComponent.cs" id="6_3n0l8"]
[ext_resource type="Script" uid="uid://co05ugnvx0v3e" path="res://scripts/components/FallOnDetectionComponent.cs" id="7_mgh1e"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_t3a48"]
size = Vector2(16, 8)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fq2gn"]
size = Vector2(16, 320)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2rpon"]
size = Vector2(17, 9)
[node name="FallingSpike" type="RigidBody2D"]
collision_mask = 5
gravity_scale = 0.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -4)
shape = SubResource("RectangleShape2D_t3a48")
[node name="Sprite2D" type="Sprite2D" parent="."]
rotation = -3.14159
texture = ExtResource("1_erbp6")
hframes = 13
vframes = 45
frame = 9
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area")]
script = ExtResource("2_fq2gn")
Area = NodePath("")
metadata/_custom_type_script = "uid://2i7p7v135u7c"
[node name="HazardComponent" type="Node2D" parent="." node_paths=PackedStringArray("KnockbackComponent", "HazardArea")]
script = ExtResource("5_8g254")
KnockbackComponent = NodePath("../KnockbackComponent")
HazardArea = NodePath("../HazardArea")
metadata/_custom_type_script = "uid://nhu2xd8611fk"
[node name="KnockbackComponent" type="Node" parent="."]
script = ExtResource("6_3n0l8")
metadata/_custom_type_script = "uid://cgfynrn68lp12"
[node name="FallTriggerArea" type="Area2D" parent="."]
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="FallTriggerArea"]
position = Vector2(0, 155)
shape = SubResource("RectangleShape2D_fq2gn")
debug_color = Color(0.916282, 7.47952e-05, 0.709809, 0.42)
[node name="CleanupComponent" type="Node" parent="."]
script = ExtResource("4_mgh1e")
metadata/_custom_type_script = "uid://v7tt4w6bejux"
[node name="CleanupOnCollisionComponent" type="Node" parent="."]
script = ExtResource("6_2rpon")
metadata/_custom_type_script = "uid://chusyr5vwgwf0"
[node name="FallOnDetectionComponent" type="Node2D" parent="." node_paths=PackedStringArray("DetectionArea", "TargetBody")]
script = ExtResource("7_mgh1e")
DetectionArea = NodePath("../FallTriggerArea")
TargetBody = NodePath("..")
metadata/_custom_type_script = "uid://co05ugnvx0v3e"
[node name="HazardArea" type="Area2D" parent="."]
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="HazardArea"]
position = Vector2(0, -4.5)
shape = SubResource("RectangleShape2D_2rpon")
debug_color = Color(0.73011, 0.468379, 0.188355, 0.42)

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://xp4njljog0x2"]
[gd_scene load_steps=29 format=3 uid="uid://xp4njljog0x2"]
[ext_resource type="Texture2D" uid="uid://22k1u37j6k8y" path="res://sprites/flying_enemy.png" id="1_30hhw"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_uyhuj"]
@@ -17,7 +17,6 @@
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fxs/fire_fx.tscn" id="14_mrjm6"]
[ext_resource type="Script" uid="uid://d1388lhp2gpgr" path="res://scripts/components/IceEffectComponent.cs" id="14_pkino"]
[ext_resource type="PackedScene" uid="uid://ck6nml06tm6ue" path="res://objects/fxs/ice_fx.tscn" id="15_pkino"]
[ext_resource type="Script" uid="uid://b4hvq2i66fjhi" path="res://scripts/components/PathFollowerComponent.cs" id="18_q78ru"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_hil2i"]
radius = 6.0
@@ -60,7 +59,7 @@ point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_7b7mt"]
curve = SubResource("Curve_f2w8b")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_q78ru"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_qxfb0"]
resource_local_to_scene = true
lifetime_randomness = 1.0
particle_flag_disable_z = true
@@ -80,121 +79,114 @@ color_ramp = SubResource("GradientTexture1D_f1fvy")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cmp1h"]
size = Vector2(16, 26)
[node name="Flying Enemy" type="CharacterBody2D" unique_id=1068972930]
[node name="Flying Enemy" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 21
motion_mode = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=572073196]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
shape = SubResource("CapsuleShape2D_hil2i")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=191340928]
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_q78ru")
texture = ExtResource("1_30hhw")
[node name="Jetpack Particles" type="GPUParticles2D" parent="." unique_id=1641064286]
[node name="Jetpack Particles" type="GPUParticles2D" parent="."]
z_index = -1
position = Vector2(-4, 16)
explosiveness = 0.5
fixed_fps = 24
process_material = SubResource("ParticleProcessMaterial_fd2du")
[node name="Jetpack Particles2" type="GPUParticles2D" parent="." unique_id=962140317]
[node name="Jetpack Particles2" type="GPUParticles2D" parent="."]
z_index = -1
position = Vector2(4, 16)
explosiveness = 0.5
fixed_fps = 24
process_material = SubResource("ParticleProcessMaterial_fd2du")
[node name="HealthComponent" type="Node2D" parent="." unique_id=1125679087 node_paths=PackedStringArray("HurtSfx")]
[node name="HealthComponent" type="Node2D" parent="." node_paths=PackedStringArray("HurtSfx")]
script = ExtResource("3_uyhuj")
Health = 0.25
MaxHealth = 0.25
HurtSfx = NodePath("../sfx_hurt")
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="." unique_id=1006537001]
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("3_fd2du")
bus = &"sfx"
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="." unique_id=1437744637]
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_rhq76")
bus = &"sfx"
[node name="DamageComponent" type="Node" parent="." unique_id=1923393563 node_paths=PackedStringArray("Area")]
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area")]
script = ExtResource("6_q78ru")
Area = NodePath("../Hitbox")
[node name="PeriodicShootingComponent" type="Node" parent="." unique_id=1743534415 node_paths=PackedStringArray("BulletSpawnPointRight", "BulletSpawnPointLeft")]
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnRight", "BulletSpawnLeft")]
script = ExtResource("7_weo6b")
BulletScene = ExtResource("7_4ajjm")
ShootInterval = 2.0
BulletSpawnPointRight = NodePath("../laser spawn point right")
BulletSpawnPointLeft = NodePath("../laser spawn point left")
BulletSpawnRight = NodePath("../laser spawn point right")
BulletSpawnLeft = NodePath("../laser spawn point left")
ShootingIntervalVariation = 0.5
[node name="EnemyDeathComponent" type="Node" parent="." unique_id=1519565079 node_paths=PackedStringArray("CollisionShape", "Health")]
[node name="EnemyDeathComponent" type="Node" parent="." node_paths=PackedStringArray("CollisionShape", "Health")]
script = ExtResource("9_6p4k7")
TweenDuration = 0.1
CollisionShape = NodePath("../CollisionShape2D")
Health = NodePath("../HealthComponent")
[node name="FlashingComponent" type="Node" parent="." unique_id=1761479670 node_paths=PackedStringArray("Sprite", "HealthComponent")]
[node name="FlashingComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "HealthComponent")]
process_mode = 3
script = ExtResource("10_jmybk")
Sprite = NodePath("../Sprite2D")
HealthComponent = NodePath("../HealthComponent")
[node name="HitComponent" type="Node" parent="." unique_id=2106183592 node_paths=PackedStringArray("Sprite", "Health", "HitFx")]
[node name="HitComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Health", "HitFx")]
script = ExtResource("11_2yvae")
Sprite = NodePath("../Sprite2D")
Health = NodePath("../HealthComponent")
HitFx = NodePath("../HitParticles")
[node name="StatusEffectComponent" type="Node" parent="." unique_id=2016067092]
[node name="StatusEffectComponent" type="Node" parent="."]
script = ExtResource("12_xlup2")
[node name="FireEffectComponent" type="Node" parent="." unique_id=599378746 node_paths=PackedStringArray("Health", "StatusEffectComponent", "FireFX")]
[node name="FireEffectComponent" type="Node" parent="." node_paths=PackedStringArray("Health", "StatusEffectComponent", "FireFX")]
script = ExtResource("13_mrjm6")
Health = NodePath("../HealthComponent")
StatusEffectComponent = NodePath("../StatusEffectComponent")
FireFX = NodePath("../FireFX")
[node name="IceEffectComponent" type="Node" parent="." unique_id=1515560540 node_paths=PackedStringArray("ComponentsToDisable", "StatusEffectComponent", "IceFx")]
[node name="IceEffectComponent" type="Node" parent="." node_paths=PackedStringArray("ComponentsToDisable", "StatusEffectComponent", "IceFx")]
script = ExtResource("14_pkino")
ComponentsToDisable = [NodePath("../PeriodicShootingComponent"), NodePath("../DamageComponent")]
StatusEffectComponent = NodePath("../StatusEffectComponent")
IceFx = NodePath("../Ice FX")
[node name="HitParticles" parent="." unique_id=579475644 instance=ExtResource("13_xlup2")]
[node name="HitParticles" parent="." instance=ExtResource("13_xlup2")]
position = Vector2(0, 1)
process_material = SubResource("ParticleProcessMaterial_q78ru")
process_material = SubResource("ParticleProcessMaterial_qxfb0")
[node name="FireFX" parent="." unique_id=1136026281 instance=ExtResource("14_mrjm6")]
[node name="FireFX" parent="." instance=ExtResource("14_mrjm6")]
position = Vector2(0, 9)
emitting = false
amount = 2048
[node name="Ice FX" parent="." unique_id=275134518 instance=ExtResource("15_pkino")]
[node name="Ice FX" parent="." instance=ExtResource("15_pkino")]
visible = false
position = Vector2(1, 0)
scale = Vector2(0.684407, 0.929677)
[node name="laser spawn point right" type="Node2D" parent="." unique_id=915998238]
[node name="laser spawn point right" type="Node2D" parent="."]
position = Vector2(8, -2)
[node name="laser spawn point left" type="Node2D" parent="." unique_id=1180867485]
[node name="laser spawn point left" type="Node2D" parent="."]
position = Vector2(-9, -2)
[node name="Hitbox" type="Area2D" parent="." unique_id=1699649839]
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 8
collision_mask = 20
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=379520850]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, 2)
shape = SubResource("RectangleShape2D_cmp1h")
[node name="PathFollowerComponent" type="Node2D" parent="." unique_id=1706994676]
script = ExtResource("18_q78ru")
ShouldRotate = false
metadata/_custom_type_script = "uid://b4hvq2i66fjhi"

View File

@@ -1,31 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://b3877xt5upsj2"]
[ext_resource type="Texture2D" uid="uid://dpbpjffbdbovp" path="res://sprites/cap.png" id="1_ksysq"]
[ext_resource type="Script" uid="uid://7i20oc4cyabl" path="res://scripts/components/GhostMovementComponent.cs" id="2_0qila"]
[sub_resource type="CircleShape2D" id="CircleShape2D_0xbgb"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ksysq"]
[node name="Ghost" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 5
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_0xbgb")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(2.98023e-08, 0)
scale = Vector2(0.609375, 0.78125)
texture = ExtResource("1_ksysq")
[node name="GhostMovementComponent" type="Node2D" parent="."]
script = ExtResource("2_0qila")
metadata/_custom_type_script = "uid://7i20oc4cyabl"
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_ksysq")

View File

@@ -1,39 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://gknrmek1jmjx"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="13_uybbp"]
[ext_resource type="Texture2D" uid="uid://0l454rfplmqg" path="res://sprites/MrBrick_base-sheet.png" id="14_4rwar"]
[ext_resource type="Texture2D" uid="uid://jl1gwqchhpdc" path="res://sprites/left_eye.png" id="15_qkwlh"]
[ext_resource type="Texture2D" uid="uid://iiawtnwmeny3" path="res://sprites/right_eye.png" id="16_kt5il"]
[ext_resource type="Texture2D" uid="uid://dhkwyv6ayb5qb" path="res://sprites/flying_ship.png" id="17_i5nnv"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xoue7"]
shader = ExtResource("13_uybbp")
shader_parameter/enabled = false
shader_parameter/tint = Color(1, 1, 1, 1)
[node name="Brick Player" type="Node2D"]
[node name="Graphics" type="Node2D" parent="."]
modulate = Color(1, 1, 1, 0.443137)
[node name="Root" type="Node2D" parent="Graphics"]
[node name="Base" type="Sprite2D" parent="Graphics/Root"]
material = SubResource("ShaderMaterial_xoue7")
texture = ExtResource("14_4rwar")
hframes = 5
[node name="Left Eye" type="Sprite2D" parent="Graphics/Root"]
position = Vector2(-7, -6)
texture = ExtResource("15_qkwlh")
hframes = 2
[node name="Right Eye" type="Sprite2D" parent="Graphics/Root"]
position = Vector2(6, -5)
texture = ExtResource("16_kt5il")
hframes = 2
[node name="Ship" type="Sprite2D" parent="Graphics"]
visible = false
position = Vector2(1, 7)
texture = ExtResource("17_i5nnv")

View File

@@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://cm3rixnnev1pg"]
[gd_scene load_steps=4 format=3 uid="uid://cm3rixnnev1pg"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_ctugi"]
[ext_resource type="Script" uid="uid://bgbnof7aeydmq" path="res://scripts/components/JumpPadComponent.cs" id="2_huktk"]
@@ -6,23 +6,23 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ci3ij"]
size = Vector2(16, 6)
[node name="Jump pad" type="Area2D" unique_id=986549607]
[node name="Jump pad" type="Area2D"]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1755302504]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 5)
shape = SubResource("RectangleShape2D_ci3ij")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1150967280]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_ctugi")
hframes = 12
vframes = 12
frame = 120
[node name="JumpPadComponent" type="Node" parent="." unique_id=1295810804 node_paths=PackedStringArray("Area", "Sprite")]
[node name="JumpPadComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "Sprite")]
script = ExtResource("2_huktk")
JumpForce = 1210.0
JumpForce = 1110.0
Area = NodePath("..")
Sprite = NodePath("../Sprite2D")
StartAnimationIndex = 120

View File

@@ -1,32 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://0idmnkwids1r"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_sprite"]
[ext_resource type="Script" uid="uid://r4jybneigfcn" path="res://scripts/components/CollectableComponent.cs" id="2_collectable"]
[ext_resource type="Script" uid="uid://bjln6jb1sigx2" path="res://scripts/components/FadeAwayComponent.cs" id="3_fadeaway"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pickup"]
radius = 12.0
[node name="SkillPickup" type="Area2D" groups=["Collectables"]]
collision_layer = 2
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_pickup")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_sprite")
hframes = 12
vframes = 12
frame = 24
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("Area2D", "CollisionShape")]
script = ExtResource("2_collectable")
Area2D = NodePath("..")
CollisionShape = NodePath("../CollisionShape2D")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("Sprite", "Area")]
script = ExtResource("3_fadeaway")
Sprite = NodePath("../Sprite2D")
FadeDuration = 0.5
Area = NodePath("..")

View File

@@ -1,20 +1,18 @@
[gd_scene format=3 uid="uid://lpovacvt3yyj"]
[gd_scene load_steps=4 format=3 uid="uid://lpovacvt3yyj"]
[ext_resource type="Texture2D" uid="uid://dhkwyv6ayb5qb" path="res://sprites/flying_ship.png" id="1_r82pf"]
[ext_resource type="Script" uid="uid://dtv2r7q4elgre" path="res://scripts/components/SpaceshipEnterComponent.cs" id="2_wanmd"]
[ext_resource type="Resource" uid="uid://d033qwwfs3i72" path="res://resources/movement_presets/spaceship_movement.tres" id="2_yda36"]
[sub_resource type="CircleShape2D" id="CircleShape2D_wanmd"]
radius = 16.1245
[node name="Spaceship Enter" type="Area2D" unique_id=916428603]
[node name="Spaceship Enter" type="Area2D"]
collision_layer = 0
collision_mask = 4
script = ExtResource("2_wanmd")
Preset = ExtResource("2_yda36")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=433507900]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_r82pf")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=993596426]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_wanmd")

View File

@@ -1,15 +1,14 @@
[gd_scene format=3 uid="uid://dkqa3q6j2gof4"]
[gd_scene load_steps=3 format=3 uid="uid://dkqa3q6j2gof4"]
[ext_resource type="Script" uid="uid://d3gfg05ll8uw3" path="res://scripts/components/SpaceshipExitComponent.cs" id="1_1cmfv"]
[ext_resource type="Resource" uid="uid://vgutbpovj8hc" path="res://resources/movement_presets/platform_movement.tres" id="2_njt46"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_njt46"]
[node name="Spaceship exit" type="Area2D" unique_id=922920366]
[node name="Spaceship exit" type="Area2D" node_paths=PackedStringArray("Area")]
collision_layer = 0
collision_mask = 4
script = ExtResource("1_1cmfv")
Preset = ExtResource("2_njt46")
Area = NodePath(".")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1697409658]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_njt46")

View File

@@ -1,8 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://dpibw6s3dcggr"]
[ext_resource type="Script" uid="uid://cobgfsr3gw7cn" path="res://Autoloads/FloatingTextManager.cs" id="1_ak38b"]
[ext_resource type="PackedScene" uid="uid://c7mp0o2goauyy" path="res://objects/ui/floating_text.tscn" id="2_sdx3u"]
[node name="FloatingTextManager" type="Node"]
script = ExtResource("1_ak38b")
FloatingTextScene = ExtResource("2_sdx3u")

View File

@@ -1,39 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://qo2ngbnkix85"]
[sub_resource type="Gradient" id="Gradient_qxp43"]
offsets = PackedFloat32Array(0, 0.289256, 0.790634)
colors = PackedColorArray(0.635294, 1, 0.952941, 1, 0.380392, 0.827451, 0.890196, 1, 0.188235, 0.317647, 0.509804, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_1jx8o"]
gradient = SubResource("Gradient_qxp43")
use_hdr = true
[sub_resource type="Curve" id="Curve_8fwqm"]
_data = [Vector2(0.251928, 1), 0.0, -3.43942, 0, 0, Vector2(1, 0.340954), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_365fl"]
curve = SubResource("Curve_8fwqm")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_wfuta"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(10, 1, 1)
angle_min = -45.0
angle_max = 45.0
direction = Vector3(0, 1, 0)
spread = 15.0
initial_velocity_min = 5.0
initial_velocity_max = 10.0
gravity = Vector3(0, 98, 0)
scale_curve = SubResource("CurveTexture_365fl")
color_ramp = SubResource("GradientTexture1D_1jx8o")
[node name="BounceGFX" type="GPUParticles2D"]
emitting = false
amount = 52
one_shot = true
explosiveness = 1.0
fixed_fps = 24
collision_base_size = 3.32
process_material = SubResource("ParticleProcessMaterial_wfuta")

View File

@@ -1,52 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://de5emerpbiknb"]
[ext_resource type="Script" uid="uid://v7tt4w6bejux" path="res://scripts/components/CleanupComponent.cs" id="1_lnlfk"]
[sub_resource type="Curve" id="Curve_lnlfk"]
_data = [Vector2(0.00771208, 1), 0.0, 0.0, 0, 0, Vector2(0.347044, 0.89662), -1.20644, -1.20644, 0, 0, Vector2(1, 0.0114315), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_a3r26"]
curve = SubResource("Curve_lnlfk")
[sub_resource type="Curve" id="Curve_et0te"]
_data = [Vector2(0, 1), 0.0, -2.46687, 0, 0, Vector2(0.192802, 0.6834), 0.0, 0.0, 0, 0, Vector2(0.449871, 1), -0.471266, -0.471266, 0, 0, Vector2(1, 0), -3.06444, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_lnlfk"]
width = 2048
curve = SubResource("Curve_et0te")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_a3r26"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 1.0
direction = Vector3(0, -1, 0)
spread = 0.93
flatness = 1.0
initial_velocity_min = 11.0
initial_velocity_max = 11.0
angular_velocity_min = -80.0
angular_velocity_max = -80.0
gravity = Vector3(0, 0, 0)
scale_min = 1.25
scale_max = 1.75
scale_curve = SubResource("CurveTexture_lnlfk")
color = Color(0.47451, 0.47451, 0.47451, 1)
alpha_curve = SubResource("CurveTexture_a3r26")
[node name="FootStepGfx" type="GPUParticles2D"]
emitting = false
amount = 42
lifetime = 2.0
one_shot = true
speed_scale = 2.0
explosiveness = 1.0
fixed_fps = 24
process_material = SubResource("ParticleProcessMaterial_a3r26")
[node name="CleanupComponent" type="Node" parent="."]
script = ExtResource("1_lnlfk")
metadata/_custom_type_script = "uid://v7tt4w6bejux"
[connection signal="finished" from="." to="CleanupComponent" method="CleanUp"]

View File

@@ -1,52 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://bqhondao5bm6k"]
[ext_resource type="Script" uid="uid://v7tt4w6bejux" path="res://scripts/components/CleanupComponent.cs" id="1_0051n"]
[sub_resource type="Curve" id="Curve_0051n"]
_data = [Vector2(0.00771208, 1), 0.0, 0.0, 0, 0, Vector2(0.347044, 0.89662), -1.20644, -1.20644, 0, 0, Vector2(1, 0.0114315), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_oxugj"]
curve = SubResource("Curve_0051n")
[sub_resource type="Curve" id="Curve_cc2b5"]
_data = [Vector2(0, 1), 0.0, -2.46687, 0, 0, Vector2(0.192802, 0.6834), 0.0, 0.0, 0, 0, Vector2(0.449871, 1), -0.471266, -0.471266, 0, 0, Vector2(1, 0), -3.06444, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_qdic5"]
width = 2048
curve = SubResource("Curve_cc2b5")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vwfwg"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 2.25
angle_min = 23.1
angle_max = 107.8
direction = Vector3(0, 1, 0)
spread = 4.0
initial_velocity_min = 8.0
initial_velocity_max = 8.0
angular_velocity_min = -80.0
angular_velocity_max = -80.0
gravity = Vector3(0, 0, 0)
scale_min = 3.0
scale_max = 4.0
scale_curve = SubResource("CurveTexture_qdic5")
alpha_curve = SubResource("CurveTexture_oxugj")
[node name="FootStepGfx" type="GPUParticles2D"]
emitting = false
amount = 64
lifetime = 2.0
one_shot = true
speed_scale = 4.0
explosiveness = 1.0
fixed_fps = 24
process_material = SubResource("ParticleProcessMaterial_vwfwg")
[node name="CleanupComponent" type="Node" parent="."]
script = ExtResource("1_0051n")
metadata/_custom_type_script = "uid://v7tt4w6bejux"
[connection signal="finished" from="." to="CleanupComponent" method="CleanUp"]

Some files were not shown because too many files have changed in this diff Show More