commit a3696424d034fe4b64f9ddd8f4122754904440e0 Author: Conor Edmonds Date: Tue May 26 19:06:54 2026 -0400 first commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Attack.cs b/Attack.cs new file mode 100644 index 0000000..475ad7f --- /dev/null +++ b/Attack.cs @@ -0,0 +1,29 @@ +using Godot; + +public partial class Attack : RigidBody2D +{ + public bool _hovered = false; + public Vector2 _speed; + + public override void _PhysicsProcess(double delta) + { + base._PhysicsProcess(delta); + if (_speed != Vector2.Zero){ + ApplyCentralForce(_speed); + _speed = Vector2.Zero; + } + } + + public void Shoot(Vector2 FORCE){ + _speed = FORCE; + GravityScale = 1; + } + public void OnMouseEntered(){ + GD.Print("Hovered"); + _hovered = true; + } + public void OnMouseExited(){ + GD.Print("Not Hovered"); + _hovered = true; + } +} diff --git a/Attack.cs.uid b/Attack.cs.uid new file mode 100644 index 0000000..59afa56 --- /dev/null +++ b/Attack.cs.uid @@ -0,0 +1 @@ +uid://dm2gyxmgwbmg8 diff --git a/Main.cs b/Main.cs new file mode 100644 index 0000000..1ca81cf --- /dev/null +++ b/Main.cs @@ -0,0 +1,6 @@ +using Godot; +using System; + +public partial class Main : Node +{ +} diff --git a/Main.cs.uid b/Main.cs.uid new file mode 100644 index 0000000..2831814 --- /dev/null +++ b/Main.cs.uid @@ -0,0 +1 @@ +uid://cg1m762ed04kv diff --git a/PeggleRoguelike.csproj b/PeggleRoguelike.csproj new file mode 100644 index 0000000..63a009f --- /dev/null +++ b/PeggleRoguelike.csproj @@ -0,0 +1,7 @@ + + + net8.0 + net9.0 + true + + \ No newline at end of file diff --git a/PeggleRoguelike.sln b/PeggleRoguelike.sln new file mode 100644 index 0000000..a5b42e5 --- /dev/null +++ b/PeggleRoguelike.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeggleRoguelike", "PeggleRoguelike.csproj", "{B0383B61-BE9F-4033-BF8F-7A23B06017C6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + ExportDebug|Any CPU = ExportDebug|Any CPU + ExportRelease|Any CPU = ExportRelease|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU + {B0383B61-BE9F-4033-BF8F-7A23B06017C6}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU + EndGlobalSection +EndGlobal diff --git a/Player.cs b/Player.cs new file mode 100644 index 0000000..7a86eac --- /dev/null +++ b/Player.cs @@ -0,0 +1,41 @@ +using Godot; +using System; + +public partial class Player : Node2D +{ + public bool _aiming = false; + public PackedScene _attackScene = GD.Load("res://Attack.tscn"); + public Attack _currentAttack; + public override void _Process(double delta) + { + base._Process(delta); + if (_currentAttack == null){ + GD.Print("Loading attack"); + _currentAttack = _attackScene.Instantiate(); + _currentAttack.GravityScale = 0; + _currentAttack.Position = GetViewportRect().Size / 2; + AddChild(_currentAttack); + } + if (Input.IsActionJustPressed("leftClick")){ + if (_currentAttack._hovered){ + _aiming = true; + } + } + if (_aiming){ + Vector2 offset = (_currentAttack.GlobalPosition - GetGlobalMousePosition()) * 500; + if (Input.IsActionJustReleased("leftClick")){ + ShootCurrentAttack(offset); + } + } + if (_currentAttack.Position.Y > GetViewportRect().Size.Y + 50){ + _currentAttack.QueueFree(); + _currentAttack = null; + } + } + + public void ShootCurrentAttack(Vector2 FORCE){ + GD.Print("Shooting attack"); + _currentAttack.Shoot(FORCE); + _aiming = false; + } +} diff --git a/Player.cs.uid b/Player.cs.uid new file mode 100644 index 0000000..1d31571 --- /dev/null +++ b/Player.cs.uid @@ -0,0 +1 @@ +uid://b2kj0rc3g1hkm diff --git a/attack.tscn b/attack.tscn new file mode 100644 index 0000000..0e50fdb --- /dev/null +++ b/attack.tscn @@ -0,0 +1,20 @@ +[gd_scene format=3 uid="uid://cevk7yax5tvej"] + +[ext_resource type="Script" uid="uid://dm2gyxmgwbmg8" path="res://Attack.cs" id="1_63pi1"] +[ext_resource type="Texture2D" uid="uid://nwj4n7if8kqd" path="res://circle25r.png" id="2_hqc8w"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_7yfhp"] +radius = 25.0 + +[node name="Attack" type="RigidBody2D" unique_id=1225359241] +input_pickable = true +script = ExtResource("1_63pi1") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1448070524] +shape = SubResource("CircleShape2D_7yfhp") + +[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1583277900] +texture = ExtResource("2_hqc8w") + +[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] +[connection signal="mouse_exited" from="." to="." method="OnMouseExited"] diff --git a/circle25r.png b/circle25r.png new file mode 100644 index 0000000..977cf31 Binary files /dev/null and b/circle25r.png differ diff --git a/circle25r.png.import b/circle25r.png.import new file mode 100644 index 0000000..0024eec --- /dev/null +++ b/circle25r.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://nwj4n7if8kqd" +path="res://.godot/imported/circle25r.png-c9fb4b684a66f0e267203a51f53bbccb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://circle25r.png" +dest_files=["res://.godot/imported/circle25r.png-c9fb4b684a66f0e267203a51f53bbccb.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..6d31319 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbexs2qdpapd4" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..d051b5b --- /dev/null +++ b/main.tscn @@ -0,0 +1,9 @@ +[gd_scene format=3 uid="uid://dcp7p6al4i0b7"] + +[ext_resource type="Script" uid="uid://cg1m762ed04kv" path="res://Main.cs" id="1_ig7tw"] +[ext_resource type="PackedScene" uid="uid://c78e3u1owgiek" path="res://player.tscn" id="2_0xm2m"] + +[node name="Main" type="Node" unique_id=535208469] +script = ExtResource("1_ig7tw") + +[node name="Player" parent="." unique_id=203629164 instance=ExtResource("2_0xm2m")] diff --git a/player.tscn b/player.tscn new file mode 100644 index 0000000..beba6ee --- /dev/null +++ b/player.tscn @@ -0,0 +1,6 @@ +[gd_scene format=3 uid="uid://c78e3u1owgiek"] + +[ext_resource type="Script" uid="uid://b2kj0rc3g1hkm" path="res://Player.cs" id="1_4flbx"] + +[node name="Player" type="Node2D" unique_id=203629164] +script = ExtResource("1_4flbx") diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..de16239 --- /dev/null +++ b/project.godot @@ -0,0 +1,36 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="PeggleRoguelike" +run/main_scene="uid://dcp7p6al4i0b7" +config/features=PackedStringArray("4.6", "C#", "Forward Plus") +config/icon="res://icon.svg" + +[dotnet] + +project/assembly_name="PeggleRoguelike" + +[input] + +leftClick={ +"deadzone": 0.2, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(74, 17),"global_position":Vector2(83, 65),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +rendering_device/driver.windows="d3d12"