Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bd4b725
all text updated to support chinese
cornerloan Mar 3, 2025
c6537e3
Added translations for inventory
LifeHckr Mar 3, 2025
cdcd4fc
Generalized options menu
LifeHckr Mar 3, 2025
5df6243
Adjust controls
LifeHckr Mar 3, 2025
8426e01
Added setting config
LifeHckr Mar 4, 2025
b94886f
Replaced config with built in godot ConfigFile
LifeHckr Mar 4, 2025
3d91ead
Naive ACE checks in config
LifeHckr Mar 4, 2025
0209cbb
Added preemptive high contrast setting
LifeHckr Mar 4, 2025
0823415
Merge pull request #92 from Project-Funk-Engine/Refine_Menus
LifeHckr Mar 4, 2025
a1b6e02
Update gitignore for .translations
LifeHckr Mar 4, 2025
bd72d34
Merge pull request #93 from Project-Funk-Engine/localization
LifeHckr Mar 4, 2025
5341205
Save and loading functional
LifeHckr Mar 5, 2025
a054afd
I think this works the way we intend for it to?
cornerloan Mar 5, 2025
8a00a7a
Add contrast filter
collectioncard Mar 5, 2025
60b2d86
Merge branch 'SimpleSave' into Sprint-4
collectioncard Mar 5, 2025
f984030
Merge pull request #98 from Project-Funk-Engine/contrastMode
collectioncard Mar 5, 2025
d77a8e7
fixed all songs to have seamless looping
cornerloan Mar 5, 2025
a9c4446
Fix imperfect beat counting
LifeHckr Mar 5, 2025
6635486
Merge branch 'Sprint-4' into loop-fix-attempts
LifeHckr Mar 5, 2025
d6ea540
Merge pull request #99 from Project-Funk-Engine/loop-fix-attempts
LifeHckr Mar 5, 2025
d709955
Added basic controller support
Rmojarro1 Mar 5, 2025
a053421
Control Stick support
Rmojarro1 Mar 5, 2025
a2a0c8c
Prep controls for rebase
LifeHckr Mar 5, 2025
c30528d
Refactored control changes
LifeHckr Mar 5, 2025
b3faba1
Fix looped notes jumping
LifeHckr Mar 6, 2025
8492756
Merge pull request #102 from Project-Funk-Engine/ControllerSupport
LifeHckr Mar 6, 2025
56167f5
Changed save file handling
LifeHckr Mar 6, 2025
cc7c5d9
Move multi file globals to own folders
collectioncard Mar 6, 2025
dfc6654
Clean up shader code
collectioncard Mar 6, 2025
6747c7c
Update background, fix note queue sprites
LifeHckr Mar 6, 2025
3d3d328
Update to canvas_items stretch mode
LifeHckr Mar 7, 2025
d6dae53
placed notes now instantly do their effect
cornerloan Mar 8, 2025
4d8e55b
updated notes to use a base power level
cornerloan Mar 8, 2025
63668f2
enemy hp, note missing
cornerloan Mar 9, 2025
13bfc18
Get note beat directly from midi
LifeHckr Mar 9, 2025
9f6de6a
Add damage effects
LifeHckr Mar 11, 2025
e70fba9
added how to play
cornerloan Mar 11, 2025
01c5c87
Added note placement effect
LifeHckr Mar 11, 2025
14d7212
Clean up
LifeHckr Mar 11, 2025
1d75814
Merge pull request #103 from Project-Funk-Engine/game-balance
LifeHckr Mar 11, 2025
29d91a1
Merge remote-tracking branch 'origin/Sprint-4' into cleanup
LifeHckr Mar 11, 2025
9ac9c42
Merge pull request #104 from Project-Funk-Engine/cleanup
LifeHckr Mar 11, 2025
3eff6cf
Finalizing tweaks
LifeHckr Mar 11, 2025
df691b3
Make display buttons select on focus enter
LifeHckr Mar 11, 2025
5a5264f
Remove debug kill and "Relics" from battle frame
LifeHckr Mar 14, 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
.idea/.idea.Funk Engine/.idea/

*.DotSettings.user
export_presets.cfg
export_presets.cfg
*.translation
Binary file modified Audio/Song1.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion Audio/Song1.ogg.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://iq0xxe5cggs8"
uid="uid://be5ial13ynf3o"
path="res://.godot/imported/Song1.ogg-1d785b9ae3fbaa8393048e39af66ed86.oggvorbisstr"

[deps]
Expand Down
Binary file modified Audio/Song2.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion Audio/Song2.ogg.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://ckis6k6vuums"
uid="uid://dxp7blovqh1ba"
path="res://.godot/imported/Song2.ogg-b95c04f3512de6fa42e0f9c35aba831f.oggvorbisstr"

