Basic character, trait and preference resources
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 10s
Create tag and build when new code gets to main / Export (push) Successful in 1m15s

This commit is contained in:
2026-01-30 22:30:52 +01:00
parent 44f251ed66
commit 3477b89145
200 changed files with 2518 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
@tool
extends Resource
class_name CharacterResource
@export var chara_sprite: Texture2D:
set(value):
chara_sprite = value
changed.emit()
@export_category("Mask settings")
@export var mask_eyes_location: Vector2 = Vector2.ZERO:
set(value):
mask_eyes_location = value
changed.emit()
@export var mask_mouth_location: Vector2 = Vector2.ZERO:
set(value):
mask_mouth_location = value
changed.emit()
@export_category("Traits and preferences")
@export var traits: Array[Trait]
@export var preferences: Array[Preference]

View File

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

View File

@@ -0,0 +1,45 @@
@tool
extends Node2D
class_name Character
@export var chara_resource: CharacterResource:
set(new_resource):
chara_resource = new_resource
_on_chara_resource_changed()
# Connect the changed signal as soon as a new resource is being added.
if chara_resource != null:
chara_resource.changed.connect(_on_chara_resource_changed)
@onready var face: Sprite2D = $Face
@onready var mask_eyes: Mask = $MaskEyes
@onready var mask_mouth: Mask = $MaskMouth
var mask_eyes_location: Vector2
var mask_mouth_location: Vector2
func _on_chara_resource_changed() -> void:
face.texture = chara_resource.chara_sprite
mask_eyes_location = chara_resource.mask_eyes_location
mask_mouth_location = chara_resource.mask_mouth_location
# 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:
if Engine.is_editor_hint():
_engine_process(delta)
else:
_game_process(delta)
func _game_process(delta: float) -> void:
pass
func _engine_process(delta: float) -> void:
mask_eyes.position = mask_eyes_location
mask_mouth.position = mask_mouth_location

View File

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

View File

@@ -0,0 +1,20 @@
[gd_scene format=3 uid="uid://bvpyqyftqhy45"]
[ext_resource type="Script" uid="uid://dnt4l1eghm1gi" path="res://scenes/character/character.gd" id="1_cuyo6"]
[ext_resource type="Resource" uid="uid://da2ptl3f7h0ot" path="res://resources/characters/king.tres" id="2_fgi2k"]
[ext_resource type="Texture2D" uid="uid://c57s3oksagauh" path="res://assets/sprites/sprites by judas la carotte/sprite3 happy small.png" id="3_f8hpl"]
[ext_resource type="PackedScene" uid="uid://3jlukpb5hefb" path="res://scenes/mask/mask.tscn" id="3_mutn8"]
[node name="Character" type="Node2D" unique_id=138741531]
script = ExtResource("1_cuyo6")
chara_resource = ExtResource("2_fgi2k")
[node name="Face" type="Sprite2D" parent="." unique_id=855137033]
texture = ExtResource("3_f8hpl")
[node name="MaskMouth" parent="." unique_id=1087336064 instance=ExtResource("3_mutn8")]
position = Vector2(-13.425, -173.61)
[node name="MaskEyes" parent="." unique_id=428968220 instance=ExtResource("3_mutn8")]
position = Vector2(-7.325, -274.11)
scale = Vector2(2.599999, 0.76)

View File

@@ -0,0 +1,14 @@
extends Resource
class_name Preference
enum Pref {
LOVE,
APPROVE,
DONT_CARE,
DISAPPROVE,
HATE
}
@export var name: String
@export var trait_name: String
@export var preference: Pref

View File

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

11
scenes/character/tag.gd Normal file
View File

@@ -0,0 +1,11 @@
extends Resource
class_name TagResource
enum Stimuli {
VISION,
SPEAKING,
HEARING
}
@export var name: String
@export var stimulis: Array[Stimuli]

View File

@@ -0,0 +1 @@
uid://837kteb5ihhm

23
scenes/character/trait.gd Normal file
View File

@@ -0,0 +1,23 @@
extends Resource
class_name Trait
enum Stimuli {
VISION,
SOUND,
SMELL
}
@export var name : String
@export var stimulis : Array[Stimuli]
@export var tags : Array[String]
# 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

View File

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