7-7-25 6:40pm

This commit is contained in:
2025-07-07 18:40:20 -04:00
parent 435f375c93
commit cdf94c4bdf
37 changed files with 1930 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
using Godot;
using System;
public partial class Main : Node
{
// Don't forget to rebuild the project so the editor knows about the new export variable.
[Export]
public PackedScene MobScene { get; set; }
private int _score;
public override void _Ready()
{
NewGame();
}
public void GameOver()
{
GetNode<Timer>("MobTimer").Stop();
GetNode<Timer>("ScoreTimer").Stop();
}
public void NewGame()
{
_score = 0;
var player = GetNode<Marble>("Marble");
var startPosition = GetNode<Marker2D>("StartPosition");
player.Start(startPosition.Position);
GetNode<Timer>("StartTimer").Start();
}
// We also specified this function name in PascalCase in the editor's connection window.
private void OnScoreTimerTimeout()
{
_score++;
}
// We also specified this function name in PascalCase in the editor's connection window.
private void OnStartTimerTimeout()
{
GetNode<Timer>("MobTimer").Start();
GetNode<Timer>("ScoreTimer").Start();
}
private void OnMobTimerTimeout()
{
// Create a new instance of the Mob scene.
Mob mob = MobScene.Instantiate<Mob>();
// Choose a random location on Path2D.
var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");
mobSpawnLocation.ProgressRatio = GD.Randf();
// Set the mob's direction perpendicular to the path direction.
float direction = mobSpawnLocation.Rotation + Mathf.Pi / 2;
// Set the mob's position to a random location.
mob.Position = mobSpawnLocation.Position;
// Add some randomness to the direction.
direction += (float)GD.RandRange(-Mathf.Pi / 4, Mathf.Pi / 4);
mob.Rotation = direction;
// Choose the velocity.
var velocity = new Vector2((float)GD.RandRange(150.0, 250.0), 0);
mob.LinearVelocity = velocity.Rotated(direction);
// Spawn the mob by adding it to the Main scene.
AddChild(mob);
}
}
+1
View File
@@ -0,0 +1 @@
uid://v6ovq4snxruc
+18
View File
@@ -0,0 +1,18 @@
using Godot;
using System;
public partial class Mob : RigidBody2D
{
public override void _Ready()
{
var animatedSprite2D = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
string[] mobTypes = animatedSprite2D.SpriteFrames.GetAnimationNames();
animatedSprite2D.Play(mobTypes[GD.Randi() % mobTypes.Length]);
}
// We also specified this function name in PascalCase in the editor's connection window.
private void OnVisibleOnScreenNotifier2DScreenExited()
{
QueueFree();
}
}
+1
View File
@@ -0,0 +1 @@
uid://bmqxvh0q486kb
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2023 The Godot Engine community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,12 @@
[configuration]
entry_symbol = "git_plugin_init"
compatibility_minimum = "4.1.0"
[libraries]
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
linux.editor.rv64 = ""
@@ -0,0 +1 @@
uid://bhdyd6xrovc6
+7
View File
@@ -0,0 +1,7 @@
[plugin]
name="Godot Git Plugin"
description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
author="twaritwaikar"
version="v3.1.1"
script="godot-git-plugin.gd"
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1xpmsur8h7bt"
path="res://.godot/imported/enemyFlyingAlt_1.png-122fb22640a174075ff6bc1c8de9ef4b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemyFlyingAlt_1.png"
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-122fb22640a174075ff6bc1c8de9ef4b.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://duyxe6bvilcac"
path="res://.godot/imported/enemyFlyingAlt_2.png-36b0a0d446f525b984c4e8bd335e811c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemyFlyingAlt_2.png"
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-36b0a0d446f525b984c4e8bd335e811c.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1cq0yledu7sl"
path="res://.godot/imported/enemySwimming_1.png-7968befc57e9c94b5179ed7bf6a69e9f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemySwimming_1.png"
dest_files=["res://.godot/imported/enemySwimming_1.png-7968befc57e9c94b5179ed7bf6a69e9f.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dr6tqvwcfdwpv"
path="res://.godot/imported/enemySwimming_2.png-bf5cf15c885fdd416bd5ca8e6aae9642.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemySwimming_2.png"
dest_files=["res://.godot/imported/enemySwimming_2.png-bf5cf15c885fdd416bd5ca8e6aae9642.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dxudw2rt0l078"
path="res://.godot/imported/enemyWalking_1.png-cb9fd27cc5ab93dedf6a051d16055638.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemyWalking_1.png"
dest_files=["res://.godot/imported/enemyWalking_1.png-cb9fd27cc5ab93dedf6a051d16055638.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c2usp1a4mowsj"
path="res://.godot/imported/enemyWalking_2.png-921b64c7dfb8652228a4ffd707d9669c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemyWalking_2.png"
dest_files=["res://.godot/imported/enemyWalking_2.png-921b64c7dfb8652228a4ffd707d9669c.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
+39
View File
@@ -0,0 +1,39 @@
[gd_scene load_steps=5 format=3 uid="uid://yqtgkxjjexag"]
[ext_resource type="Script" uid="uid://v6ovq4snxruc" path="res://Main.cs" id="1_0xm2m"]
[ext_resource type="PackedScene" uid="uid://cfnyfjhp8v5gw" path="res://mob.tscn" id="2_1bvp3"]
[ext_resource type="PackedScene" uid="uid://c8n4lue2bn25n" path="res://marble.tscn" id="2_h2yge"]
[sub_resource type="Curve2D" id="Curve2D_1bvp3"]
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1152, 0, 0, 0, 0, 0, 1152, 648, 0, 0, 0, 0, 0, 648, 0, 0, 0, 0, 0, 0)
}
point_count = 5
[node name="Main" type="Node"]
script = ExtResource("1_0xm2m")
MobScene = ExtResource("2_1bvp3")
[node name="Marble" parent="." instance=ExtResource("2_h2yge")]
[node name="MobTimer" type="Timer" parent="."]
wait_time = 0.5
[node name="ScoreTimer" type="Timer" parent="."]
[node name="StartTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[node name="StartPosition" type="Marker2D" parent="."]
position = Vector2(240, 450)
[node name="MobPath" type="Path2D" parent="."]
curve = SubResource("Curve2D_1bvp3")
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
[connection signal="Hit" from="Marble" to="." method="GameOver"]
[connection signal="timeout" from="MobTimer" to="." method="OnMobTimerTimeout"]
[connection signal="timeout" from="ScoreTimer" to="." method="OnScoreTimerTimeout"]
[connection signal="timeout" from="StartTimer" to="." method="OnStartTimerTimeout"]
+67
View File
@@ -0,0 +1,67 @@
[gd_scene load_steps=10 format=3 uid="uid://cfnyfjhp8v5gw"]
[ext_resource type="Texture2D" uid="uid://c1xpmsur8h7bt" path="res://enemyFlyingAlt_1.png" id="1_b3mxk"]
[ext_resource type="Texture2D" uid="uid://duyxe6bvilcac" path="res://enemyFlyingAlt_2.png" id="2_1qmh0"]
[ext_resource type="Texture2D" uid="uid://d1cq0yledu7sl" path="res://enemySwimming_1.png" id="3_gfurk"]
[ext_resource type="Texture2D" uid="uid://dr6tqvwcfdwpv" path="res://enemySwimming_2.png" id="4_ieysi"]
[ext_resource type="Texture2D" uid="uid://dxudw2rt0l078" path="res://enemyWalking_1.png" id="5_cixyi"]
[ext_resource type="Texture2D" uid="uid://c2usp1a4mowsj" path="res://enemyWalking_2.png" id="6_7ulmv"]
[ext_resource type="Script" uid="uid://bmqxvh0q486kb" path="res://Mob.cs" id="7_1qmh0"]
[sub_resource type="SpriteFrames" id="SpriteFrames_pcqmr"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_b3mxk")
}, {
"duration": 1.0,
"texture": ExtResource("2_1qmh0")
}],
"loop": true,
"name": &"fly",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_gfurk")
}, {
"duration": 1.0,
"texture": ExtResource("4_ieysi")
}],
"loop": true,
"name": &"swim",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("5_cixyi")
}, {
"duration": 1.0,
"texture": ExtResource("6_7ulmv")
}],
"loop": true,
"name": &"walk",
"speed": 3.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_jbnni"]
radius = 36.0
height = 90.0
[node name="Mob" type="RigidBody2D"]
collision_mask = 0
gravity_scale = 0.0
script = ExtResource("7_1qmh0")
metadata/_edit_group_ = true
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(0.75, 0.75)
sprite_frames = SubResource("SpriteFrames_pcqmr")
animation = &"fly"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource("CapsuleShape2D_jbnni")
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
enable_node_path = NodePath("../CollisionShape2D")
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bfx7o0vsjshp2"
path="res://.godot/imported/playerGrey_up1.png-3aa61131c0882580ef256c2e63b2c4f5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://playerGrey_up1.png"
dest_files=["res://.godot/imported/playerGrey_up1.png-3aa61131c0882580ef256c2e63b2c4f5.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqkvfdd2htfry"
path="res://.godot/imported/playerGrey_up2.png-1a4d6b79dc0f594823072cc61cec8a24.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://playerGrey_up2.png"
dest_files=["res://.godot/imported/playerGrey_up2.png-1a4d6b79dc0f594823072cc61cec8a24.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://emguskfoeupl"
path="res://.godot/imported/playerGrey_walk1.png-cc737e5947095223c3494468704ca885.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://playerGrey_walk1.png"
dest_files=["res://.godot/imported/playerGrey_walk1.png-cc737e5947095223c3494468704ca885.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dimv2j24hgb1w"
path="res://.godot/imported/playerGrey_walk2.png-f5cfaf08bfb66680dc47cac4becdc491.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://playerGrey_walk2.png"
dest_files=["res://.godot/imported/playerGrey_walk2.png-f5cfaf08bfb66680dc47cac4becdc491.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