[deps]
Expand Down
Binary file modified Audio/Song3.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion Audio/Song3.ogg.import
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://ceyw5mjkem2pi"
uid="uid://d4nmixdl8xoic"
path="res://.godot/imported/Song3.ogg-d4e6a5f1a550561df18989fb495ba591.oggvorbisstr"

[deps]
Expand Down
Binary file modified Audio/midi/Song2.mid
Binary file not shown.
43 changes: 16 additions & 27 deletions Classes/MidiMaestro/MidiMaestro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public partial class MidiMaestro : Resource
{
private MidiFile _midiFile;

public static TempoMap TempoMap;
public static TimeSignature TimeSignature;

//The four note rows that we care about
private midiNoteInfo[] _upNotes;
private midiNoteInfo[] _downNotes;
Expand All @@ -18,8 +21,6 @@ public partial class MidiMaestro : Resource

//private MidiFile strippedSong;

private SongData songData;

//The path relative to the Audio folder. Will change later
public MidiMaestro(string filePath)
{
Expand All @@ -30,18 +31,20 @@ public MidiMaestro(string filePath)

if (!FileAccess.FileExists(filePath))
{
GD.PrintErr("ERROR: Unable to load level Midi file: " + filePath);
GD.PushError("ERROR: Unable to load level Midi file: " + filePath);
}

_midiFile = MidiFile.Read(filePath);
TempoMap = _midiFile.GetTempoMap();
TimeSignature = TempoMap.GetTimeSignatureAtTime(new MidiTimeSpan());

//Strip out the notes from the midi file
foreach (var track in _midiFile.GetTrackChunks())
{
string trackName = track.Events.OfType<SequenceTrackNameEvent>().FirstOrDefault()?.Text;
midiNoteInfo[] noteEvents = track
.GetNotes()
.Select(note => new midiNoteInfo(note, _midiFile.GetTempoMap()))
.Select(note => new midiNoteInfo(note))
.ToArray();

switch (trackName)
Expand All @@ -60,19 +63,6 @@ public MidiMaestro(string filePath)
break;
}
}

//Populate the song data
songData = new SongData
{
//TODO: Allow for changes in this data
Bpm = 120,
//Fudge the numbers a bit if we have a really short song
SongLength =
_midiFile.GetDuration<MetricTimeSpan>().Seconds < 20
? 20
: _midiFile.GetDuration<MetricTimeSpan>().Seconds,
NumLoops = 1,
};
}

public midiNoteInfo[] GetNotes(ArrowType arrowType)
Expand All @@ -86,30 +76,29 @@ public midiNoteInfo[] GetNotes(ArrowType arrowType)
_ => throw new ArgumentOutOfRangeException(nameof(arrowType), arrowType, null),
};
}

public SongData GetSongData()
{
return songData;
}
}

