ft (wip): molecular stage prey

This commit is contained in:
Djairo Hougee 2025-12-15 13:05:11 +01:00
parent 263011b460
commit 551482e209
30 changed files with 416 additions and 34 deletions

View File

@ -1,13 +1,15 @@
extends Label
var counter := Test.new() # C++ class
#var counter := Test.new() # C++ class
func _ready() -> void:
text += str(counter.get_counter())
#text += str(counter.get_counter())
pass
func _process(delta: float) -> void:
pass
#if Input.is_action_just_pressed("ui_accept"):
counter.increment()
var baseText := text
baseText = baseText.left(baseText.length() - str(counter.get_counter()).length())
text = baseText + str(counter.get_counter())
#counter.increment()
#var baseText := text
#baseText = baseText.left(baseText.length() - str(counter.get_counter()).length())
#text = baseText + str(counter.get_counter())

View File

@ -2,4 +2,4 @@ extends Control
func _on_play_button_pressed() -> void:
get_tree().change_scene_to_file("res://molecular_stage.tscn")
get_tree().change_scene_to_file("res://molecular/molecular_stage.tscn")

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://drgv154ei1vrl"]
[ext_resource type="Script" path="res://main_menu.gd" id="1_06t4h"]
[ext_resource type="Script" uid="uid://dxc66bci2ivrj" path="res://main_menu.gd" id="1_06t4h"]
[sub_resource type="LabelSettings" id="LabelSettings_rhts7"]
font_size = 64

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cua5ptyehfnag"
path="res://.godot/imported/bg-far-placeholder.jpg-6a0cffeb916e2168f0ff74b7863cf6c9.ctex"
uid="uid://dnlrq8gxiix6"
path="res://.godot/imported/bg-far-placeholder.jpg-f6a73992ff3dd38240865e4558592bbf.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bg-far-placeholder.jpg"
dest_files=["res://.godot/imported/bg-far-placeholder.jpg-6a0cffeb916e2168f0ff74b7863cf6c9.ctex"]
source_file="res://molecular/assets/bg-far-placeholder.jpg"
dest_files=["res://.godot/imported/bg-far-placeholder.jpg-f6a73992ff3dd38240865e4558592bbf.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 715 KiB

After

Width:  |  Height:  |  Size: 715 KiB

View File

@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cy6kyldb6toa4"
path="res://.godot/imported/player-sprite-placeholder-crop.png-235fee3dea28a886964cc2a1a4d4ef94.ctex"
uid="uid://cxwvga07sm3yl"
path="res://.godot/imported/player-sprite-placeholder-crop.png-f29c3ab24e261ab3d11fb066419e0b90.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player-sprite-placeholder-crop.png"
dest_files=["res://.godot/imported/player-sprite-placeholder-crop.png-235fee3dea28a886964cc2a1a4d4ef94.ctex"]
source_file="res://molecular/assets/player-sprite-placeholder-crop.png"
dest_files=["res://.godot/imported/player-sprite-placeholder-crop.png-f29c3ab24e261ab3d11fb066419e0b90.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bl387esu1eeh"
path="res://.godot/imported/player-sprite-placeholder.png-8f910f217c7c1bd0e8dd681061ddca66.ctex"
uid="uid://dnqwe065lmv0h"
path="res://.godot/imported/player-sprite-placeholder.png-6805db1633c9b4853860db48d10b2af1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player-sprite-placeholder.png"
dest_files=["res://.godot/imported/player-sprite-placeholder.png-8f910f217c7c1bd0e8dd681061ddca66.ctex"]
source_file="res://molecular/assets/player-sprite-placeholder.png"
dest_files=["res://.godot/imported/player-sprite-placeholder.png-6805db1633c9b4853860db48d10b2af1.ctex"]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bhcb5g7g7um8"
path="res://.godot/imported/prey-dying-frame0.png-3dfc6299514225b1b5ecd511feec558a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-dying-frame0.png"
dest_files=["res://.godot/imported/prey-dying-frame0.png-3dfc6299514225b1b5ecd511feec558a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bxn11avw7dykl"
path="res://.godot/imported/prey-dying-frame1.png-8e3f40908415d07a432ca919106bfe5f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-dying-frame1.png"
dest_files=["res://.godot/imported/prey-dying-frame1.png-8e3f40908415d07a432ca919106bfe5f.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ctkehsavw6ghx"
path="res://.godot/imported/prey-healthy-frame0.png-fdee965b6537e072b2ba52ebaa00234a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-healthy-frame0.png"
dest_files=["res://.godot/imported/prey-healthy-frame0.png-fdee965b6537e072b2ba52ebaa00234a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://uy28y3mkk6nt"
path="res://.godot/imported/prey-healthy-frame1.png-d0ef89a578931d076b5469c218505713.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-healthy-frame1.png"
dest_files=["res://.godot/imported/prey-healthy-frame1.png-d0ef89a578931d076b5469c218505713.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://btnyajci8ptb2"
path="res://.godot/imported/prey-injured-frame0.png-de2d8ee9861665f890cb3ef99d676bc3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-injured-frame0.png"
dest_files=["res://.godot/imported/prey-injured-frame0.png-de2d8ee9861665f890cb3ef99d676bc3.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqll8ge4cr2uf"
path="res://.godot/imported/prey-injured-frame1.png-6fdfb22e05a71b519337c6ac43b474b1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://molecular/assets/prey/prey-injured-frame1.png"
dest_files=["res://.godot/imported/prey-injured-frame1.png-6fdfb22e05a71b519337c6ac43b474b1.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

View File

@ -1,13 +1,13 @@
[gd_scene load_steps=5 format=3 uid="uid://dxluckxdkpv4f"]
[ext_resource type="Script" uid="uid://di7eglnrnqm6i" path="res://molecular_player.gd" id="1_0ix7k"]
[ext_resource type="Texture2D" uid="uid://cy6kyldb6toa4" path="res://player-sprite-placeholder-crop.png" id="1_hh536"]
[ext_resource type="Script" uid="uid://di7eglnrnqm6i" path="res://molecular/molecular_player.gd" id="1_0ix7k"]
[ext_resource type="Texture2D" uid="uid://cxwvga07sm3yl" path="res://molecular/assets/player-sprite-placeholder-crop.png" id="2_en8op"]
[sub_resource type="SpriteFrames" id="SpriteFrames_onrkg"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_hh536")
"texture": ExtResource("2_en8op")
}],
"loop": true,
"name": &"default",

View File

@ -1,9 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://b55w56d4twno1"]
[gd_scene load_steps=8 format=3 uid="uid://b55w56d4twno1"]
[ext_resource type="Script" uid="uid://ceut2lrvkns75" path="res://debug_label.gd" id="1_0kdu2"]
[ext_resource type="Texture2D" uid="uid://cua5ptyehfnag" path="res://bg-far-placeholder.jpg" id="2_f4v4g"]
[ext_resource type="Texture2D" uid="uid://bfjf6dxvbq5cj" path="res://dirt-specs.png" id="3_582e3"]
[ext_resource type="PackedScene" uid="uid://dxluckxdkpv4f" path="res://molecular_player.tscn" id="4_f4v4g"]
[ext_resource type="Texture2D" uid="uid://dnlrq8gxiix6" path="res://molecular/assets/bg-far-placeholder.jpg" id="1_cthuy"]
[ext_resource type="Texture2D" uid="uid://bfjf6dxvbq5cj" path="res://dirt-specs.png" id="2_a5cls"]
[ext_resource type="PackedScene" uid="uid://dxluckxdkpv4f" path="res://molecular/molecular_player.tscn" id="3_b1jr0"]
[ext_resource type="Script" uid="uid://ceut2lrvkns75" path="res://debug_label.gd" id="4_mys4o"]
[ext_resource type="Script" uid="uid://2pmjtnrg5471" path="res://molecular/preyManager.gd" id="5_ojt85"]
[ext_resource type="PackedScene" uid="uid://cum0iux1pv7bu" path="res://molecular/prey.tscn" id="6_a5cls"]
[sub_resource type="Curve2D" id="Curve2D_4kroc"]
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 5, 78, 0, 0, 0, 0, 234, 81, 0, 0, 0, 0, 234, 209, 0, 0, 0, 0, 5, 209, 0, 0, 0, 0, 5, 77)
}
point_count = 5
[node name="MolecularStag" type="Node2D"]
@ -16,12 +24,12 @@ repeat_times = 7
[node name="Sprite2D" type="Sprite2D" parent="Background/ParallaxFar"]
position = Vector2(295.99997, 360)
scale = Vector2(0.94648564, 0.92012787)
texture = ExtResource("2_f4v4g")
texture = ExtResource("1_cthuy")
[node name="Sprite2D2" type="Sprite2D" parent="Background/ParallaxFar"]
position = Vector2(892.09973, 359.82693)
scale = Vector2(0.95814764, 0.9195748)
texture = ExtResource("2_f4v4g")
texture = ExtResource("1_cthuy")
[node name="ParallaxNear" type="Parallax2D" parent="Background"]
scroll_scale = Vector2(0.9, 0.9)
@ -30,11 +38,11 @@ repeat_times = 7
[node name="Sprite2D" type="Sprite2D" parent="Background/ParallaxNear"]
position = Vector2(596, 359.5)
scale = Vector2(3.725, 2.4159663)
texture = ExtResource("3_582e3")
texture = ExtResource("2_a5cls")
[node name="player" parent="." instance=ExtResource("4_f4v4g")]
[node name="player" parent="." instance=ExtResource("3_b1jr0")]
position = Vector2(120, 144)
scale = Vector2(0.047164187, 0.089221194)
scale = Vector2(0.01, 0.01)
[node name="Camera2D" type="Camera2D" parent="player"]
rotation = 3.1415927
@ -54,4 +62,15 @@ offset_right = 296.0
offset_bottom = 49.0
text = "Debug: You made it into the game!
This is running from C++: "
script = ExtResource("1_0kdu2")
script = ExtResource("4_mys4o")
[node name="Prey" type="Node" parent="."]
script = ExtResource("5_ojt85")
preyScene = ExtResource("6_a5cls")
[node name="PreyPath" type="Path2D" parent="Prey"]
curve = SubResource("Curve2D_4kroc")
[node name="PreySpawnLocation" type="PathFollow2D" parent="Prey/PreyPath"]
position = Vector2(5, 78)
rotation = 0.013099688

View File

@ -0,0 +1,15 @@
extends RigidBody2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_visible_on_screen_notifier_2d_screen_exited():
queue_free();

View File

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

View File

@ -0,0 +1,65 @@
[gd_scene load_steps=9 format=3 uid="uid://cum0iux1pv7bu"]
[ext_resource type="Script" uid="uid://d1b3twb5c47c0" path="res://molecular/prey.gd" id="1_wojl0"]
[ext_resource type="Texture2D" uid="uid://bhcb5g7g7um8" path="res://molecular/assets/prey/prey-dying-frame0.png" id="2_5mr0w"]
[ext_resource type="Texture2D" uid="uid://bxn11avw7dykl" path="res://molecular/assets/prey/prey-dying-frame1.png" id="3_eomdj"]
[ext_resource type="Texture2D" uid="uid://ctkehsavw6ghx" path="res://molecular/assets/prey/prey-healthy-frame0.png" id="4_t6vdg"]
[ext_resource type="Texture2D" uid="uid://uy28y3mkk6nt" path="res://molecular/assets/prey/prey-healthy-frame1.png" id="5_8jbq3"]
[ext_resource type="Texture2D" uid="uid://btnyajci8ptb2" path="res://molecular/assets/prey/prey-injured-frame0.png" id="6_o44iv"]
[ext_resource type="Texture2D" uid="uid://bqll8ge4cr2uf" path="res://molecular/assets/prey/prey-injured-frame1.png" id="7_wx0y7"]
[sub_resource type="SpriteFrames" id="SpriteFrames_43b72"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_5mr0w")
}, {
"duration": 1.0,
"texture": ExtResource("3_eomdj")
}],
"loop": true,
"name": &"Dying",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_t6vdg")
}, {
"duration": 1.0,
"texture": ExtResource("5_8jbq3")
}],
"loop": true,
"name": &"Healthy",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("6_o44iv")
}, {
"duration": 1.0,
"texture": ExtResource("7_wx0y7")
}],
"loop": true,
"name": &"Injured",
"speed": 5.0
}]
[node name="Prey" type="RigidBody2D"]
gravity_scale = 0.379
script = ExtResource("1_wojl0")
metadata/_edit_group_ = true
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(0.1, 0.1)
sprite_frames = SubResource("SpriteFrames_43b72")
animation = &"Healthy"
frame_progress = 0.14205484
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2(0, 0.081250384)
scale = Vector2(0.1, 0.10208334)
polygon = PackedVector2Array(-15.967808, -28.469032, 14.526825, -28.826782, 30.048037, -3.7841516, 14.344225, 21.97399, -15.419998, 22.510618, -31.671623, -4.141903)
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]

View File

@ -0,0 +1,39 @@
extends Node
@export var preyScene: PackedScene
var score
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_prey_timer_timeout() -> void:
# Create a new instance of the Mob scene.
var prey = preyScene.instantiate()
# Choose a random location on Path2D.
var preySpawnLocation = $PreyPath/PreySpawnLocation
preySpawnLocation.progress_ratio = randf()
# Set the mob's position to the random location.
prey.position = preySpawnLocation.position
# Set the mob's direction perpendicular to the path direction.
var direction = preySpawnLocation.rotation + PI / 2
# Add some randomness to the direction.
direction += randf_range(-PI / 4, PI / 4)
prey.rotation = direction
# Choose the velocity for the mob.
var velocity = Vector2(randf_range(50.0, 100.0), 0.0)
prey.linear_velocity = velocity.rotated(direction)
# Spawn the mob by adding it to the Main scene.
add_child(prey)

View File

@ -0,0 +1 @@
uid://2pmjtnrg5471