-
Notifications
You must be signed in to change notification settings - Fork 0
Game beautification #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1412851
7595ae4
5276383
3a11a5b
fdcac57
fbdbaf7
af12534
0f950db
0626651
5471c93
df12691
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| [remap] | ||
|
|
||
| importer="texture" | ||
| type="CompressedTexture2D" | ||
| uid="uid://cdf3g3174du4r" | ||
| path="res://.godot/imported/heal_note.png-09ca289a296eee82d33c64101a4e593a.ctex" | ||
| metadata={ | ||
| "vram_texture": false | ||
| } | ||
|
|
||
| [deps] | ||
|
|
||
| source_file="res://Classes/Notes/assets/heal_note.png" | ||
| dest_files=["res://.godot/imported/heal_note.png-09ca289a296eee82d33c64101a4e593a.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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| [remap] | ||
|
|
||
| importer="texture" | ||
| type="CompressedTexture2D" | ||
| uid="uid://uksjoqp7p0gq" | ||
| path="res://.godot/imported/quarter_note.png-2b4c9985d99038807abfd63e553c2d6a.ctex" | ||
| metadata={ | ||
| "vram_texture": false | ||
| } | ||
|
|
||
| [deps] | ||
|
|
||
| source_file="res://Classes/Notes/assets/quarter_note.png" | ||
| dest_files=["res://.godot/imported/quarter_note.png-2b4c9985d99038807abfd63e553c2d6a.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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| [remap] | ||
|
|
||
| importer="texture" | ||
| type="CompressedTexture2D" | ||
| uid="uid://dg0lmu0pip4lr" | ||
| path="res://.godot/imported/vampire_note.png-4331f817a6feee1f1066a9e9f95934c8.ctex" | ||
| metadata={ | ||
| "vram_texture": false | ||
| } | ||
|
|
||
| [deps] | ||
|
|
||
| source_file="res://Classes/Notes/assets/vampire_note.png" | ||
| dest_files=["res://.godot/imported/vampire_note.png-4331f817a6feee1f1066a9e9f95934c8.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 |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,7 +1,24 @@ | ||||
| using Godot; | ||||
| using System; | ||||
| using System.Linq; | ||||
| using Godot; | ||||
|
|
||||
| namespace FunkEngine; | ||||
|
|
||||
| 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 enum ArrowType | ||||
| { | ||||
| Up = 0, | ||||
|
|
@@ -10,14 +27,6 @@ | |||
| Right = 3, | ||||
| } | ||||
|
|
||||
| public enum BattleEffectTrigger | ||||
| { | ||||
| NotePlaced, | ||||
| NoteHit, | ||||
| SelfNoteHit, | ||||
| OnPickup, | ||||
| } | ||||
|
|
||||
| public enum Timing | ||||
| { | ||||
| Miss = 0, | ||||
|
|
@@ -27,6 +36,22 @@ | |||
| Perfect = 4, | ||||
| } | ||||
|
|
||||
| public struct BattleConfig | ||||
| { | ||||
| public MapRooms RoomType { get; private set; } | ||||
| public MapGrid.Room CurRoom { get; private set; } | ||||
| public SongData CurSong { get; set; } | ||||
| public int TodoEnemyAndChart; | ||||
| } | ||||
|
|
||||
| public enum BattleEffectTrigger | ||||
| { | ||||
| NotePlaced, | ||||
| NoteHit, | ||||
| SelfNoteHit, | ||||
| OnPickup, | ||||
| } | ||||
|
|
||||
| public enum Stages | ||||
| { | ||||
| Title, | ||||
|
|
@@ -35,19 +60,127 @@ | |||
| Map, | ||||
| } | ||||
|
|
||||
| public struct SongData | ||||
| public enum MapRooms | ||||
| { | ||||
| public int Bpm; | ||||
| public double SongLength; | ||||
| public int NumLoops; | ||||
| Battle, | ||||
| Chest, | ||||
| Boss, | ||||
| } | ||||
|
|
||||
| public struct ArrowData | ||||
| public class MapGrid | ||||
| { | ||||
| public Color Color; | ||||
| public string Key; | ||||
| public NoteChecker Node; | ||||
| public ArrowType Type; | ||||
| private int[,] _map; | ||||
| private Room[] _rooms; | ||||
| private int _curIdx = 0; | ||||
| private int _curRoom = 0; | ||||
|
Check warning on line 75 in Globals/FunkEngineNameSpace.cs
|
||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused field _curRoom. The field - private int _curRoom = 0;📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: build[warning] 75-75: [warning] 75-75: |
||||
|
|
||||
| public Room[] GetRooms() | ||||
| { | ||||
| return _rooms; | ||||
| } | ||||
|
|
||||
| public class Room | ||||
| { | ||||
| public Room(int idx, int x, int y) | ||||
| { | ||||
| Idx = idx; | ||||
| X = x; | ||||
| Y = y; | ||||
| } | ||||
|
|
||||
| public void SetType(MapRooms type) | ||||
| { | ||||
| Type = type; | ||||
| } | ||||
|
|
||||
| public void AddChild(int newIdx) | ||||
| { | ||||
| if (Children.Contains(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 MapRooms Type { get; private set; } | ||||
| } | ||||
|
|
||||
| public void InitMapGrid(int width, int height, int paths) | ||||
| { | ||||
| _curIdx = 0; | ||||
| _rooms = Array.Empty<Room>(); | ||||
| _map = new int[width, height]; //x,y | ||||
|
|
||||
| int startX = (width / 2); | ||||
| _rooms = _rooms.Append(new Room(_curIdx, startX, 0)).ToArray(); | ||||
| _map[startX, 0] = _curIdx++; | ||||
|
|
||||
| for (int i = 0; i < paths; i++) | ||||
| { | ||||
| GeneratePath_r(startX, 0, width, height); | ||||
| } | ||||
| CreateCommonChildren(width, height); | ||||
| AddBossRoom(width, height); | ||||
| } | ||||
|
|
||||
| //Start at x, y, assume prev room exists. Picks new x pos within +/- 1, attaches recursively | ||||
| private void GeneratePath_r(int x, int y, int width, int height) | ||||
| { | ||||
| int nextX = StageProducer.GlobalRng.RandiRange( | ||||
| Math.Max(x - 1, 0), | ||||
| Math.Min(x + 1, width - 1) | ||||
| ); | ||||
| if (_map[nextX, y + 1] == 0) | ||||
| { | ||||
| _rooms = _rooms.Append(new Room(_curIdx, nextX, y + 1)).ToArray(); | ||||
| _map[nextX, y + 1] = _curIdx; | ||||
| _rooms[_map[x, y]].AddChild(_curIdx++); | ||||
| _rooms[^1].SetType(MapRooms.Battle); | ||||
| if (y > 0 && y % 3 == 0) | ||||
| { | ||||
| _rooms[^1].SetType(MapRooms.Chest); | ||||
| } | ||||
| } | ||||
| else | ||||
| { | ||||
| _rooms[_map[x, y]].AddChild(_map[nextX, y + 1]); | ||||
| } | ||||
| if (y < height - 2) | ||||
| { | ||||
| GeneratePath_r(nextX, y + 1, width, height); | ||||
| } | ||||
| } | ||||
|
|
||||
| //Asserts that if there is a room at the same x, but y+1 they are connected | ||||
| private void CreateCommonChildren(int width, int height) | ||||
| { | ||||
| foreach (Room room in _rooms) | ||||
| { | ||||
| Vector2I curPos = new Vector2I(room.X, room.Y); | ||||
| if (room.Y + 1 >= 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]); | ||||
| } | ||||
| } | ||||
|
|
||||
| //Adds a boss room at the end of rooms, all max height rooms connect to it. | ||||
| private void AddBossRoom(int width, int height) | ||||
| { | ||||
| _rooms = _rooms.Append(new Room(_curIdx, width / 2, height)).ToArray(); | ||||
| _rooms[_curIdx].SetType(MapRooms.Boss); | ||||
| for (int i = 0; i < width; i++) //Attach all last rooms to a boss room | ||||
| { | ||||
| if (_map[i, height - 1] != 0) | ||||
| { | ||||
| _rooms[_map[i, height - 1]].AddChild(_curIdx); | ||||
| } | ||||
| } | ||||
| } | ||||
| } | ||||
|
|
||||
| public interface IBattleEvent | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,40 @@ public partial class Scribe : Node | |
| director.Enemy.TakeDamage(2 * (int)timing); | ||
| } | ||
| ), | ||
| new Note( | ||
| "PlayerHeal", | ||
| "Basic player note, heals player", | ||
| GD.Load<Texture2D>("res://Classes/Notes/assets/heal_note.png"), | ||
| null, | ||
| 1, | ||
| (director, note, timing) => | ||
| { | ||
| director.Player.Heal((int)timing); | ||
| } | ||
| ), | ||
| new Note( | ||
| "PlayerVampire", | ||
| "Steals health from enemy", | ||
| GD.Load<Texture2D>("res://Classes/Notes/assets/vampire_note.png"), | ||
| null, | ||
| 1, | ||
| (director, note, timing) => | ||
| { | ||
| director.Player.Heal((int)timing); | ||
| director.Enemy.TakeDamage((int)timing); | ||
| } | ||
| ), | ||
| new Note( | ||
| "PlayerQuarter", | ||
| "Basic note at a quarter of the cost", | ||
| GD.Load<Texture2D>("res://Classes/Notes/assets/quarter_note.png"), | ||
| null, | ||
| 1, | ||
| (director, note, timing) => | ||
| { | ||
| director.Enemy.TakeDamage((int)timing); | ||
| } | ||
| ), | ||
|
Comment on lines
+71
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveConsider adding cost validation for PlayerQuarter note. While the implementation is correct, consider adding validation to ensure the quarter cost is properly enforced. 🏁 Script executed: #!/bin/bash
# Search for cost validation in NotePlacementBar
ast-grep --pattern 'CanPlaceNote($_) {
$$$
if ($_ == "PlayerQuarter") {
$$$
}
$$$
}'Length of output: 98 Action Required: Add explicit cost validation for "PlayerQuarter" in the cost-checking logic.
|
||
| }; | ||
|
|
||
| public static readonly RelicTemplate[] RelicDictionary = new[] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Rename and document the TodoEnemyAndChart field.
The field name suggests incomplete implementation. Consider:
Would you like me to help implement this feature or create an issue to track it?