Compare commits
70 Commits
main
...
9dd1d45698
| Author | SHA1 | Date | |
|---|---|---|---|
| 9dd1d45698 | |||
| 6d8e8e3734 | |||
| 2b46fd18f7 | |||
| f83b290f5c | |||
| 51ee5029e9 | |||
| 6b8af22d7a | |||
| ac6549579e | |||
| 99de1fc113 | |||
| 8f1b301ece | |||
| d406fd2e30 | |||
| fc093533fd | |||
| a1e0ec07d7 | |||
| 7bd85cc050 | |||
| 1ff04ff3b3 | |||
| 27540988fd | |||
| cc0a4cb71b | |||
| f2b58d7314 | |||
| 6482dab9b6 | |||
| bc582efb90 | |||
| 0f06846157 | |||
| 1dc1501b80 | |||
| 9c625edef4 | |||
| 49d9489ede | |||
| bef1e9cb53 | |||
| d5b33d66b8 | |||
| 2211130fd3 | |||
| ceb0d90c20 | |||
| 57c611a46d | |||
| 232184afba | |||
| 2352a3aa07 | |||
| 098348b329 | |||
| 22ffa3dac1 | |||
| 59c4818216 | |||
| 8ee70854ea | |||
| 5f9a2fffb9 | |||
| 6094980d00 | |||
| 66233d8fad | |||
| 5751f25732 | |||
| b21bf52938 | |||
| 85d1ef44a9 | |||
| b56d0cb777 | |||
| 07f3c13fd2 | |||
| 6432b709ef | |||
| 69776a6973 | |||
| 7207626315 | |||
| c9880d9b35 | |||
| 487062e25c | |||
| adf1438bc8 | |||
| f957b90be6 | |||
| c11afd9ddd | |||
| 0b9b1e75d4 | |||
| c0f5dd4628 | |||
| 03117b77fb | |||
| 18ce1716e4 | |||
| 5811658c64 | |||
| e4b3919b81 | |||
| 8de3ee2c9a | |||
| 4160361145 | |||
| 3262a8899c | |||
| 6662dc0c80 | |||
| 1a532a5afb | |||
| a5055a523f | |||
| 551482e209 | |||
| 263011b460 | |||
| 9de9d18632 | |||
| a4d062ea04 | |||
| 52ae094087 | |||
| e77fe832f0 | |||
| f4fd083a1a | |||
| cdcc23c50a |
1
.gitignore
vendored
@@ -49,3 +49,4 @@ export_presets.cfg
|
||||
data_*/
|
||||
mono_crash.*.json
|
||||
|
||||
addons/
|
||||
|
||||
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
[submodule "evolve-die-repeat/thirdparty/godot-cpp"]
|
||||
path = evolve-die-repeat/thirdparty/godot-cpp
|
||||
url = https://github.com/godotengine/godot-cpp.git
|
||||
branch = 4.5
|
||||
25
README.md
@@ -1,2 +1,25 @@
|
||||
# notSpore
|
||||
# Evolve Die Repeat TODO: The name is a work in progress
|
||||
|
||||
This is currently quite empty.
|
||||
|
||||
## C++ setup
|
||||
From anywhere in proejct:
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
In `thirdparty`:
|
||||
```bash
|
||||
godot --headless --dump-extension-api
|
||||
```
|
||||
|
||||
To compile the cpp extension, run this from `thirdparty/godot-cpp`:
|
||||
```bash
|
||||
scons platform=linux target=template_debug generate_bindings=yes custom_api_file=../extension_api.json -j8
|
||||
```
|
||||
|
||||
Finally, to compile and extern local `.cpp` files, run this from `thirdparty`:
|
||||
```bash
|
||||
scons platform=linux target=template_debug -j8
|
||||
```
|
||||
|
||||
|
||||
4
evolve-die-repeat/.editorconfig
Normal file
@@ -0,0 +1,4 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
2
evolve-die-repeat/.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
3
evolve-die-repeat/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
/android/
|
||||
15
evolve-die-repeat/debug_label.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Label
|
||||
|
||||
#var counter := Test.new() # C++ class
|
||||
|
||||
func _ready() -> void:
|
||||
#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())
|
||||
1
evolve-die-repeat/debug_label.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ceut2lrvkns75
|
||||
112
evolve-die-repeat/game_manager.gd
Normal file
@@ -0,0 +1,112 @@
|
||||
extends Node
|
||||
|
||||
# Main scene
|
||||
var mainSceneInstance
|
||||
|
||||
# Screen
|
||||
var screen_size = Vector2(1920.0, 1080.0) # Default screen size (this is a float for some reason)
|
||||
var viewport_size
|
||||
@onready var extent: Rect2 = get_viewport().get_visible_rect()
|
||||
|
||||
# utils.
|
||||
var rng = RandomNumberGenerator.new()
|
||||
var eps: float = 1e-4
|
||||
|
||||
# managers
|
||||
var foodManager: FoodManager2D
|
||||
|
||||
# A world "current"
|
||||
# polar
|
||||
var flow_dir: float # [0, 2pi)
|
||||
var flow_mag: float # [0, 1]
|
||||
# cartesian
|
||||
var flow_x: float
|
||||
var flow_y: float
|
||||
# Swap period
|
||||
var flowT: float = 10
|
||||
|
||||
# A game timer
|
||||
var t: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Start game
|
||||
mainSceneInstance = get_tree().root.get_child(-1)
|
||||
|
||||
# Create viewport
|
||||
viewport_size = get_viewport().get_visible_rect().size
|
||||
|
||||
# initial world current
|
||||
get_new_flow()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
t += delta
|
||||
|
||||
# Flow current change
|
||||
if abs(fmod(t, flowT)) < eps:
|
||||
get_new_flow()
|
||||
|
||||
func switch_scene(name:String) -> void:
|
||||
if name == "respawn":
|
||||
mainSceneInstance.go_to_respawn_scene()
|
||||
|
||||
# TODO: This needs to be called from a script inheriting a CharacterBody2D (e.g. the player)
|
||||
# Alternative would be to pass the player reference to this script (which might be better?)
|
||||
func init_screen_size(x:float, y:float) -> void:
|
||||
screen_size.x = x
|
||||
screen_size.y = y
|
||||
|
||||
# This can take a vector of any size (but should be 2d, other components are unused)
|
||||
func get_boundaried_position(position):
|
||||
# clamp
|
||||
#return position.clamp(Vector2.ZERO, screen_size)
|
||||
|
||||
# periodic
|
||||
position.x = wrapf(position.x, 0, screen_size.x)
|
||||
position.y = wrapf(position.y, 0, screen_size.y)
|
||||
return position
|
||||
|
||||
func get_new_flow():
|
||||
flow_dir = rng.randf()*2*PI
|
||||
flow_mag = rng.randf()
|
||||
|
||||
flow_x = flow_mag * cos(flow_dir)
|
||||
flow_y = flow_mag * sin(flow_dir)
|
||||
|
||||
|
||||
func calc_distance(one, two) -> float:
|
||||
var candidate = one.distance_to(two)
|
||||
var onedup = one
|
||||
# FIXME: doesnt work-- predators lose track across game boundary
|
||||
if one.x < screen_size.x/2:
|
||||
if one.y < screen_size.y/2:
|
||||
# top left
|
||||
onedup.y -= screen_size.y
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
onedup.y += screen_size.y
|
||||
onedup.x -= screen_size.x
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
else:
|
||||
# bottom left
|
||||
onedup.y += screen_size.y
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
onedup.y -= screen_size.y
|
||||
onedup.x -= screen_size.x
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
else:
|
||||
if one.y < screen_size.y/2:
|
||||
# top right
|
||||
onedup.y -= screen_size.y
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
onedup.y += screen_size.y
|
||||
onedup.x += screen_size.x
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
else:
|
||||
# botom right
|
||||
onedup.y += screen_size.y
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
onedup.y -= screen_size.y
|
||||
onedup.x += screen_size.x
|
||||
candidate = min(candidate, onedup.distance_to(two))
|
||||
return candidate
|
||||
1
evolve-die-repeat/game_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://vsbibc5fanou
|
||||
1
evolve-die-repeat/icon.svg
Normal file
@@ -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 |
43
evolve-die-repeat/icon.svg.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://uqy71st3rbdr"
|
||||
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
|
||||
3
evolve-die-repeat/main.tscn
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_scene format=3 uid="uid://bsrxph8oa7uuj"]
|
||||
|
||||
[node name="Main" type="Node" unique_id=1994328839]
|
||||
52
evolve-die-repeat/main_menu.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene format=3 uid="uid://drgv154ei1vrl"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_rhts7"]
|
||||
script/source = "extends Control
|
||||
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
print(\"Starting game by pressing button...\")
|
||||
GameManager.start_game()
|
||||
self.queue_free()
|
||||
"
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_rhts7"]
|
||||
font_size = 64
|
||||
|
||||
[node name="MainMenu" type="Control" unique_id=369570860]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = SubResource("GDScript_rhts7")
|
||||
|
||||
[node name="PlayButton" type="Button" parent="." unique_id=1831335357]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -160.0
|
||||
offset_top = -29.0
|
||||
offset_right = 160.0
|
||||
offset_bottom = 29.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Play"
|
||||
|
||||
[node name="MainMenuText" type="Label" parent="." unique_id=1324657553]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -292.0
|
||||
offset_right = 292.0
|
||||
offset_bottom = 119.0
|
||||
grow_horizontal = 2
|
||||
text = "The Main Menu"
|
||||
label_settings = SubResource("LabelSettings_rhts7")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
61
evolve-die-repeat/main_scene.gd
Normal file
@@ -0,0 +1,61 @@
|
||||
extends Node
|
||||
|
||||
# Main menu & game spawning
|
||||
@onready
|
||||
var mainMenuScene = preload("res://main_menu.tscn")
|
||||
var mainMenuSceneInstance: Node
|
||||
@onready
|
||||
var gameScene = preload("res://molecular/molecular_stage.tscn")
|
||||
var gameSceneInstance: Node
|
||||
@onready
|
||||
var respawnScene = preload("res://respawn_menu.tscn")
|
||||
var respawnSceneInstance: Node
|
||||
# Currently active scene (instance)
|
||||
var currentSceneInstance:Node
|
||||
|
||||
# UI effects
|
||||
var fadeEffect: CanvasLayer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Instantiate effects
|
||||
fadeEffect = $UI/Fade
|
||||
fadeEffect.visible = false
|
||||
|
||||
# Create game (main menu)
|
||||
print("Creating Main menu...")
|
||||
mainMenuSceneInstance = mainMenuScene.instantiate()
|
||||
currentSceneInstance = mainMenuSceneInstance
|
||||
add_child(currentSceneInstance)
|
||||
|
||||
# Link MainMenu button to start_game
|
||||
print("Linking Play button...")
|
||||
mainMenuSceneInstance.get_node("PlayButton").connect("pressed", start_game)
|
||||
|
||||
|
||||
func start_game() -> void:
|
||||
print("Starting game...")
|
||||
|
||||
# Instatiate
|
||||
currentSceneInstance.queue_free()
|
||||
gameSceneInstance = gameScene.instantiate()
|
||||
currentSceneInstance = gameSceneInstance
|
||||
add_child(currentSceneInstance)
|
||||
|
||||
# Populate GameManager with game scene
|
||||
GameManager.foodManager = gameSceneInstance.get_node("FoodManager")
|
||||
|
||||
|
||||
func go_to_respawn_scene() -> void:
|
||||
fadeEffect.visible = true
|
||||
await fadeEffect.fade(1.0, 1.5).finished
|
||||
print("Switching to Respawn scene.")
|
||||
currentSceneInstance.queue_free()
|
||||
|
||||
respawnSceneInstance = respawnScene.instantiate()
|
||||
respawnSceneInstance.get_node("RespawnButton").connect("pressed", start_game)
|
||||
currentSceneInstance = respawnSceneInstance
|
||||
|
||||
add_child(currentSceneInstance)
|
||||
await fadeEffect.fade(0.0, 1.5).finished
|
||||
fadeEffect.visible = false
|
||||
1
evolve-die-repeat/main_scene.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://wiv0plsu04s
|
||||
11
evolve-die-repeat/main_scene.tscn
Normal file
@@ -0,0 +1,11 @@
|
||||
[gd_scene format=3 uid="uid://b8gt8os2m28lv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://wiv0plsu04s" path="res://main_scene.gd" id="1_2c62f"]
|
||||
[ext_resource type="PackedScene" uid="uid://3eg3a8ceom4l" path="res://molecular/fade.tscn" id="2_2c62f"]
|
||||
|
||||
[node name="MainScene" type="Node" unique_id=1897047571]
|
||||
script = ExtResource("1_2c62f")
|
||||
|
||||
[node name="UI" type="Node2D" parent="." unique_id=1032224503]
|
||||
|
||||
[node name="Fade" parent="UI" unique_id=853660457 instance=ExtResource("2_2c62f")]
|
||||
|
After Width: | Height: | Size: 72 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dnlrq8gxiix6"
|
||||
path="res://.godot/imported/bg-far-placeholder.jpg-01304d9c071eca65de57b4adc0479e81.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/background/bg-far-placeholder.jpg"
|
||||
dest_files=["res://.godot/imported/bg-far-placeholder.jpg-01304d9c071eca65de57b4adc0479e81.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
|
||||
BIN
evolve-die-repeat/molecular/assets/background/bg-near.png
Normal file
|
After Width: | Height: | Size: 450 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c3cuhrmulyy1s"
|
||||
path="res://.godot/imported/bg-near.png-00577ad303726b65cb5579d462bbdf09.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/background/bg-near.png"
|
||||
dest_files=["res://.godot/imported/bg-near.png-00577ad303726b65cb5579d462bbdf09.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
|
||||
BIN
evolve-die-repeat/molecular/assets/background/bg.png
Normal file
|
After Width: | Height: | Size: 960 B |
40
evolve-die-repeat/molecular/assets/background/bg.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bto1pnycvianp"
|
||||
path="res://.godot/imported/bg.png-84a173f3a1de937d0ba2884af46d549b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/background/bg.png"
|
||||
dest_files=["res://.godot/imported/bg.png-84a173f3a1de937d0ba2884af46d549b.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
|
||||
BIN
evolve-die-repeat/molecular/assets/food/food-left-bolt.ase
Normal file
BIN
evolve-die-repeat/molecular/assets/food/food-left-bolt.png
Normal file
|
After Width: | Height: | Size: 195 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://xaqiha5lh1vt"
|
||||
path="res://.godot/imported/food-left-bolt.png-a2624c23f9c063886727de28bb8d45db.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/food/food-left-bolt.png"
|
||||
dest_files=["res://.godot/imported/food-left-bolt.png-a2624c23f9c063886727de28bb8d45db.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
|
||||
|
After Width: | Height: | Size: 200 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dj4lyyloj1ke1"
|
||||
path="res://.godot/imported/food-left-bottom-bolt.png-29b52334cce2caefb211e507cb88e1c1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/food/food-left-bottom-bolt.png"
|
||||
dest_files=["res://.godot/imported/food-left-bottom-bolt.png-29b52334cce2caefb211e507cb88e1c1.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
|
||||
BIN
evolve-die-repeat/molecular/assets/food/food-normal.ase
Normal file
BIN
evolve-die-repeat/molecular/assets/food/food-normal.png
Normal file
|
After Width: | Height: | Size: 171 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dcedkos6vgv51"
|
||||
path="res://.godot/imported/food-normal.png-b719473d7bef8a09701e78ab0f73d15b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/food/food-normal.png"
|
||||
dest_files=["res://.godot/imported/food-normal.png-b719473d7bef8a09701e78ab0f73d15b.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
|
||||
|
After Width: | Height: | Size: 195 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cbynycukppmup"
|
||||
path="res://.godot/imported/food-right-bottom-bolt.png-8eb8a35372e35c8de0cc432876ae5af5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/food/food-right-bottom-bolt.png"
|
||||
dest_files=["res://.godot/imported/food-right-bottom-bolt.png-8eb8a35372e35c8de0cc432876ae5af5.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
|
||||
BIN
evolve-die-repeat/molecular/assets/food/food-right-up-bolt.ase
Normal file
BIN
evolve-die-repeat/molecular/assets/food/food-right-up-bolt.png
Normal file
|
After Width: | Height: | Size: 193 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cend5h3nmvq5l"
|
||||
path="res://.godot/imported/food-right-up-bolt.png-c49edf3849bcaa575384d233173c9498.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/food/food-right-up-bolt.png"
|
||||
dest_files=["res://.godot/imported/food-right-up-bolt.png-c49edf3849bcaa575384d233173c9498.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
|
||||
BIN
evolve-die-repeat/molecular/assets/player-sprite-attacking.png
Normal file
|
After Width: | Height: | Size: 281 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://du1lb4nr47kvl"
|
||||
path="res://.godot/imported/player-sprite-attacking.png-6189c8275a257517c87cdb65abf5639a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite-attacking.png"
|
||||
dest_files=["res://.godot/imported/player-sprite-attacking.png-6189c8275a257517c87cdb65abf5639a.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
|
||||
BIN
evolve-die-repeat/molecular/assets/player-sprite-attacking2.png
Normal file
|
After Width: | Height: | Size: 308 B |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bsd1qtw50esai"
|
||||
path="res://.godot/imported/player-sprite-attacking2.png-3e4e9a47129b5ac21e61c82e331ba03f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite-attacking2.png"
|
||||
dest_files=["res://.godot/imported/player-sprite-attacking2.png-3e4e9a47129b5ac21e61c82e331ba03f.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
|
||||
|
After Width: | Height: | Size: 887 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://boknmstvkc0a2"
|
||||
path="res://.godot/imported/player-sprite-placeholder-attacking-crop.png-7a6a3f2b68f208c74f7cac8cb16cfc5e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite-placeholder-attacking-crop.png"
|
||||
dest_files=["res://.godot/imported/player-sprite-placeholder-attacking-crop.png-7a6a3f2b68f208c74f7cac8cb16cfc5e.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
|
||||
|
After Width: | Height: | Size: 715 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxwvga07sm3yl"
|
||||
path="res://.godot/imported/player-sprite-placeholder-crop.png-f29c3ab24e261ab3d11fb066419e0b90.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite-placeholder-crop.png"
|
||||
dest_files=["res://.godot/imported/player-sprite-placeholder-crop.png-f29c3ab24e261ab3d11fb066419e0b90.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
|
||||
BIN
evolve-die-repeat/molecular/assets/player-sprite-placeholder.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dnqwe065lmv0h"
|
||||
path="res://.godot/imported/player-sprite-placeholder.png-6805db1633c9b4853860db48d10b2af1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite-placeholder.png"
|
||||
dest_files=["res://.godot/imported/player-sprite-placeholder.png-6805db1633c9b4853860db48d10b2af1.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
|
||||
BIN
evolve-die-repeat/molecular/assets/player-sprite.png
Normal file
|
After Width: | Height: | Size: 253 B |
40
evolve-die-repeat/molecular/assets/player-sprite.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cd0iv6hsi3fad"
|
||||
path="res://.godot/imported/player-sprite.png-f2c28aefaf4a8e7293c46f17a4267bc1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/player-sprite.png"
|
||||
dest_files=["res://.godot/imported/player-sprite.png-f2c28aefaf4a8e7293c46f17a4267bc1.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
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://30uwkdbnuu3h"
|
||||
path="res://.godot/imported/hammerheadRibozyme-hunting.png-9b9929a81db6474a29fbff93ee4f1cef.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/predator/hammerheadRibozyme-hunting.png"
|
||||
dest_files=["res://.godot/imported/hammerheadRibozyme-hunting.png-9b9929a81db6474a29fbff93ee4f1cef.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
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://jyuf4lgjo64"
|
||||
path="res://.godot/imported/hammerheadRibozyme-hurt.png-6a7eeaef121ff058edf73e3d18dfd77e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/predator/hammerheadRibozyme-hurt.png"
|
||||
dest_files=["res://.godot/imported/hammerheadRibozyme-hurt.png-6a7eeaef121ff058edf73e3d18dfd77e.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
|
||||
BIN
evolve-die-repeat/molecular/assets/predator/predator-healthy.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ch5rddsumyyhm"
|
||||
path="res://.godot/imported/predator-healthy.png-4df87d98e435e1fb3d3b0c12615f1c9b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://molecular/assets/predator/predator-healthy.png"
|
||||
dest_files=["res://.godot/imported/predator-healthy.png-4df87d98e435e1fb3d3b0c12615f1c9b.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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-dying-frame0.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
@@ -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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-dying-frame1.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
@@ -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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-healthy-frame0.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
@@ -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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-healthy-frame1.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
@@ -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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-injured-frame0.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
@@ -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
|
||||
BIN
evolve-die-repeat/molecular/assets/prey/prey-injured-frame1.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
@@ -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
|
||||
11
evolve-die-repeat/molecular/fade.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var color_rect: ColorRect = $ColorRect
|
||||
|
||||
func _ready() -> void:
|
||||
color_rect.color.a = 0
|
||||
|
||||
func fade(target_alpha: float, duration: float):
|
||||
var tween = create_tween()
|
||||
tween.tween_property(color_rect, "color:a", target_alpha, duration)
|
||||
return tween
|
||||
1
evolve-die-repeat/molecular/fade.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bwf56ehqo32gr
|
||||
14
evolve-die-repeat/molecular/fade.tscn
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_scene format=3 uid="uid://3eg3a8ceom4l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bwf56ehqo32gr" path="res://molecular/fade.gd" id="1_rx8rx"]
|
||||
|
||||
[node name="Fade" type="CanvasLayer" unique_id=853660457]
|
||||
script = ExtResource("1_rx8rx")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=1320853444]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0)
|
||||
23
evolve-die-repeat/molecular/food/abstract_food.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
@abstract
|
||||
class_name AbstractFood
|
||||
extends Node2D
|
||||
|
||||
@export var val: int = 1
|
||||
@export var food_name: String = "Food"
|
||||
|
||||
@export var flow_carry_speed: float = 10.0
|
||||
|
||||
signal consumed
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var dpos = Vector2(GameManager.flow_x, GameManager.flow_y) * delta * flow_carry_speed
|
||||
position += dpos
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
pass
|
||||
|
||||
func eat(consumer: Node2D) -> void:
|
||||
pass
|
||||
1
evolve-die-repeat/molecular/food/abstract_food.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://crujkjpjehrvv
|
||||
49
evolve-die-repeat/molecular/food/food_manager.gd
Normal file
@@ -0,0 +1,49 @@
|
||||
extends Node
|
||||
class_name FoodManager2D
|
||||
|
||||
var minCount: int = 20
|
||||
var _currentCount: int = 0
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
|
||||
@export var foodTypes: Array[PackedScene] = []
|
||||
|
||||
## The probabilities have to add up to 1.0
|
||||
@export var foodProbs: Array[float] = []
|
||||
|
||||
@export var spawnRange: Rect2 = Rect2(0, 0, 0, 0)
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
spawnRange = GameManager.extent
|
||||
call_deferred("_spawn_minimum")
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _spawn_minimum() -> void:
|
||||
while _currentCount < minCount:
|
||||
_spawn_random()
|
||||
|
||||
func _random_pos() -> Vector2:
|
||||
return Vector2(randf_range(spawnRange.position[0], spawnRange.size[0]), randf_range(spawnRange.position[1], spawnRange.size[1]))
|
||||
|
||||
func _spawn_random() -> void:
|
||||
var pos = _random_pos()
|
||||
_spawn_food(pos)
|
||||
_currentCount += 1
|
||||
|
||||
func _spawn_food(position: Vector2) -> void:
|
||||
var instance = foodTypes[rng.rand_weighted(foodProbs)].instantiate()
|
||||
instance.position = position
|
||||
call_deferred("add_child", instance)
|
||||
if instance.has_signal("consumed"):
|
||||
instance.consumed.connect(_on_entity_consumed)
|
||||
|
||||
|
||||
func _on_entity_consumed() -> void:
|
||||
_currentCount = max(0, _currentCount-1)
|
||||
call_deferred("_spawn_minimum")
|
||||
|
||||
1
evolve-die-repeat/molecular/food/food_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://7ua0qgyhphao
|
||||
7
evolve-die-repeat/molecular/food/food_manager.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://cuqw17010qgob"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://7ua0qgyhphao" path="res://molecular/food/food_manager.gd" id="1_7iais"]
|
||||
|
||||
[node name="FoodManager" type="Node2D" unique_id=858744014]
|
||||
script = ExtResource("1_7iais")
|
||||
metadata/_custom_type_script = "uid://7ua0qgyhphao"
|
||||
24
evolve-die-repeat/molecular/food/food_mol.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
extends AbstractFood
|
||||
class_name FoodMolecular
|
||||
|
||||
@onready var collision: Area2D = $Collision
|
||||
@onready var sprite: AnimatedSprite2D = $"Collision/Sprite"
|
||||
|
||||
func _ready() -> void:
|
||||
sprite.play()
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
eat(body)
|
||||
|
||||
func eat(consumer: Node2D) -> void:
|
||||
print(consumer.name + " ate: ", food_name)
|
||||
consumed.emit()
|
||||
|
||||
apply_effect(consumer)
|
||||
|
||||
queue_free()
|
||||
|
||||
func apply_effect(consumer: Node2D) -> void:
|
||||
if consumer.has_method("collect_resource"): # TODO: Define a "consumer" group instead?
|
||||
consumer.collect_resource(val) # val is from parent (default 1), override if required
|
||||
# TODO: *Some cool effect here*
|
||||
1
evolve-die-repeat/molecular/food/food_mol.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cayxffay17o0u
|
||||
85
evolve-die-repeat/molecular/food/food_mol.tscn
Normal file
@@ -0,0 +1,85 @@
|
||||
[gd_scene format=3 uid="uid://dmvmu218pc0pe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cayxffay17o0u" path="res://molecular/food/food_mol.gd" id="1_0vfbj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcedkos6vgv51" path="res://molecular/assets/food/food-normal.png" id="2_68e2u"]
|
||||
[ext_resource type="Script" uid="uid://bvbc0n0pslq7p" path="res://shared/wrapping_manager.gd" id="3_8lhj0"]
|
||||
[ext_resource type="Texture2D" uid="uid://xaqiha5lh1vt" path="res://molecular/assets/food/food-left-bolt.png" id="4_88m7w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dj4lyyloj1ke1" path="res://molecular/assets/food/food-left-bottom-bolt.png" id="5_i3g2v"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbynycukppmup" path="res://molecular/assets/food/food-right-bottom-bolt.png" id="6_07uaq"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_oo5vd"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_88m7w")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_i3g2v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_88m7w")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6_07uaq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_68e2u")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_0vfbj"]
|
||||
radius = 5.0
|
||||
|
||||
[node name="FoodMol" type="Node2D" unique_id=742430243]
|
||||
script = ExtResource("1_0vfbj")
|
||||
collision_layer = 8
|
||||
collision_mask = 7
|
||||
val = null
|
||||
food_name = null
|
||||
flow_carry_speed = null
|
||||
metadata/_custom_type_script = "uid://cayxffay17o0u"
|
||||
|
||||
[node name="Collision" type="Area2D" parent="." unique_id=927700818]
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="Collision" unique_id=1856148995]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_oo5vd")
|
||||
frame_progress = 0.9373464
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Collision" unique_id=98693723]
|
||||
visible = false
|
||||
scale = Vector2(0.385, 0.385)
|
||||
texture = ExtResource("2_68e2u")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collision" unique_id=762721134]
|
||||
shape = SubResource("CircleShape2D_0vfbj")
|
||||
|
||||
[node name="WrappingManager" type="Node" parent="." unique_id=1406150436 node_paths=PackedStringArray("sprite", "shape")]
|
||||
script = ExtResource("3_8lhj0")
|
||||
sprite = NodePath("../Collision/Sprite")
|
||||
shape = NodePath("../Collision/CollisionShape2D")
|
||||
dupFlags = 0
|
||||
metadata/_custom_type_script = "uid://bvbc0n0pslq7p"
|
||||
|
||||
[connection signal="body_entered" from="Collision" to="." method="_on_body_entered"]
|
||||
124
evolve-die-repeat/molecular/molecular_player.gd
Normal file
@@ -0,0 +1,124 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var attack_duration: float = 0.4
|
||||
@export var attack_cooldown_duration: float = 0.6
|
||||
|
||||
@onready var attack_area: Area2D = $AttackArea
|
||||
@onready var attack_timer: Timer = $AttackTimer
|
||||
@onready var attack_cooldown_timer: Timer = $AttackCooldownTimer
|
||||
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
# TODO: these stats are shared across most entities; extract to resource?
|
||||
@export var speed: int = 200
|
||||
var damage: int = 10
|
||||
var can_attack: bool = true
|
||||
var desired_rotation: float = 0
|
||||
|
||||
# Resources / money
|
||||
var resources: int = 0
|
||||
|
||||
# Health
|
||||
var maxHealth: int = 100
|
||||
var healthPoints: int = 100
|
||||
var isAlive: bool = true
|
||||
@onready var invulnerable_cooldown_timer: Timer = $InvulnerableCooldownTimer
|
||||
var hasiframes: bool = false # only used for iframe after collision for now
|
||||
|
||||
func _ready() -> void:
|
||||
var screen_size = get_viewport_rect().size
|
||||
GameManager.init_screen_size(screen_size.x, screen_size.y)
|
||||
|
||||
attack_area.monitoring = false # no collision until attacking TODO: Thing about being attacked
|
||||
attack_timer.wait_time = attack_duration
|
||||
attack_cooldown_timer.wait_time = attack_cooldown_duration
|
||||
|
||||
sprite.play("default")
|
||||
|
||||
|
||||
func _process(delta):
|
||||
# TODO: Connects this to some respawn screen
|
||||
if isAlive:
|
||||
velocity = Vector2.ZERO
|
||||
if Input.is_action_pressed("move_right"):
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed("move_left"):
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed("move_down"):
|
||||
velocity.y += 1
|
||||
if Input.is_action_pressed("move_up"):
|
||||
velocity.y -= 1
|
||||
if Input.is_action_pressed("try_attack"):
|
||||
try_attack()
|
||||
|
||||
|
||||
if not velocity.is_zero_approx():
|
||||
self.desired_rotation = atan2(velocity.y, velocity.x)
|
||||
|
||||
# smoothly rotate
|
||||
if self.rotation != self.desired_rotation:
|
||||
self.rotation = lerp_angle(self.rotation, self.desired_rotation, clampf(4 * delta, 0, 1))
|
||||
|
||||
move_and_collide(speed * velocity * delta)
|
||||
position = GameManager.get_boundaried_position(position)
|
||||
|
||||
func try_attack() -> void:
|
||||
if not can_attack:
|
||||
return
|
||||
attack()
|
||||
|
||||
func attack() -> void:
|
||||
can_attack = false
|
||||
attack_area.monitoring = true
|
||||
attack_timer.start()
|
||||
sprite.play("attacking")
|
||||
|
||||
func _on_attack_timeout() -> void:
|
||||
attack_area.monitoring = false
|
||||
sprite.play("default")
|
||||
attack_cooldown_timer.start()
|
||||
|
||||
func _on_attack_cooldown_timeout() -> void:
|
||||
can_attack = true
|
||||
|
||||
func _on_attack_hit(body: Node2D) -> void:
|
||||
var hit_hittable = false
|
||||
if body.is_in_group("prey") or body.is_in_group("predator"):
|
||||
if body.has_method("handle_damage"):
|
||||
body.handle_damage(damage, self)
|
||||
hit_hittable = true
|
||||
if hit_hittable:
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
sprite.play("default")
|
||||
|
||||
func _on_invulnerable_cooldown_timeout() -> void:
|
||||
hasiframes = false
|
||||
|
||||
func handle_damage(dmg: int, src: Node) -> void:
|
||||
# TODO: enhanced damage logic (src entity effects?)
|
||||
if not hasiframes:
|
||||
print("Player took %d damage." % dmg)
|
||||
healthPoints -= dmg
|
||||
hasiframes = true
|
||||
invulnerable_cooldown_timer.start()
|
||||
if isAlive and healthPoints <= 0:
|
||||
die()
|
||||
|
||||
func collect_resource(damnt: int) -> void:
|
||||
resources += damnt
|
||||
print("Resource collected! Total: ", resources)
|
||||
|
||||
func die() -> void:
|
||||
print("Player died.")
|
||||
isAlive = false
|
||||
GameManager.switch_scene("respawn")
|
||||
|
||||
# TODO: Is this used or should it be removed? (currently unused)
|
||||
func respawm() -> void:
|
||||
healthPoints = maxHealth
|
||||
isAlive = true
|
||||
hasiframes = true
|
||||
attack_cooldown_timer.start()
|
||||
|
||||
|
||||
|
||||
|
||||
1
evolve-die-repeat/molecular/molecular_player.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://di7eglnrnqm6i
|
||||
74
evolve-die-repeat/molecular/molecular_player.tscn
Normal file
@@ -0,0 +1,74 @@
|
||||
[gd_scene format=3 uid="uid://dxluckxdkpv4f"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://di7eglnrnqm6i" path="res://molecular/molecular_player.gd" id="1_0ix7k"]
|
||||
[ext_resource type="Texture2D" uid="uid://du1lb4nr47kvl" path="res://molecular/assets/player-sprite-attacking.png" id="2_rq1v6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsd1qtw50esai" path="res://molecular/assets/player-sprite-attacking2.png" id="3_xiwfn"]
|
||||
[ext_resource type="Texture2D" uid="uid://cd0iv6hsi3fad" path="res://molecular/assets/player-sprite.png" id="4_rq1v6"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_onrkg"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 0.5,
|
||||
"texture": ExtResource("2_rq1v6")
|
||||
}, {
|
||||
"duration": 4.0,
|
||||
"texture": ExtResource("3_xiwfn")
|
||||
}, {
|
||||
"duration": 0.5,
|
||||
"texture": ExtResource("2_rq1v6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"attacking",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 5.0,
|
||||
"texture": ExtResource("4_rq1v6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_5hxmy"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4flbx"]
|
||||
radius = 5.999982
|
||||
height = 27.990019
|
||||
|
||||
[node name="player" type="CharacterBody2D" unique_id=2032508208]
|
||||
collision_mask = 14
|
||||
script = ExtResource("1_0ix7k")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1745800698]
|
||||
visibility_layer = 2
|
||||
sprite_frames = SubResource("SpriteFrames_onrkg")
|
||||
animation = &"attacking"
|
||||
|
||||
[node name="AttackArea" type="Area2D" parent="." unique_id=187975387]
|
||||
position = Vector2(0, 56)
|
||||
rotation = -1.5732701
|
||||
collision_mask = 6
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackArea" unique_id=1968501358]
|
||||
position = Vector2(55.977566, 9.138502)
|
||||
shape = SubResource("CircleShape2D_5hxmy")
|
||||
debug_color = Color(0.80813414, 0.3957308, 0.3356335, 0.41960785)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2137063701 groups=["player"]]
|
||||
rotation = -1.5732701
|
||||
shape = SubResource("CapsuleShape2D_4flbx")
|
||||
|
||||
[node name="AttackTimer" type="Timer" parent="." unique_id=2057433652]
|
||||
one_shot = true
|
||||
|
||||
[node name="AttackCooldownTimer" type="Timer" parent="." unique_id=1056439284]
|
||||
one_shot = true
|
||||
|
||||
[node name="InvulnerableCooldownTimer" type="Timer" parent="." unique_id=311411582]
|
||||
one_shot = true
|
||||
|
||||
[connection signal="body_entered" from="AttackArea" to="." method="_on_attack_hit"]
|
||||
[connection signal="timeout" from="AttackTimer" to="." method="_on_attack_timeout"]
|
||||
[connection signal="timeout" from="AttackCooldownTimer" to="." method="_on_attack_cooldown_timeout"]
|
||||
[connection signal="timeout" from="InvulnerableCooldownTimer" to="." method="_on_invulnerable_cooldown_timeout"]
|
||||
131
evolve-die-repeat/molecular/molecular_stage.tscn
Normal file
22
evolve-die-repeat/molecular/predator/collision.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
var desired_rotation: float = self.rotation
|
||||
@export var speed = 0.8
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
# smoothly rotate
|
||||
if self.rotation != self.desired_rotation:
|
||||
self.rotation = lerp_angle(self.rotation, self.desired_rotation, clampf(4 * delta, 0, 1))
|
||||
|
||||
func move(motion: Vector3, mod: float) -> void:
|
||||
self.desired_rotation = atan2(motion.y, motion.x)
|
||||
move_and_collide(Vector2(motion.x, motion.y).normalized() * self.speed * mod) # Moves along the given vector
|
||||
|
||||
# Apply boundary to new position
|
||||
position = GameManager.get_boundaried_position(position)
|
||||
|
||||
func duplicate_init() -> void:
|
||||
var sight = $Sight
|
||||
remove_child(sight)
|
||||
sight.queue_free()
|
||||
1
evolve-die-repeat/molecular/predator/collision.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cus6ogtwxx4v7
|
||||
74
evolve-die-repeat/molecular/predator/hammerhead_predator.gd
Normal file
@@ -0,0 +1,74 @@
|
||||
extends AbstractPredator
|
||||
|
||||
# FIXME: (general) tracking across wrapping boundary
|
||||
|
||||
var starting_pos
|
||||
var can_attack: bool = true
|
||||
@onready var fsm: StateMachine = $StateMachine
|
||||
@onready var attack_cooldown_timer: Timer = $AttackCooldownTimer
|
||||
@onready var wrapper: WrappingManager = $WrappingManager
|
||||
@onready var collision: CharacterBody2D = $Collision
|
||||
@onready var sprite = $"Collision/Sprite"
|
||||
@export var damage: int = 15
|
||||
@export var attack_range = 40
|
||||
@export var sight_range = 200
|
||||
|
||||
func _ready() -> void:
|
||||
health = maxHealth
|
||||
sprite.play("Healthy")
|
||||
if starting_pos:
|
||||
collision.set_position(starting_pos)
|
||||
|
||||
func move(motion: Vector3, mod: float = 1.0) -> void:
|
||||
collision.move(motion, mod)
|
||||
|
||||
|
||||
func set_position(pos: Vector2) -> void:
|
||||
if collision:
|
||||
collision.set_position(pos)
|
||||
else:
|
||||
starting_pos = pos
|
||||
|
||||
func try_attack(target: Node) -> void:
|
||||
if not can_attack:
|
||||
return
|
||||
attack(target)
|
||||
|
||||
func attack(target: Node) -> void:
|
||||
can_attack = false
|
||||
var hit_hittable = false
|
||||
if target.is_in_group("prey") or target.is_in_group("player"):
|
||||
if target.has_method("handle_damage"):
|
||||
target.handle_damage(damage, self.collision)
|
||||
hit_hittable = true
|
||||
elif target.is_in_group("resources"):
|
||||
# TODO: resource handling logic
|
||||
pass
|
||||
if hit_hittable:
|
||||
attack_cooldown_timer.start()
|
||||
|
||||
|
||||
func handle_damage(dmg: int, src: Node) -> void:
|
||||
health = max(0, health-dmg)
|
||||
if health == 0:
|
||||
die()
|
||||
if health < maxHealth/2:
|
||||
become_injured()
|
||||
fsm.transition_to_next_state(fsm.States.FLEEING, {"threat": src})
|
||||
elif health < maxHealth:
|
||||
become_injured()
|
||||
fsm.transition_to_next_state(fsm.States.HUNTING, {"target": src})
|
||||
|
||||
func die() -> void:
|
||||
super.die()
|
||||
|
||||
func become_injured() -> void:
|
||||
sprite.play("Hurt")
|
||||
wrapper.play_sprite("Hurt")
|
||||
|
||||
func _on_sight_body_entered(body: Node2D) -> void:
|
||||
if fsm.map(fsm.state) != fsm.States.HUNTING and body.is_in_group("prey") or (health < maxHealth and body.is_in_group("player")):
|
||||
fsm.transition_to_next_state(fsm.States.HUNTING, {"target": body})
|
||||
|
||||
func _on_attack_cooldown_timer_timeout() -> void:
|
||||
can_attack = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://d07cjelbqbiug
|
||||
160
evolve-die-repeat/molecular/predator/hammerhead_predator.tscn
Normal file
@@ -0,0 +1,160 @@
|
||||
[gd_scene format=3 uid="uid://s4s66oaexava"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d07cjelbqbiug" path="res://molecular/predator/hammerhead_predator.gd" id="1_xp037"]
|
||||
[ext_resource type="Script" uid="uid://cus6ogtwxx4v7" path="res://molecular/predator/collision.gd" id="2_7qt2q"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch5rddsumyyhm" path="res://molecular/assets/predator/predator-healthy.png" id="2_34kwa"]
|
||||
[ext_resource type="Texture2D" uid="uid://30uwkdbnuu3h" path="res://molecular/assets/predator/hammerheadRibozyme-hunting.png" id="3_0ts4d"]
|
||||
[ext_resource type="Script" uid="uid://cygrmt03sx0k1" path="res://molecular/predator/state_machine.gd" id="3_xp037"]
|
||||
[ext_resource type="Script" uid="uid://xbiqj7ubmj7d" path="res://molecular/prey/state_idle.gd" id="4_8a23j"]
|
||||
[ext_resource type="Texture2D" uid="uid://jyuf4lgjo64" path="res://molecular/assets/predator/hammerheadRibozyme-hurt.png" id="4_shhro"]
|
||||
[ext_resource type="Script" uid="uid://ubcu8fdfxxj1" path="res://molecular/prey/state_random_movement.gd" id="5_6rsu5"]
|
||||
[ext_resource type="Script" uid="uid://bc7apl71t0q04" path="res://molecular/predator/state_hunting.gd" id="8_7qt2q"]
|
||||
[ext_resource type="Script" uid="uid://bvbc0n0pslq7p" path="res://shared/wrapping_manager.gd" id="9_shhro"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8a23j"]
|
||||
atlas = ExtResource("2_34kwa")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6rsu5"]
|
||||
atlas = ExtResource("2_34kwa")
|
||||
region = Rect2(64, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ts4d"]
|
||||
atlas = ExtResource("2_34kwa")
|
||||
region = Rect2(128, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nu6jw"]
|
||||
atlas = ExtResource("3_0ts4d")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8inuv"]
|
||||
atlas = ExtResource("3_0ts4d")
|
||||
region = Rect2(64, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_orf3n"]
|
||||
atlas = ExtResource("3_0ts4d")
|
||||
region = Rect2(128, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vkkje"]
|
||||
atlas = ExtResource("4_shhro")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jfmyn"]
|
||||
atlas = ExtResource("4_shhro")
|
||||
region = Rect2(64, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f26lq"]
|
||||
atlas = ExtResource("4_shhro")
|
||||
region = Rect2(128, 0, 64, 64)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_shhro"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_8a23j")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_6rsu5")
|
||||
}, {
|
||||
"duration": 4.0,
|
||||
"texture": SubResource("AtlasTexture_0ts4d")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Healthy",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nu6jw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8inuv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_orf3n")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Hunting",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vkkje")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jfmyn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f26lq")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Hurt",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="HammerheadPredator" type="Node" unique_id=1312337720]
|
||||
script = ExtResource("1_xp037")
|
||||
maxHealth = 50
|
||||
metadata/_custom_type_script = "uid://dgfimmq53whll"
|
||||
|
||||
[node name="Collision" type="CharacterBody2D" parent="." unique_id=76553184 groups=["predator"]]
|
||||
scale = Vector2(0.8, 0.8)
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource("2_7qt2q")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="Collision" unique_id=410999609]
|
||||
rotation = -1.5707964
|
||||
sprite_frames = SubResource("SpriteFrames_shhro")
|
||||
animation = &"Healthy"
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Collision" unique_id=1596156928]
|
||||
light_mask = 4
|
||||
visibility_layer = 4
|
||||
position = Vector2(0.111679085, 1.1167793)
|
||||
rotation = -1.5707964
|
||||
polygon = PackedVector2Array(-22.184862, -27.994831, 23.481365, -27.21198, 13.82622, 25.891317, -6.005971, 25.891317)
|
||||
|
||||
[node name="Sight" type="Area2D" parent="Collision" unique_id=1608385873]
|
||||
collision_layer = 0
|
||||
collision_mask = 7
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Collision/Sight" unique_id=1707240701]
|
||||
light_mask = 4
|
||||
visibility_layer = 4
|
||||
position = Vector2(-1.0900421, 1.6350927)
|
||||
rotation = -1.5707964
|
||||
polygon = PackedVector2Array(-27.769547, -29.426758, 31.88504, -29.184647, 12.700996, 28.7294, 56.058624, 148.93633, 22.979004, 163.77974, -19.854843, 161.65926, -53.782654, 143.84715, -8.333115, 30.157196)
|
||||
|
||||
[node name="WrappingManager" type="Node" parent="." unique_id=826586678]
|
||||
script = ExtResource("9_shhro")
|
||||
metadata/_custom_type_script = "uid://bvbc0n0pslq7p"
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." unique_id=1857729810 node_paths=PackedStringArray("initial_state")]
|
||||
script = ExtResource("3_xp037")
|
||||
initial_state = NodePath("RandomMovement")
|
||||
metadata/_custom_type_script = "uid://ck7k8ht54snsy"
|
||||
|
||||
[node name="Idle" type="Node" parent="StateMachine" unique_id=265876039]
|
||||
script = ExtResource("4_8a23j")
|
||||
|
||||
[node name="Timer" type="Timer" parent="StateMachine/Idle" unique_id=1870665609]
|
||||
one_shot = true
|
||||
|
||||
[node name="RandomMovement" type="Node" parent="StateMachine" unique_id=105315122]
|
||||
script = ExtResource("5_6rsu5")
|
||||
|
||||
[node name="Timer" type="Timer" parent="StateMachine/RandomMovement" unique_id=447822526]
|
||||
one_shot = true
|
||||
|
||||
[node name="Hunting" type="Node" parent="StateMachine" unique_id=1569866955]
|
||||
script = ExtResource("8_7qt2q")
|
||||
|
||||
[node name="AttackCooldownTimer" type="Timer" parent="." unique_id=435253442]
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
|
||||
[connection signal="body_entered" from="Collision/Sight" to="." method="_on_sight_body_entered"]
|
||||
[connection signal="timeout" from="StateMachine/Idle/Timer" to="StateMachine/Idle" method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="StateMachine/RandomMovement/Timer" to="StateMachine/RandomMovement" method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="AttackCooldownTimer" to="." method="_on_attack_cooldown_timer_timeout"]
|
||||
26
evolve-die-repeat/molecular/predator/state_hunting.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
extends State
|
||||
|
||||
var target: Node2D
|
||||
|
||||
func enter(previous_state_path: String, data := {}) -> void:
|
||||
if data.has("target"):
|
||||
target = data["target"]
|
||||
owner.sprite.play("Hunting")
|
||||
else:
|
||||
# default behaviour; do nothing
|
||||
finished.emit(owner.fsm.States.IDLE, {})
|
||||
|
||||
func physics_update(_delta: float) -> void:
|
||||
if target == null or GameManager.calc_distance(owner.collision.position, target.position) > owner.sight_range:
|
||||
finished.emit(owner.fsm.States.IDLE, {})
|
||||
return
|
||||
|
||||
# alternatively, we could use a collision shape and inbuilt signals, but im not sure if that works better (mixing signals and custom fsm stuff i mean
|
||||
if GameManager.calc_distance(owner.collision.position, target.position) > owner.attack_range:
|
||||
owner.move(move_towards(target.position))
|
||||
else:
|
||||
owner.attack(target)
|
||||
|
||||
func move_towards(pos: Vector2) -> Vector3:
|
||||
var diff = target.position - owner.collision.position
|
||||
return Vector3(diff.x, diff.y ,0)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bc7apl71t0q04
|
||||
28
evolve-die-repeat/molecular/predator/state_machine.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends StateMachine
|
||||
|
||||
enum States {IDLE, RANDOMMOVEMENT, FEEDING, FLEEING, HUNTING}
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
super()
|
||||
await owner.ready
|
||||
|
||||
|
||||
func transition_to_next_state(target: int, data: Dictionary = {}) -> void:
|
||||
match target:
|
||||
States.IDLE: _transition_to_next_state("Idle", data)
|
||||
States.RANDOMMOVEMENT: _transition_to_next_state("RandomMovement", data)
|
||||
States.FEEDING: _transition_to_next_state("Feeding", data)
|
||||
States.FLEEING: _transition_to_next_state("Fleeing", data)
|
||||
States.HUNTING: _transition_to_next_state("Hunting", data)
|
||||
_: push_error("Trying to transition to unknown state {target}")
|
||||
|
||||
func map(state: Node) -> States:
|
||||
match state.name:
|
||||
"Idle": return States.IDLE
|
||||
"RandomMovement": return States.RANDOMMOVEMENT
|
||||
"Feeding": return States.FEEDING
|
||||
"Fleeing": return States.FLEEING
|
||||
"Hunting": return States.HUNTING
|
||||
_: push_error("Unknown state {state.name}")
|
||||
return map(self.initial_state)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cygrmt03sx0k1
|
||||
28
evolve-die-repeat/molecular/prey/collision.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
var desired_rotation: float = self.rotation
|
||||
@export var speed = 0.5
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
# smoothly rotate
|
||||
if self.rotation != self.desired_rotation:
|
||||
self.rotation = lerp_angle(self.rotation, self.desired_rotation, clampf(4 * delta, 0, 1))
|
||||
|
||||
func move(motion: Vector3, mod: float) -> void:
|
||||
move_and_collide(Vector2(motion.x, motion.y).normalized() * self.speed * mod) # Moves along the given vector
|
||||
self.desired_rotation = atan2(motion.y, motion.x)
|
||||
|
||||
# Apply boundary to new position
|
||||
position = GameManager.get_boundaried_position(position)
|
||||
|
||||
|
||||
func handle_damage(dmg: int, src: Node) -> void:
|
||||
if owner:
|
||||
owner.handle_damage(dmg, src)
|
||||
|
||||
func duplicate_init() -> void:
|
||||
var sight = $Sight
|
||||
remove_child(sight)
|
||||
sight.queue_free()
|
||||
1
evolve-die-repeat/molecular/prey/collision.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dcd4lhhq8pubb
|
||||
45
evolve-die-repeat/molecular/prey/nucleotide_prey.gd
Normal file
@@ -0,0 +1,45 @@
|
||||
extends AbstractPrey
|
||||
|
||||
@onready var wrapper: WrappingManager = $WrappingManager
|
||||
@onready var collision: CharacterBody2D = $Collision
|
||||
@onready var sprite: AnimatedSprite2D = $"Collision/Sprite"
|
||||
@onready var fsm: StateMachine = $StateMachine
|
||||
var starting_pos
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
health = maxHealth
|
||||
sprite.play("Healthy")
|
||||
if starting_pos:
|
||||
collision.set_position(starting_pos)
|
||||
|
||||
func set_position(pos: Vector2) -> void:
|
||||
if collision:
|
||||
collision.set_position(pos)
|
||||
else:
|
||||
starting_pos = pos
|
||||
|
||||
func move(motion: Vector3, mod: float = 1.0) -> void:
|
||||
collision.move(motion, mod)
|
||||
|
||||
func handle_damage(dmg: int, src: Node) -> void:
|
||||
health = max(0, health-dmg)
|
||||
if health == 0:
|
||||
die()
|
||||
if health < maxHealth:
|
||||
become_injured()
|
||||
fsm.transition_to_next_state(fsm.States.FLEEING, {"threat": src})
|
||||
|
||||
func die() -> void:
|
||||
sprite.play("Dying")
|
||||
wrapper.play_sprite("Dying")
|
||||
GameManager.foodManager._spawn_food(collision.position)
|
||||
super.die()
|
||||
|
||||
func become_injured() -> void:
|
||||
sprite.play("Injured")
|
||||
wrapper.play_sprite("Injured")
|
||||
|
||||
func _on_sight_body_entered(body: Node2D) -> void:
|
||||
if body.is_in_group("predator") or (health < maxHealth and body.is_in_group("player")):
|
||||
fsm.transition_to_next_state(fsm.States.FLEEING, {"threat": body})
|
||||
1
evolve-die-repeat/molecular/prey/nucleotide_prey.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bgossk6xo31gi
|
||||
114
evolve-die-repeat/molecular/prey/nucleotide_prey.tscn
Normal file
@@ -0,0 +1,114 @@
|
||||
[gd_scene format=3 uid="uid://c3iw2v3x6ngrb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bvsdg1v3ksixy" path="res://shared/npc/abstractPrey.tscn" id="1_qvulj"]
|
||||
[ext_resource type="Script" uid="uid://bgossk6xo31gi" path="res://molecular/prey/nucleotide_prey.gd" id="2_0227s"]
|
||||
[ext_resource type="Texture2D" uid="uid://bhcb5g7g7um8" path="res://molecular/assets/prey/prey-dying-frame0.png" id="2_lkj7f"]
|
||||
[ext_resource type="Script" uid="uid://bvbc0n0pslq7p" path="res://shared/wrapping_manager.gd" id="3_lecx4"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxn11avw7dykl" path="res://molecular/assets/prey/prey-dying-frame1.png" id="3_svqyr"]
|
||||
[ext_resource type="Script" uid="uid://dcd4lhhq8pubb" path="res://molecular/prey/collision.gd" id="3_teu34"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctkehsavw6ghx" path="res://molecular/assets/prey/prey-healthy-frame0.png" id="4_ee1gb"]
|
||||
[ext_resource type="Texture2D" uid="uid://uy28y3mkk6nt" path="res://molecular/assets/prey/prey-healthy-frame1.png" id="5_ae5nf"]
|
||||
[ext_resource type="Texture2D" uid="uid://btnyajci8ptb2" path="res://molecular/assets/prey/prey-injured-frame0.png" id="6_0f87h"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqll8ge4cr2uf" path="res://molecular/assets/prey/prey-injured-frame1.png" id="7_w7inl"]
|
||||
[ext_resource type="Script" uid="uid://0vwv2nt16gpv" path="res://molecular/prey/state_machine.gd" id="9_xxtgy"]
|
||||
[ext_resource type="Script" uid="uid://ubcu8fdfxxj1" path="res://molecular/prey/state_random_movement.gd" id="10_rgguv"]
|
||||
[ext_resource type="Script" uid="uid://xbiqj7ubmj7d" path="res://molecular/prey/state_idle.gd" id="12_ubfhk"]
|
||||
[ext_resource type="Script" uid="uid://dlw7inlh6asvu" path="res://molecular/prey/state_fleeing.gd" id="12_xxtgy"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_66x8p"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_lkj7f")
|
||||
}, {
|
||||
"duration": 20.0,
|
||||
"texture": ExtResource("3_svqyr")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Dying",
|
||||
"speed": 1.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_ee1gb")
|
||||
}, {
|
||||
"duration": 20.0,
|
||||
"texture": ExtResource("5_ae5nf")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Healthy",
|
||||
"speed": 1.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6_0f87h")
|
||||
}, {
|
||||
"duration": 20.0,
|
||||
"texture": ExtResource("7_w7inl")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Injured",
|
||||
"speed": 1.0
|
||||
}]
|
||||
|
||||
[node name="NucleotidePrey" unique_id=740525631 groups=["prey"] instance=ExtResource("1_qvulj")]
|
||||
script = ExtResource("2_0227s")
|
||||
maxHealth = 20
|
||||
|
||||
[node name="Collision" type="CharacterBody2D" parent="." index="0" unique_id=331517910 groups=["prey"]]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
collision_layer = 2
|
||||
collision_mask = 5
|
||||
script = ExtResource("3_teu34")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Collision" index="0" unique_id=1471691984]
|
||||
light_mask = 2
|
||||
visibility_layer = 2
|
||||
position = Vector2(69, 28)
|
||||
rotation = 0.47415397
|
||||
scale = Vector2(10, 10)
|
||||
polygon = PackedVector2Array(-8.700367, -2.2789505, -5.6133537, -2.1772134, -4.1979375, 0.58079255, -5.9151926, 3.1480935, -8.862037, 2.9326901, -10.268076, 0.28495264)
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="Collision" index="1" unique_id=788182944]
|
||||
rotation = 1.5707964
|
||||
sprite_frames = SubResource("SpriteFrames_66x8p")
|
||||
animation = &"Healthy"
|
||||
|
||||
[node name="Sight" type="Area2D" parent="Collision" index="2" unique_id=1773478588]
|
||||
scale = Vector2(0.4, 0.4)
|
||||
collision_layer = 0
|
||||
collision_mask = 7
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Collision/Sight" index="0" unique_id=338757598]
|
||||
light_mask = 2
|
||||
visibility_layer = 2
|
||||
rotation = 1.5707964
|
||||
scale = Vector2(10, 10)
|
||||
polygon = PackedVector2Array(3.8686981, -6.2705374, 7.0000973, -0.08602524, 3.5555592, 5.6287766, -3.0986624, 5.589636, -6.1517763, 0.031402588, -2.942093, -6.0748243, -29.993027, -74.37026, -11.10141, -83.6233, 9.332382, -84.00884, 35.163773, -77.06906)
|
||||
|
||||
[node name="WrappingManager" type="Node" parent="." index="1" unique_id=407460873]
|
||||
script = ExtResource("3_lecx4")
|
||||
metadata/_custom_type_script = "uid://bvbc0n0pslq7p"
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." index="2" unique_id=445822474 node_paths=PackedStringArray("initial_state")]
|
||||
script = ExtResource("9_xxtgy")
|
||||
initial_state = NodePath("Idle")
|
||||
|
||||
[node name="RandomMovement" type="Node" parent="StateMachine" index="0" unique_id=1422146232]
|
||||
script = ExtResource("10_rgguv")
|
||||
|
||||
[node name="Timer" type="Timer" parent="StateMachine/RandomMovement" index="0" unique_id=593528934]
|
||||
one_shot = true
|
||||
|
||||
[node name="Fleeing" type="Node" parent="StateMachine" index="1" unique_id=1125485674]
|
||||
script = ExtResource("12_xxtgy")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateMachine" index="2" unique_id=1424222731]
|
||||
script = ExtResource("12_ubfhk")
|
||||
|
||||
[node name="Timer" type="Timer" parent="StateMachine/Idle" index="0" unique_id=1050348256]
|
||||
one_shot = true
|
||||
|
||||
[connection signal="body_entered" from="Collision/Sight" to="." method="_on_sight_body_entered"]
|
||||
[connection signal="timeout" from="StateMachine/RandomMovement/Timer" to="StateMachine/RandomMovement" method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="StateMachine/Idle/Timer" to="StateMachine/Idle" method="_on_timer_timeout"]
|
||||