7-9-25 3:44am

This commit is contained in:
2025-07-09 03:44:11 -04:00
parent 70fe41e07a
commit 00c0cfcff7
19 changed files with 268 additions and 36 deletions

View File

@@ -44,7 +44,8 @@ public partial class Marble : RigidBody2D
TrySelect();
TryAim();
TryLaunch();
TryMovement();
TryMovement(delta);
}
public void ProcessOnBump(Node2D body)
@@ -112,7 +113,7 @@ public partial class Marble : RigidBody2D
}
}
public void TryMovement()
public void TryMovement(double delta)
{
if (LinearVelocity.Length() > 0 && !Sleeping)
{
@@ -125,6 +126,18 @@ public partial class Marble : RigidBody2D
if (Moving)
{
ProcessOnMovement();
Vector2 Scroll = -LinearVelocity / 100;
Sprite2D sprite = (Sprite2D)GetNode("Sprite2D");
ShaderMaterial material = (ShaderMaterial)sprite.Material;
float CurrentScrollX = (float)material.GetShaderParameter("scroll_x");
material.SetShaderParameter("scroll_x", (CurrentScrollX + Scroll.X * (float)delta) % 1.0f);
float CurrentScrollY = (float)material.GetShaderParameter("scroll_y");
material.SetShaderParameter("scroll_y", (CurrentScrollY + Scroll.Y * (float)delta) % 1.0f);
if (Sleeping)
{
Moving = false;

View File

@@ -1,10 +1,10 @@
[gd_scene load_steps=14 format=3 uid="uid://c8n4lue2bn25n"]
[gd_scene load_steps=12 format=3 uid="uid://c8n4lue2bn25n"]
[ext_resource type="Script" uid="uid://b1bipn8tmpggr" path="res://Gameplay/Marble.cs" id="1_7ritg"]
[ext_resource type="Shader" uid="uid://b6vvt5o0008ob" path="res://shaders/globe.gdshader" id="2_6v01e"]
[ext_resource type="Texture2D" uid="uid://bigvacjklr7in" path="res://art/playerGrey_up1.png" id="2_76m5q"]
[ext_resource type="Texture2D" uid="uid://dd3s6x86dgxem" path="res://art/checkerboard.png" id="2_fkve3"]
[ext_resource type="Texture2D" uid="uid://bskloxogmm7ox" path="res://art/playerGrey_up2.png" id="3_4rms2"]
[ext_resource type="Shader" uid="uid://dvpsalh3o60iu" path="res://shaders/red.gdshader" id="3_6v01e"]
[ext_resource type="Texture2D" uid="uid://dkduh13hcei0w" path="res://art/fruit.png" id="3_6v01e"]
[ext_resource type="Texture2D" uid="uid://cww2tug20ksn3" path="res://art/playerGrey_walk1.png" id="4_iy80h"]
[ext_resource type="Texture2D" uid="uid://csm4ru8wkc2cb" path="res://art/playerGrey_walk2.png" id="5_ryns1"]
@@ -12,18 +12,11 @@
bounce = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bdlqm"]
render_priority = 0
shader = ExtResource("3_6v01e")
[sub_resource type="CapsuleMesh" id="CapsuleMesh_eju0r"]
material = SubResource("ShaderMaterial_bdlqm")
radius = 1.5
height = 3.0
[sub_resource type="MeshTexture" id="MeshTexture_nbhrg"]
mesh = SubResource("CapsuleMesh_eju0r")
base_texture = ExtResource("2_fkve3")
image_size = Vector2(55, 55)
resource_local_to_scene = true
shader = ExtResource("2_6v01e")
shader_parameter/scroll_x = 0.0
shader_parameter/scroll_y = 0.0
shader_parameter/globe_magnitude = 1.0
[sub_resource type="SpriteFrames" id="SpriteFrames_n7ghd"]
animations = [{
@@ -51,7 +44,7 @@ animations = [{
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_803qd"]
radius = 27.0185
radius = 56.0803
[node name="Marble" type="RigidBody2D"]
input_pickable = true
@@ -65,8 +58,10 @@ script = ExtResource("1_7ritg")
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-4.76837e-07, -9.53674e-07)
texture = SubResource("MeshTexture_nbhrg")
material = SubResource("ShaderMaterial_bdlqm")
position = Vector2(0, 1.3113e-06)
scale = Vector2(0.0861539, 0.0861539)
texture = ExtResource("3_6v01e")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
visible = false

BIN
art/SimpleNoiseTexture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

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

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 418 B

BIN
art/ex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

34
art/ex.png.import Normal file
View File

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

BIN
art/example.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

34
art/example.jpg.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bpvnm47km7j2w"
path="res://.godot/imported/example.jpg-9319614e785f83aef7c770b2e4954d69.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/example.jpg"
dest_files=["res://.godot/imported/example.jpg-9319614e785f83aef7c770b2e4954d69.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

BIN
art/fruit.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

34
art/fruit.jpg.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7or7kn3fpypj"
path="res://.godot/imported/fruit.jpg-4bdd4d207de39b3f76fba670c9c82bad.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/fruit.jpg"
dest_files=["res://.godot/imported/fruit.jpg-4bdd4d207de39b3f76fba670c9c82bad.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

BIN
art/fruit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

34
art/fruit.png.import Normal file
View File

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

BIN
art/tess.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

34
art/tess.jpg.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b673y84gue81w"
path="res://.godot/imported/tess.jpg-a1625b478265a588029ba1e96005020c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/tess.jpg"
dest_files=["res://.godot/imported/tess.jpg-a1625b478265a588029ba1e96005020c.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

View File

@@ -1,15 +0,0 @@
shader_type canvas_item;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}

View File

@@ -1 +0,0 @@
uid://bgf53pnrg4qv1

35
shaders/globe.gdshader Normal file
View File

@@ -0,0 +1,35 @@
shader_type canvas_item;
uniform float scroll_x = 0.0;
uniform float scroll_y = 0.0;
uniform float globe_magnitude : hint_range(0.0, 1.0) = 1.0;
void fragment()
{
// Original UVs from 0 to 1
vec2 uv = UV;
//uv.x = mod(uv.x + x_scroll, 1.0);
//uv.y = mod(uv.y + y_scroll, 1.0);
// Remaps UV to -1, 1, i.e. centers on the sprite
vec2 centered_uv = uv * 2.0 - 1.0;
// Radius r of length of the centered UV
float r = length(centered_uv);
if (r > 1.0)
{
discard; // clips anything past the radius of the circle
}
float z = sqrt(1.0 - r * r);
vec2 sphere_uv = centered_uv / (1.0 + z);
sphere_uv.x = mod(sphere_uv.x + scroll_x, 1.0);
sphere_uv.y = mod(sphere_uv.y + scroll_y, 1.0);
sphere_uv = sphere_uv * 0.5 + 0.5;
vec2 final_uv = mix(uv, sphere_uv, globe_magnitude);
COLOR = texture(TEXTURE, final_uv);
}

View File

@@ -0,0 +1 @@
uid://b6vvt5o0008ob