Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0d77e31
Created Puppets
LifeHckr Feb 5, 2025
fc51749
Refactoring
LifeHckr Feb 5, 2025
aba3e03
Added main menu with transition to battle and exit
Rmojarro1 Feb 7, 2025
450197b
Removed placeholder arrow, fixed loop missing, added player puppet
LifeHckr Feb 7, 2025
abea625
Create Effect Event system for notes and relics, Created Conductor class
LifeHckr Feb 7, 2025
b3c0a27
BattleEffectTrigger enum and WIP Note effects
LifeHckr Feb 7, 2025
3b73620
Added streamlined note on hit effect
LifeHckr Feb 8, 2025
36cef29
Removed debug scenepath length printing
LifeHckr Feb 10, 2025
b67fb1f
Merge branch 'Notes-N-Relics' into SceneTransition
LifeHckr Feb 10, 2025
a0d67a1
Merge pull request #46 from Project-Funk-Engine/SceneTransition
LifeHckr Feb 10, 2025
e367ff5
Created temp title screen
LifeHckr Feb 10, 2025
e0b2063
added note queue system
cornerloan Feb 10, 2025
c8b0227
Simple, working map generation
LifeHckr Feb 10, 2025
3137144
Begin fleshing out scene transitions
LifeHckr Feb 11, 2025
b1a27eb
Merge pull request #47 from Project-Funk-Engine/Notes-N-Relics
LifeHckr Feb 11, 2025
9f08b0e
Merge pull request #48 from Project-Funk-Engine/Inventory
LifeHckr Feb 11, 2025
5e97038
Merge branch 'Sprint-2' into note-effects
cornerloan Feb 11, 2025
2c5311a
temporary changes, will fix later
cornerloan Feb 11, 2025
3de4c2d
Simple Pause Menu
LifeHckr Feb 11, 2025
3b79813
added loading notes from JSON file
cornerloan Feb 11, 2025
1241600
Rough version of reward
Rmojarro1 Feb 11, 2025
91eb416
Reward menu approach
Rmojarro1 Feb 11, 2025
a7f9dee
updated battledirector to pull the note from queue
cornerloan Feb 12, 2025
9567f84
Added a reference to the Note in NoteArrow
cornerloan Feb 13, 2025
8403182
Merge pull request #49 from Project-Funk-Engine/RewardSystem
LifeHckr Feb 13, 2025
ee4dc88
Refactored Reward system
LifeHckr Feb 13, 2025
8e3ab6c
Merge branch 'Sprint-2' into note-effects
LifeHckr Feb 13, 2025
adf1705
Merge pull request #50 from Project-Funk-Engine/note-effects
LifeHckr Feb 13, 2025
cb1446e
Refactored note queue
LifeHckr Feb 14, 2025
692cf28
Simple Inventory menu implemented
LifeHckr Feb 11, 2025
175a64b
Map Scene and Damage number particle
LifeHckr Feb 12, 2025
55de3ec
Small cleanup
LifeHckr Feb 14, 2025
1cdd479
Updated reward selection to use display buttons
LifeHckr Feb 14, 2025
1f69fef
Firming up gameflow
LifeHckr Feb 14, 2025
74506ee
Added some relic art
LifeHckr Feb 16, 2025
4590b5c
Merge pull request #51 from Project-Funk-Engine/SomeUI
LifeHckr Feb 16, 2025
6f0e415
Update CoolBG.jpg
LifeHckr Feb 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Classes/Note.cs

This file was deleted.

55 changes: 55 additions & 0 deletions Classes/Notes/Note.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using FunkEngine;
using Godot;

/**
* @class Note
* @brief Data structure class for holding data and methods for a battle time note. WIP
*/
public partial class Note : Resource
{
public PuppetTemplate Owner;
public string Name;
private int _baseVal;
private Action<BattleDirector, Note, Timing> NoteEffect; //TODO: Where/How to deal with timing.

public string Tooltip;
public Texture2D Texture;

public Note(
string name,
string tooltip,
Texture2D texture = null,
PuppetTemplate owner = null,
int baseVal = 1,
Action<BattleDirector, Note, Timing> noteEffect = null
)
{
Name = name;
Owner = owner;
NoteEffect =
noteEffect
?? (
(BD, source, Timing) =>
{
BD.GetTarget(this).TakeDamage(source._baseVal);
}
);
_baseVal = baseVal;
Texture = texture;
Tooltip = tooltip;
}

public void OnHit(BattleDirector BD, Timing timing)
{
NoteEffect(BD, this, timing);
}

public Note Clone()
{
//Eventually could look into something more robust, but for now shallow copy is preferable.
//We only would want val and name to be copied by value
Note newNote = new Note(Name, Tooltip, Texture, Owner, _baseVal, NoteEffect);
return newNote;
}
}
Binary file added Classes/Notes/assets/double_note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://bucvj4fquqpkr"
path="res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"
uid="uid://caw70lr5e1yiq"
path="res://.godot/imported/double_note.png-1b788aee0b7f76d502303d178d821d3b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://scenes/NoteManager/assets/right-arrow.png"
dest_files=["res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"]
source_file="res://Classes/Notes/assets/double_note.png"
dest_files=["res://.godot/imported/double_note.png-1b788aee0b7f76d502303d178d821d3b.ctex"]

