Added berries

This commit is contained in:
Puppet committed 2025-08-28 23:22:15 -07:00
1 parent 0f1d574da3
commit bee846c3ba
10 files changed
+145 -1

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
[gd_scene load_steps=4 format=3 uid="uid://cuxasb6eg47gw"]
[ext_resource type="Script" uid="uid://byjsgr18ieauy" path="res://Scripts/BerryLogic.cs" id="1_0wwwo"]
[ext_resource type="Texture2D" uid="uid://keupgfuijdl7" path="res://Textures/Berries/Berry.png" id="1_g0wxr"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7lihs"]
size = Vector2(183, 203)
[node name="Berry" type="Node2D"]
script = ExtResource("1_0wwwo")
[node name="Sprite" type="Sprite2D" parent="."]
scale = Vector2(1.52344, 1.52344)
texture = ExtResource("1_g0wxr")
[node name="Hitbox" type="Area2D" parent="."]
[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_7lihs")
debug_color = Color(0.713726, 0, 0.321569, 0.156863)
[connection signal="area_entered" from="Hitbox" to="." method="_on_hitbox_area_entered"]
+16 -1
View File
@@ -1,13 +1,21 @@
[gd_scene load_steps=3 format=3 uid="uid://bgt46l5p8qrwc"]
[gd_scene load_steps=5 format=3 uid="uid://bgt46l5p8qrwc"]
[ext_resource type="Script" uid="uid://dfv3cmvcskd6t" path="res://Scripts/Player.cs" id="1_gl6un"]
[ext_resource type="Texture2D" uid="uid://5ecdlqnn0u6g" path="res://Textures/Icons/Bird1.png" id="1_iukft"]
[ext_resource type="Script" uid="uid://bdwdadvx0axam" path="res://Scripts/Berries.cs" id="1_kldst"]
[sub_resource type="CircleShape2D" id="CircleShape2D_j5yw3"]
radius = 117.004
[node name="Game" type="Node2D"]
[node name="Center" type="Node2D" parent="."]
position = Vector2(960, 540)
[node name="Berries" type="Node2D" parent="."]
position = Vector2(960, 0)
script = ExtResource("1_kldst")
[node name="Player" type="Node2D" parent="."]
position = Vector2(960, 978)
script = ExtResource("1_gl6un")
@@ -15,3 +23,10 @@ script = ExtResource("1_gl6un")
[node name="Texture" type="Sprite2D" parent="Player"]
scale = Vector2(1.675, 1.675)
texture = ExtResource("1_iukft")
[node name="Hitbox" type="Area2D" parent="Player"]
position = Vector2(-5, 23)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player/Hitbox"]
shape = SubResource("CircleShape2D_j5yw3")
debug_color = Color(1, 1, 1, 0.188235)
+29
View File
@@ -0,0 +1,29 @@
using Godot;
using System;
public partial class Berries : Node2D {
private float SpawnBerryTimer = 0f;
public override void _Process(double delta) {
Vector2 Pos = Position;
Pos.Y += 500f * (float)delta;
SpawnBerryTimer += (float)delta;
int ScreenWidth = DisplayServer.WindowGetSize().X;
if (SpawnBerryTimer > 1.0) {
SpawnBerryTimer = 0f;
PackedScene Berry = GD.Load<PackedScene>("res://Prefabs/Berries/Berry.tscn");
Node2D BerryInstance = Berry.Instantiate<Node2D>();
BerryInstance.Position = new Vector2(x: new Random().Next(-(ScreenWidth / 2), ScreenWidth / 2), y: -100 - Position.Y);
AddChild(BerryInstance);
}
Position = Pos;
}
}
+1
View File
@@ -0,0 +1 @@
uid://bdwdadvx0axam
+8
View File
@@ -0,0 +1,8 @@
using Godot;
using System;
public partial class BerryLogic : Node2D {
private void _on_hitbox_area_entered(Area2D area) {
QueueFree();
}
}
+1
View File
@@ -0,0 +1 @@
uid://byjsgr18ieauy
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://keupgfuijdl7"
path="res://.godot/imported/Berry.png-99fceefd2d38bc29952b8ccbf9da3f8e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Textures/Berries/Berry.png"
dest_files=["res://.godot/imported/Berry.png-99fceefd2d38bc29952b8ccbf9da3f8e.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: 2.0 KiB

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