//A facade to wrap the midi notes. This is a simple class that wraps a Note object from the DryWetMidi library.
public class midiNoteInfo
{
private readonly Melanchall.DryWetMidi.Interaction.Note _note;
private readonly TempoMap _tempoMap;

public midiNoteInfo(Melanchall.DryWetMidi.Interaction.Note note, TempoMap tempoMap)
public midiNoteInfo(Melanchall.DryWetMidi.Interaction.Note note)
{
_note = note;
_tempoMap = tempoMap;
}

public long GetStartTimeBeat()
{
var beatsBar = _note.TimeAs<BarBeatTicksTimeSpan>(MidiMaestro.TempoMap);
return beatsBar.Bars * MidiMaestro.TimeSignature.Numerator + beatsBar.Beats;
}

public long GetStartTimeTicks() => _note.Time;

public float GetStartTimeSeconds() =>
_note.TimeAs<MetricTimeSpan>(_tempoMap).Milliseconds / 1000f
+ _note.TimeAs<MetricTimeSpan>(_tempoMap).Seconds;
_note.TimeAs<MetricTimeSpan>(MidiMaestro.TempoMap).Milliseconds / 1000f
+ _note.TimeAs<MetricTimeSpan>(MidiMaestro.TempoMap).Seconds;

public long GetEndTime() => _note.EndTime;

Expand Down
23 changes: 20 additions & 3 deletions Classes/Notes/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
public partial class Note : Resource, IDisplayable
{
public PuppetTemplate Owner;
public int Id;
public string Name { get; set; }
private int _baseVal;
public float CostModifier { get; private set; }
private Action<BattleDirector, Note, Timing> NoteEffect; //TODO: Where/How to deal with timing.
private Action<BattleDirector, Note, Timing> NoteEffect;

public string Tooltip { get; set; }
public Texture2D Texture { get; set; }

public Note(
int id,
string name,
string tooltip,
Texture2D texture = null,
Expand All @@ -27,14 +29,15 @@ public Note(
float costModifier = 1.0f
)
{
Id = id;
Name = name;
Owner = owner;
NoteEffect =
noteEffect
?? (
(BD, source, Timing) =>
{
BD.GetTarget(this).TakeDamage(source._baseVal);
BD.GetTarget(this).TakeDamage((int)Timing * source._baseVal);
}
);
_baseVal = baseVal;
Expand All @@ -52,7 +55,21 @@ 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, CostModifier);
Note newNote = new Note(
Id,
Name,
Tooltip,
Texture,
Owner,
_baseVal,
NoteEffect,
CostModifier
);
return newNote;
}

public int GetBaseVal()
{
return _baseVal;
}
}
9 changes: 6 additions & 3 deletions Classes/Relics/RelicTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@
public partial class RelicTemplate : Resource, IDisplayable
{
public RelicEffect[] Effects;
public int Id;
public string Name { get; set; }

public Texture2D Texture { get; set; }
public string Tooltip { get; set; }

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

public RelicTemplate Clone()
{
RelicTemplate newRelic = new RelicTemplate(Name, Tooltip, Texture, Effects);
RelicTemplate newRelic = new RelicTemplate(Id, Name, Tooltip, Texture, Effects);
return newRelic;
}
}
2 changes: 1 addition & 1 deletion Funk Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RootNamespace>FunkEngine</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="SaveData\SaveData.json" />
<Content Include="Globals\translations.csv" />
<PackageReference Include="Melanchall.DryWetMidi" Version="7.2.0" />
</ItemGroup>
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://csx04jwaoo20u"]

[ext_resource type="Script" path="res://Globals/BgAudioPlayer.cs" id="1_w7def"]
[ext_resource type="Script" path="res://Globals/BgAudioPlayer/BgAudioPlayer.cs" id="1_w7def"]

[node name="BgAudioPlayer" type="AudioStreamPlayer"]
script = ExtResource("1_w7def")
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public partial class BgAudioPlayer : AudioStreamPlayer

private void PlayMusic(AudioStream music, float volume)
{
ProcessMode = ProcessModeEnum.Always;
if (Playing && music.Equals(Stream))
{
return;
Expand Down
10 changes: 10 additions & 0 deletions Globals/ContrastFilter/ContrastFilter.gdshader
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;

void fragment() {
vec4 screen = texture(SCREEN_TEXTURE, SCREEN_UV);

COLOR.rgb =vec3(0.6 * screen.r + 0.6 * screen.g + 0.2 * screen.b);
}

19 changes: 19 additions & 0 deletions Globals/ContrastFilter/ContrastFilter.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=3 uid="uid://b6bblgxtfs020"]

[ext_resource type="Shader" path="res://Globals/ContrastFilter/ContrastFilter.gdshader" id="1_4bhca"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_i6hl4"]
shader = ExtResource("1_4bhca")

[node name="CanvasLayer" type="CanvasLayer"]
layer = 128

[node name="Filter" type="ColorRect" parent="."]
z_index = 4096
material = SubResource("ShaderMaterial_i6hl4")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
15 changes: 7 additions & 8 deletions Globals/FunkEngineNameSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public enum Stages
Boss,
Quit,
Map,
Controls,
Load,
}

public class MapGrid
Expand All @@ -78,6 +78,12 @@ public Room[] GetRooms()

public class Room
{
public int Idx { get; private set; }
public int[] Children { get; private set; } = Array.Empty<int>();
public int X { get; private set; }
public int Y { get; private set; }
public Stages Type { get; private set; }

public Room(int idx, int x, int y)
{
Idx = idx;
Expand All @@ -96,12 +102,6 @@ public void AddChild(int newIdx)
return;
Children = Children.Append(newIdx).ToArray();
}

public int Idx { get; private set; }
public int[] Children { get; private set; } = Array.Empty<int>();
public int X { get; private set; }
public int Y { get; private set; }
public Stages Type { get; private set; }
}

public void InitMapGrid(int width, int height, int paths)
Expand Down Expand Up @@ -166,7 +166,6 @@ private void CreateCommonChildren(int width, int height)
continue;
if (_map[curPos.X, curPos.Y + 1] == 0)
continue;
GD.Print("Added child on same X.");
room.AddChild(_map[curPos.X, curPos.Y + 1]);
}
}
Expand Down
Loading