[params]

Expand Down
Binary file added Classes/Notes/assets/single_note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Classes/Notes/assets/single_note.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c3chrsxrulapd"
path="res://.godot/imported/single_note.png-edadc3d6779f4cc26ac823d186717719.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Notes/assets/single_note.png"
dest_files=["res://.godot/imported/single_note.png-edadc3d6779f4cc26ac823d186717719.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
31 changes: 31 additions & 0 deletions Classes/Relics/RelicEffect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using FunkEngine;
using Godot;

public partial class RelicEffect : IBattleEvent
{
private BattleEffectTrigger Trigger { get; set; }
public int BaseValue;
private Action<BattleDirector, int> OnRelicEffect;
Comment on lines +5 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use consistent property encapsulation and add documentation.

Consider using properties consistently and adding XML documentation for better maintainability.

+/// <summary>
+/// Represents an effect that can be triggered during battle.
+/// </summary>
 public partial class RelicEffect : IBattleEvent
 {
     private BattleEffectTrigger Trigger { get; set; }
-    public int BaseValue;
+    /// <summary>
+    /// Gets or sets the base value for this effect.
+    /// </summary>
+    public int BaseValue { get; set; }
     private Action<BattleDirector, int> OnRelicEffect;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public partial class RelicEffect : IBattleEvent
{
private BattleEffectTrigger Trigger { get; set; }
public int BaseValue;
private Action<BattleDirector, int> OnRelicEffect;
/// <summary>
/// Represents an effect that can be triggered during battle.
/// </summary>
public partial class RelicEffect : IBattleEvent
{
private BattleEffectTrigger Trigger { get; set; }
/// <summary>
/// Gets or sets the base value for this effect.
/// </summary>
public int BaseValue { get; set; }
private Action<BattleDirector, int> OnRelicEffect;
}


public RelicEffect(
BattleEffectTrigger trigger,
int val,
Action<BattleDirector, int> onRelicEffect
)
{
BaseValue = val;
Trigger = trigger;
OnRelicEffect = onRelicEffect;
}

public void OnTrigger(BattleDirector battleDirector)
{
OnRelicEffect(battleDirector, BaseValue);
}
Comment on lines +22 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null check before invoking OnRelicEffect.

Consider adding a null check to prevent potential NullReferenceException.

 public void OnTrigger(BattleDirector battleDirector)
 {
+    if (battleDirector == null)
+        throw new ArgumentNullException(nameof(battleDirector));
+
     OnRelicEffect(battleDirector, BaseValue);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public void OnTrigger(BattleDirector battleDirector)
{
OnRelicEffect(battleDirector, BaseValue);
}
public void OnTrigger(BattleDirector battleDirector)
{
if (battleDirector == null)
throw new ArgumentNullException(nameof(battleDirector));
OnRelicEffect(battleDirector, BaseValue);
}


public BattleEffectTrigger GetTrigger()
{
return Trigger;
}
}
31 changes: 31 additions & 0 deletions Classes/Relics/RelicTemplate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using FunkEngine;
using Godot;

public partial class RelicTemplate : Resource
{
public RelicEffect[] Effects;
public string Name;

public Texture2D Texture;
public string Tooltip;
Comment on lines +5 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use properties instead of public fields and add documentation.

Consider encapsulating fields as properties and adding XML documentation for better maintainability.

+/// <summary>
+/// Represents a template for game relics, defining their properties and effects.
+/// </summary>
 public partial class RelicTemplate : Resource
 {
-    public RelicEffect[] Effects;
-    public string Name;
-    public Texture2D Texture;
-    public string Tooltip;
+    /// <summary>
+    /// Gets or sets the effects associated with this relic.
+    /// </summary>
+    public RelicEffect[] Effects { get; set; }
+
+    /// <summary>
+    /// Gets or sets the name of the relic.
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// Gets or sets the texture used to display the relic.
+    /// </summary>
+    public Texture2D Texture { get; set; }
+
+    /// <summary>
+    /// Gets or sets the tooltip description of the relic.
+    /// </summary>
+    public string Tooltip { get; set; }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public partial class RelicTemplate : Resource
{
public RelicEffect[] Effects;
public string Name;
public Texture2D Texture;
public string Tooltip;
/// <summary>
/// Represents a template for game relics, defining their properties and effects.
/// </summary>
public partial class RelicTemplate : Resource
{
/// <summary>
/// Gets or sets the effects associated with this relic.
/// </summary>
public RelicEffect[] Effects { get; set; }
/// <summary>
/// Gets or sets the name of the relic.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the texture used to display the relic.
/// </summary>
public Texture2D Texture { get; set; }
/// <summary>
/// Gets or sets the tooltip description of the relic.
/// </summary>
public string Tooltip { get; set; }
}


public RelicTemplate(
string name = "",
string tooltip = "",
Texture2D texture = null,
RelicEffect[] EffectTags = null
)
{
Effects = EffectTags;
Name = name;
Tooltip = tooltip;
Texture = texture;
}

public RelicTemplate Clone()
{
RelicTemplate newRelic = new RelicTemplate(Name, Tooltip, Texture, Effects);
return newRelic;
}
Comment on lines +26 to +30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Implement deep copy for Effects array.

The current implementation performs a shallow copy of the Effects array, which could lead to shared state between clones.

 public RelicTemplate Clone()
 {
-    RelicTemplate newRelic = new RelicTemplate(Name, Tooltip, Texture, Effects);
+    RelicTemplate newRelic = new RelicTemplate(
+        Name,
+        Tooltip,
+        Texture,
+        Effects?.Select(effect => new RelicEffect(
+            effect.GetTrigger(),
+            effect.BaseValue,
+            effect.OnRelicEffect
+        )).ToArray()
+    );
     return newRelic;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public RelicTemplate Clone()
{
RelicTemplate newRelic = new RelicTemplate(Name, Tooltip, Texture, Effects);
return newRelic;
}
public RelicTemplate Clone()
{
RelicTemplate newRelic = new RelicTemplate(
Name,
Tooltip,
Texture,
Effects?.Select(effect => new RelicEffect(
effect.GetTrigger(),
effect.BaseValue,
effect.OnRelicEffect
)).ToArray()
);
return newRelic;
}

}
Binary file added Classes/Relics/assets/relic_Breakfast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Classes/Relics/assets/relic_Breakfast.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://csjx2hb4tdlw8"
path="res://.godot/imported/relic_Breakfast.png-c1b968058adbb855fcf957a2aec74dc2.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Relics/assets/relic_Breakfast.png"
dest_files=["res://.godot/imported/relic_Breakfast.png-c1b968058adbb855fcf957a2aec74dc2.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added Classes/Relics/assets/relic_GoodVibes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Classes/Relics/assets/relic_GoodVibes.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dg4tnp7plxmp7"
path="res://.godot/imported/relic_GoodVibes.png-cd102b29bb163411bb7ce8cf724ef0c0.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Relics/assets/relic_GoodVibes.png"
dest_files=["res://.godot/imported/relic_GoodVibes.png-cd102b29bb163411bb7ce8cf724ef0c0.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
3 changes: 3 additions & 0 deletions Funk Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace>FunkEngine</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="SaveData\SaveData.json" />
</ItemGroup>
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
<Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory="." />
Expand Down
57 changes: 57 additions & 0 deletions Globals/FunkEngineNameSpace.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Godot;

namespace FunkEngine;

public enum ArrowType
{
Up = 0,
Down = 1,
Left = 2,
Right = 3,
}

public enum BattleEffectTrigger
{
NotePlaced,
NoteHit,
SelfNoteHit,
OnPickup,
}

public enum Timing
{
Miss = 0,
Bad = 1,
Okay = 2,
Good = 3,
Perfect = 4,
}

public enum Stages
{
Title,
Battle,
Quit,
Map,
}

public struct SongData
{
public int Bpm;
public double SongLength;
public int NumLoops;
}

public struct ArrowData
{
public Color Color;
public string Key;
public NoteChecker Node;
public ArrowType Type;
}

public interface IBattleEvent
{
void OnTrigger(BattleDirector BD);
BattleEffectTrigger GetTrigger();
}
Loading