From a3696424d034fe4b64f9ddd8f4122754904440e0 Mon Sep 17 00:00:00 2001 From: Conor Edmonds Date: Tue, 26 May 2026 19:06:54 -0400 Subject: [PATCH] first commit --- .editorconfig | 4 ++++ .gitattributes | 2 ++ .gitignore | 3 +++ Attack.cs | 29 +++++++++++++++++++++++++++ Attack.cs.uid | 1 + Main.cs | 6 ++++++ Main.cs.uid | 1 + PeggleRoguelike.csproj | 7 +++++++ PeggleRoguelike.sln | 19 ++++++++++++++++++ Player.cs | 41 +++++++++++++++++++++++++++++++++++++++ Player.cs.uid | 1 + attack.tscn | 20 +++++++++++++++++++ circle25r.png | Bin 0 -> 1017 bytes circle25r.png.import | 40 ++++++++++++++++++++++++++++++++++++++ icon.svg | 1 + icon.svg.import | 43 +++++++++++++++++++++++++++++++++++++++++ main.tscn | 9 +++++++++ player.tscn | 6 ++++++ project.godot | 36 ++++++++++++++++++++++++++++++++++ 19 files changed, 269 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Attack.cs create mode 100644 Attack.cs.uid create mode 100644 Main.cs create mode 100644 Main.cs.uid create mode 100644 PeggleRoguelike.csproj create mode 100644 PeggleRoguelike.sln create mode 100644 Player.cs create mode 100644 Player.cs.uid create mode 100644 attack.tscn create mode 100644 circle25r.png create mode 100644 circle25r.png.import create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 main.tscn create mode 100644 player.tscn create mode 100644 project.godot 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 0000000000000000000000000000000000000000..977cf31e793ff36396dab6fe4c50e8140e6f7fc9 GIT binary patch literal 1017 zcmVEX>4Tx04R}tk-tmBKpe$iTT4YM3U-jR@u|FKE(` zq_{W=t_25wELI&{oON|@6$HT_ApQa3r060gelIDsi1FaK5AW_h?%o03MujOx*Epc4 zrk;w&glukA2)x3NF#0iyS&-f5dhp%^0p5=b-&(SOA4F-4w;yI@2Ch-RG z^roqC-X{*Rk|-0O6OZY1LE=ZQOAfzrF52wnnIS!snkNns3&jqWI+&Gog?NfMA}cE8 zd$SJ9oVPeDl^Sc^lfN*SS69+pr#XZ;mXJUa0wmN>Mg=CKw5p^SNYQ@G#UHl)NpeZ# zDua<@0aYjvZ9n)Q{O;B$OinmS!5H9wv8<0_Ag~KG>z4I>Y+20{!1oMXscnC?0nB`o zUT(jIWR0}MWCqAuE!kEXX!0N&5&n{vRwEzq;(^w!$P=>w3Vu9k0r zgF|4XNZIQy@9ysG?cX!4{(b-mh;riu0!POH000JJOGiWi{{a60|De66lK=n!32;bR za{vG?BLDy{BLR4&KXw2B00(qQO+^Rl1sV`60!LN@Jpcdz8FWQhbVF}#ZDnqB07G(R zVRU6=Aa`kWXdp*PO;A^X4i^9b0nSN8K~!ko-I_g50znXlAGS2M)YfNE6I(lM4IMwh z!p^@zCpB1m3868z+S!^QL|dsTHFWw~IG3C#C?CqrJ_*T%kGpxY6LxoIOOjX-32*@H z+w~Su1~%;TF)#v#z$0)6+}ichl$I3P0qQ^v*jw-(J>U}P0R4p{k+jIGD(OP2=fdti zcTDsCpdzWQzo%`_`V)~8Nl*Gep6r<`6Ddn-YJD^RICN*p z%u1(J#Uq`TX46EPDlX06ikztUeEBz(WB zz%{-&1a2lrt(sDA*>&JHxQ5BJ!Gf z3|1BQ&Rww5zISf3)ap5w=w+z|AN>ihT;?}c9mgV_yhtBN9ZIAY`=>Ql%b`dszeLHn z0nQysoLkIaL;%j5%=ANxm1!aapy5EIL9Xr##NAeis?ifo>n*BgXjJX#s16K7cZ8$R nhialZ=CrKHr}`^vJb3mF&>?S#pgv%j00000NkvXXu0mjf`clFT literal 0 HcmV?d00001 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"