first commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
@@ -0,0 +1,2 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
@@ -0,0 +1,3 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
/android/
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dm2gyxmgwbmg8
|
||||
@@ -0,0 +1,6 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Main : Node
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cg1m762ed04kv
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.6.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net9.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -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
|
||||
@@ -0,0 +1,41 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Player : Node2D
|
||||
{
|
||||
public bool _aiming = false;
|
||||
public PackedScene _attackScene = GD.Load<PackedScene>("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<Attack>();
|
||||
_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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b2kj0rc3g1hkm
|
||||
+20
@@ -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"]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1017 B |
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||
|
After Width: | Height: | Size: 995 B |
@@ -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
|
||||
@@ -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")]
|
||||
@@ -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")
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user