2 Commits

Author SHA1 Message Date
712d2a41ea feat: parallax and more environment
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 7s
Create tag and build when new code gets to main / Export (push) Successful in 2m19s
2025-08-02 11:50:59 +02:00
5c9add1fe4 feat: new hit anim 2025-08-01 17:58:25 +02:00
7 changed files with 104 additions and 42 deletions

View File

@ -9,6 +9,7 @@ size = Vector2(630, 340)
script = ExtResource("1_f5lvx") script = ExtResource("1_f5lvx")
[node name="Area2D" type="Area2D" parent="."] [node name="Area2D" type="Area2D" parent="."]
visible = false
collision_layer = 0 collision_layer = 0
collision_mask = 2 collision_mask = 2
@ -16,6 +17,8 @@ collision_mask = 2
shape = SubResource("RectangleShape2D_7mycd") shape = SubResource("RectangleShape2D_7mycd")
[node name="Camera2D" type="Camera2D" parent="."] [node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
position_smoothing_speed = 30.0
[connection signal="body_entered" from="Area2D" to="." method="_on_body_entered"] [connection signal="body_entered" from="Area2D" to="." method="_on_body_entered"]
[connection signal="body_exited" from="Area2D" to="." method="_on_body_exited"] [connection signal="body_exited" from="Area2D" to="." method="_on_body_exited"]

21
main.gd
View File

@ -9,14 +9,26 @@ var active_camera: SuperCamera
@onready var opening_cutscene: AnimationPlayer = $OpeningCutscene @onready var opening_cutscene: AnimationPlayer = $OpeningCutscene
@onready var background_far: TileMapLayer = $BackgroundFar
@onready var background_middle: TileMapLayer = $BackgroundMiddle
@onready var background_close: TileMapLayer = $BackgroundClose
@onready var foreground_far: TileMapLayer = $ForegroundFar
@export_group("Parallax")
@export var parallax_far = 0.1
@export var parallax_middle = 0.3
@export var parallax_close = 0.5
@export var foreground = 0.8
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
for child in get_children(): for child in get_children():
if is_instance_of(child, SuperCamera): if is_instance_of(child, SuperCamera):
child.became_active.connect(on_camera_became_active) child.became_active.connect(on_camera_became_active)
opening_cutscene.play("opening_cutscene") #opening_cutscene.play("opening_cutscene")
opening_fade_to_black.visible = true #opening_fade_to_black.visible = true
func on_camera_became_active(camera: SuperCamera): func on_camera_became_active(camera: SuperCamera):
active_camera = camera active_camera = camera
@ -28,3 +40,8 @@ func _process(delta: float) -> void:
bubbles_back.global_position.x = active_camera.global_position.x bubbles_back.global_position.x = active_camera.global_position.x
bubbles_interior.global_position.x = active_camera.global_position.x bubbles_interior.global_position.x = active_camera.global_position.x
background_far.global_position.x = active_camera.global_position.x * parallax_far
background_middle.global_position.x = active_camera.global_position.x * parallax_middle
background_close.global_position.x = active_camera.global_position.x * parallax_close
foreground_far.global_position.x = active_camera.global_position.x * foreground

File diff suppressed because one or more lines are too long

BIN
player/assets/Outch.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwn548x0n4bpd"
path="res://.godot/imported/Outch.png-fb0d67fa327c4c83d19c4122b53475dc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player/assets/Outch.png"
dest_files=["res://.godot/imported/Outch.png-fb0d67fa327c4c83d19c4122b53475dc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@ -16,7 +16,7 @@ var gravity_modifier = 1
var animated_sprites = [] var animated_sprites = []
var is_in_cutscene = true var is_in_cutscene = false # back to true on build
var current_animation = "idle" var current_animation = "idle"
func play_anim(): func play_anim():
@ -63,9 +63,9 @@ func _physics_process(delta: float) -> void:
velocity += get_gravity() * delta * gravity_modifier velocity += get_gravity() * delta * gravity_modifier
var direction := Input.get_axis("move_left", "move_right") var direction := Input.get_axis("move_left", "move_right")
if direction > 0: if direction > 0 and is_on_floor():
look_right() look_right()
if direction < 0: if direction < 0 and is_on_floor():
look_left() look_left()

View File

@ -1,29 +1,21 @@
[gd_scene load_steps=32 format=3 uid="uid://yvp44oauis4n"] [gd_scene load_steps=30 format=3 uid="uid://yvp44oauis4n"]
[ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"] [ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"]
[ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"] [ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"]
[ext_resource type="Texture2D" uid="uid://dg1okdxx73qx2" path="res://player/assets/itch hurt 2 sheet-Sheet.png" id="3_g6k8r"] [ext_resource type="Texture2D" uid="uid://dwn548x0n4bpd" path="res://player/assets/Outch.png" id="3_rgyib"]
[ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"] [ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"]
[ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"] [ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"]
[ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"] [ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"]
[ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="5_qjkh3"] [ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="5_qjkh3"]
[ext_resource type="Texture2D" uid="uid://dw6tn0grt2ajc" path="res://player/assets/WalkCycle.png" id="5_rgyib"] [ext_resource type="Texture2D" uid="uid://dw6tn0grt2ajc" path="res://player/assets/WalkCycle.png" id="5_rgyib"]
[sub_resource type="AtlasTexture" id="AtlasTexture_boad6"]
atlas = ExtResource("3_g6k8r")
region = Rect2(80, 0, 80, 80)
[sub_resource type="AtlasTexture" id="AtlasTexture_rgyib"]
atlas = ExtResource("3_g6k8r")
region = Rect2(160, 0, 80, 80)
[sub_resource type="AtlasTexture" id="AtlasTexture_hg6s5"] [sub_resource type="AtlasTexture" id="AtlasTexture_hg6s5"]
atlas = ExtResource("3_g6k8r") atlas = ExtResource("3_rgyib")
region = Rect2(240, 0, 80, 80) region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_8t03j"] [sub_resource type="AtlasTexture" id="AtlasTexture_8t03j"]
atlas = ExtResource("3_g6k8r") atlas = ExtResource("3_rgyib")
region = Rect2(320, 0, 80, 80) region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"] [sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"]
atlas = ExtResource("4_rgyib") atlas = ExtResource("4_rgyib")
@ -101,20 +93,14 @@ region = Rect2(352, 0, 32, 32)
animations = [{ animations = [{
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_boad6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rgyib")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hg6s5") "texture": SubResource("AtlasTexture_hg6s5")
}, { }, {
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_8t03j") "texture": SubResource("AtlasTexture_8t03j")
}], }],
"loop": false, "loop": true,
"name": &"got_hit", "name": &"got_hit",
"speed": 10.0 "speed": 8.0
}, { }, {
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
@ -205,9 +191,9 @@ autoplay = "idle"
[node name="Base" type="AnimatedSprite2D" parent="."] [node name="Base" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -16) position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_mmwog") sprite_frames = SubResource("SpriteFrames_mmwog")
animation = &"jump" animation = &"got_hit"
autoplay = "idle" autoplay = "idle"
frame_progress = 0.808295 frame_progress = 0.993718
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false visible = false