From 395c25b1fbe51f42decf402f97e51eabcc8c0a77 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 18 Jun 2023 16:43:22 +0200 Subject: Godot v3 -> v4 --- Characters/Character.gd | 68 +++++++++++++------------ Characters/Character.tscn | 124 +++++++++++++++++++++++++++------------------ Characters/Dove.tscn | 124 +++++++++++++++++++++++++++------------------ Characters/Duck.tscn | 124 +++++++++++++++++++++++++++------------------ Characters/Elephant.tscn | 94 +++++++++++++++++++++------------- Characters/Monkey.tscn | 94 +++++++++++++++++++++------------- Characters/Pidgin.tscn | 124 +++++++++++++++++++++++++++------------------ Characters/Tux.tscn | 125 ++++++++++++++++++++++++++++------------------ 8 files changed, 536 insertions(+), 341 deletions(-) (limited to 'Characters') diff --git a/Characters/Character.gd b/Characters/Character.gd index 175094d..53260f2 100644 --- a/Characters/Character.gd +++ b/Characters/Character.gd @@ -1,11 +1,13 @@ -extends KinematicBody2D +extends CharacterBody2D -const SPEED = 130 +const SPEED = 450 const JUMPFORCE = -500 const GRAVITY = 20 +const RUNSPEED = SPEED * 2 +const WALLJUMPFORCE = JUMPFORCE * 0.75 +const WALLJUMPSPEED = SPEED * 10 -var velocity = Vector2() var direction = Enum.DIRECTION.RIGHT var canDoubleJump = false @@ -13,45 +15,45 @@ var hasPlayedFallStop = false var jumpHeightModifier = 0 -func _physics_process(_delta): +func _physics_process(delta): if Input.is_action_pressed("DIRECTION_LEFT"): velocity.x = -SPEED direction = Enum.DIRECTION.LEFT - $Sprite.flip_h = true + $Sprite2D.flip_h = true if self.is_running(): - velocity.x *= 2 - $Sprite.play("run") - else: - $Sprite.play("walk") + velocity.x = -RUNSPEED elif Input.is_action_pressed("DIRECTION_RIGHT"): velocity.x = SPEED direction = Enum.DIRECTION.RIGHT - $Sprite.flip_h = false + $Sprite2D.flip_h = false if self.is_running(): - velocity.x *= 2 - $Sprite.play("run") - else: - $Sprite.play("walk") - else: - $Sprite.play("idle") + velocity.x = RUNSPEED + + set_up_direction(Vector2.UP) - - velocity = move_and_slide(velocity, Vector2.UP) + if is_on_floor(): + if Input.is_action_pressed("DIRECTION_LEFT") or Input.is_action_pressed("DIRECTION_RIGHT"): + if self.is_running(): + $Sprite2D.play("run") + else: + $Sprite2D.play("walk") + else: + $Sprite2D.play("idle") # jump and fall animation if not is_on_floor(): - $Sprite.play("jump") + $Sprite2D.play("jump") if has_node("CheckFallStop"): if velocity.y > -JUMPFORCE: $CheckFallLanding.set_enabled(true) $CheckFallStop.set_enabled(true) if $CheckFallLanding.is_colliding(): - $Sprite.play("fall_stop_landing") + $Sprite2D.play("fall_stop_landing") elif $CheckFallStop.is_colliding(): - $Sprite.play("fall_stop") + $Sprite2D.play("fall_stop") else: - $Sprite.play("fall") + $Sprite2D.play("fall") else: $CheckFallLanding.set_enabled(false) $CheckFallStop.set_enabled(true) @@ -80,28 +82,32 @@ func _physics_process(_delta): if is_on_wall(): velocity.y *= 0.8 - $Sprite.play("wall") + $Sprite2D.play("wall") if Input.is_action_just_pressed("JUMP"): - velocity.y = JUMPFORCE * 0.75 + velocity.y = WALLJUMPFORCE if direction == Enum.DIRECTION.LEFT: - Input.action_release("DIRECTION_LEFT") - velocity.x = 2000 - $Sprite.flip_h = false + velocity.x = WALLJUMPSPEED + $Sprite2D.flip_h = false elif direction == Enum.DIRECTION.RIGHT: - Input.action_release("DIRECTION_RIGHT") - velocity.x = -2000 - $Sprite.flip_h = true + velocity.x = -WALLJUMPSPEED + $Sprite2D.flip_h = true # stop - velocity.x = lerp(velocity.x, 0, 0.7) + velocity = velocity.lerp(Vector2(0, velocity.y), 0.7) + + move_and_slide() func is_running(): return Input.is_action_pressed("RUN") and is_on_floor() +func canWallJump(): + return self.wallJumpGraceTimer < 0.1 + + func check_flag(): # $Sprite.play("dance anim") print("FLAG CHECKED") diff --git a/Characters/Character.tscn b/Characters/Character.tscn index 5b94efc..3016f35 100644 --- a/Characters/Character.tscn +++ b/Characters/Character.tscn @@ -1,84 +1,112 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=14 format=3 uid="uid://bxkau6af500fs"] -[ext_resource path="res://Characters/Character.gd" type="Script" id=1] -[ext_resource path="res://Assets/Characters/Tux/Front.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Tux/Wall.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Tux/Back.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Tux/Walk1.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Tux/Walk2.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Tux/Jump.png" type="Texture" id=7] -[ext_resource path="res://Assets/Characters/Tux/Slide.png" type="Texture" id=8] -[ext_resource path="res://Assets/Characters/Tux/Fall1.png" type="Texture" id=9] -[ext_resource path="res://Assets/Characters/Tux/Fall1Wings.png" type="Texture" id=10] -[ext_resource path="res://Assets/Characters/Tux/Fall2Wings.png" type="Texture" id=11] +[ext_resource type="Script" path="res://Characters/Character.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://fg3wtt3q51ly" path="res://Assets/Characters/Tux/Front.png" id="2"] +[ext_resource type="Texture2D" uid="uid://djpwy1c8mbri4" path="res://Assets/Characters/Tux/Wall.png" id="3"] +[ext_resource type="Texture2D" uid="uid://cw26jrhhcu4wk" path="res://Assets/Characters/Tux/Back.png" id="4"] +[ext_resource type="Texture2D" uid="uid://b0femqwgwmyco" path="res://Assets/Characters/Tux/Walk1.png" id="5"] +[ext_resource type="Texture2D" uid="uid://dndtpfv7o2mf" path="res://Assets/Characters/Tux/Walk2.png" id="6"] +[ext_resource type="Texture2D" uid="uid://b87ss8k4j8qu0" path="res://Assets/Characters/Tux/Jump.png" id="7"] +[ext_resource type="Texture2D" uid="uid://ds2u0youtlt34" path="res://Assets/Characters/Tux/Slide.png" id="8"] +[ext_resource type="Texture2D" uid="uid://biuuco5wr0gvb" path="res://Assets/Characters/Tux/Fall1.png" id="9"] +[ext_resource type="Texture2D" uid="uid://kxdfm0mdwdom" path="res://Assets/Characters/Tux/Fall1Wings.png" id="10"] +[ext_resource type="Texture2D" uid="uid://dty1utxtd8qne" path="res://Assets/Characters/Tux/Fall2Wings.png" id="11"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 2 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "idle", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 8 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("9") +}], "loop": true, -"name": "slide", +"name": &"fall", "speed": 5.0 }, { -"frames": [ ExtResource( 4 ) ], -"loop": true, -"name": "back", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10") +}], +"loop": false, +"name": &"fall_stop", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ), ExtResource( 6 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("11") +}], "loop": true, -"name": "walk", +"name": &"fall_stop_landing", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "fall_stop_landing", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 9 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "fall", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 10 ) ], -"loop": false, -"name": "fall_stop", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("8") +}], +"loop": true, +"name": &"slide", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}, { +"duration": 1.0, +"texture": ExtResource("6") +}], "loop": true, -"name": "jump", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], "loop": true, -"name": "wall", +"name": &"wall", "speed": 5.0 -} ] +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(14, 19) -[node name="Character" type="KinematicBody2D"] +[node name="Character" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 1 ) +script = ExtResource("1") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, 0.5) +shape = SubResource("2") [node name="CheckFallStop" type="RayCast2D" parent="."] -enabled = true -cast_to = Vector2( 0, 150 ) +target_position = Vector2(0, 150) [node name="CheckFallLanding" type="RayCast2D" parent="."] -enabled = true diff --git a/Characters/Dove.tscn b/Characters/Dove.tscn index 34d0971..0871bfa 100644 --- a/Characters/Dove.tscn +++ b/Characters/Dove.tscn @@ -1,84 +1,112 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=14 format=3 uid="uid://db80wyly5gkcq"] -[ext_resource path="res://Assets/Characters/Dove/Front.png" type="Texture" id=1] -[ext_resource path="res://Assets/Characters/Dove/Jump.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Dove/Fall1Wings.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Dove/Slide.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Dove/Walk1.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Dove/Back.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Dove/Fall2.png" type="Texture" id=7] -[ext_resource path="res://Assets/Characters/Dove/Walk2.png" type="Texture" id=8] -[ext_resource path="res://Characters/Dove.gd" type="Script" id=9] -[ext_resource path="res://Assets/Characters/Dove/Wall.png" type="Texture" id=10] -[ext_resource path="res://Assets/Characters/Dove/Fall1.png" type="Texture" id=11] +[ext_resource type="Texture2D" uid="uid://b2h82tdfbogjx" path="res://Assets/Characters/Dove/Front.png" id="1"] +[ext_resource type="Texture2D" uid="uid://bbgjua7kpisfy" path="res://Assets/Characters/Dove/Jump.png" id="2"] +[ext_resource type="Texture2D" uid="uid://dvy3vwsl2pnqa" path="res://Assets/Characters/Dove/Fall1Wings.png" id="3"] +[ext_resource type="Texture2D" uid="uid://bprs82t6l1k5l" path="res://Assets/Characters/Dove/Slide.png" id="4"] +[ext_resource type="Texture2D" uid="uid://bpdka00y5rpyq" path="res://Assets/Characters/Dove/Walk1.png" id="5"] +[ext_resource type="Texture2D" uid="uid://cklkw2yi7mwx3" path="res://Assets/Characters/Dove/Back.png" id="6"] +[ext_resource type="Texture2D" uid="uid://d30sk72q4cm7h" path="res://Assets/Characters/Dove/Fall2.png" id="7"] +[ext_resource type="Texture2D" uid="uid://b8rox7xmamvs0" path="res://Assets/Characters/Dove/Walk2.png" id="8"] +[ext_resource type="Script" path="res://Characters/Dove.gd" id="9"] +[ext_resource type="Texture2D" uid="uid://d3sulcf630kwm" path="res://Assets/Characters/Dove/Wall.png" id="10"] +[ext_resource type="Texture2D" uid="uid://pa7nogs2tjhr" path="res://Assets/Characters/Dove/Fall1.png" id="11"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 3 ) ], -"loop": false, -"name": "fall_stop", +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}], +"loop": true, +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("11") +}], "loop": true, -"name": "back", +"name": &"fall", "speed": 5.0 }, { -"frames": [ ExtResource( 1 ) ], -"loop": true, -"name": "idle", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], +"loop": false, +"name": &"fall_stop", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "jump", +"name": &"fall_stop_landing", "speed": 5.0 }, { -"frames": [ ExtResource( 10 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1") +}], "loop": true, -"name": "wall", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "fall_stop_landing", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ), ExtResource( 8 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "walk", +"name": &"run", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}, { +"duration": 1.0, +"texture": ExtResource("8") +}], "loop": true, -"name": "fall", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 4 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10") +}], "loop": true, -"name": "run", +"name": &"wall", "speed": 5.0 -} ] +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(12, 19) -[node name="Dove" type="KinematicBody2D"] +[node name="Dove" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 9 ) +script = ExtResource("9") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, 0.5) +shape = SubResource("2") [node name="CheckFallStop" type="RayCast2D" parent="."] -enabled = true -cast_to = Vector2( 0, 150 ) +target_position = Vector2(0, 150) [node name="CheckFallLanding" type="RayCast2D" parent="."] -enabled = true diff --git a/Characters/Duck.tscn b/Characters/Duck.tscn index ef675d6..ea974d8 100644 --- a/Characters/Duck.tscn +++ b/Characters/Duck.tscn @@ -1,84 +1,112 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=14 format=3 uid="uid://c5yfg1f4bgg52"] -[ext_resource path="res://Characters/Duck.gd" type="Script" id=1] -[ext_resource path="res://Assets/Characters/Duck/Fall1.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Duck/Slide.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Duck/Back.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Duck/Fall2Wings.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Duck/Wall.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Duck/Jump.png" type="Texture" id=7] -[ext_resource path="res://Assets/Characters/Duck/Walk2.png" type="Texture" id=8] -[ext_resource path="res://Assets/Characters/Duck/Walk1.png" type="Texture" id=9] -[ext_resource path="res://Assets/Characters/Duck/Fall1Wings.png" type="Texture" id=10] -[ext_resource path="res://Assets/Characters/Duck/Front.png" type="Texture" id=11] +[ext_resource type="Script" path="res://Characters/Duck.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://1x88sprpx053" path="res://Assets/Characters/Duck/Fall1.png" id="2"] +[ext_resource type="Texture2D" uid="uid://bpw7aneapgwfr" path="res://Assets/Characters/Duck/Slide.png" id="3"] +[ext_resource type="Texture2D" uid="uid://cektwmgi1dspp" path="res://Assets/Characters/Duck/Back.png" id="4"] +[ext_resource type="Texture2D" uid="uid://cpyt71toxyag4" path="res://Assets/Characters/Duck/Fall2Wings.png" id="5"] +[ext_resource type="Texture2D" uid="uid://bgvorvxaiccfj" path="res://Assets/Characters/Duck/Wall.png" id="6"] +[ext_resource type="Texture2D" uid="uid://dfk20nuratgte" path="res://Assets/Characters/Duck/Jump.png" id="7"] +[ext_resource type="Texture2D" uid="uid://dn1xecq7vx3tm" path="res://Assets/Characters/Duck/Walk2.png" id="8"] +[ext_resource type="Texture2D" uid="uid://bekcxwxti2d8r" path="res://Assets/Characters/Duck/Walk1.png" id="9"] +[ext_resource type="Texture2D" uid="uid://cdfbqwj76p8rg" path="res://Assets/Characters/Duck/Fall1Wings.png" id="10"] +[ext_resource type="Texture2D" uid="uid://dibcyc08wpu0a" path="res://Assets/Characters/Duck/Front.png" id="11"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 4 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "back", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "idle", +"name": &"fall", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], -"loop": true, -"name": "jump", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10") +}], +"loop": false, +"name": &"fall_stop", "speed": 5.0 }, { -"frames": [ ExtResource( 9 ), ExtResource( 8 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}], "loop": true, -"name": "walk", +"name": &"fall_stop_landing", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("11") +}], "loop": true, -"name": "fall_stop_landing", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "run", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], "loop": true, -"name": "fall", +"name": &"run", "speed": 5.0 }, { -"frames": [ ExtResource( 10 ) ], -"loop": false, -"name": "fall_stop", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("9") +}, { +"duration": 1.0, +"texture": ExtResource("8") +}], +"loop": true, +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}], "loop": true, -"name": "wall", +"name": &"wall", "speed": 5.0 -} ] +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(12, 19) -[node name="Duck" type="KinematicBody2D"] +[node name="Duck" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 1 ) +script = ExtResource("1") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, 0.5) +shape = SubResource("2") [node name="CheckFallStop" type="RayCast2D" parent="."] -enabled = true -cast_to = Vector2( 0, 150 ) +target_position = Vector2(0, 150) [node name="CheckFallLanding" type="RayCast2D" parent="."] -enabled = true diff --git a/Characters/Elephant.tscn b/Characters/Elephant.tscn index 5c41e9d..d0f9c73 100644 --- a/Characters/Elephant.tscn +++ b/Characters/Elephant.tscn @@ -1,58 +1,82 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=10 format=3 uid="uid://ba3do2dhi2m65"] -[ext_resource path="res://Characters/Tux.gd" type="Script" id=1] -[ext_resource path="res://Assets/Characters/Elephant/Walk2.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Elephant/Walk1.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Elephant/Back.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Elephant/Front.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Elephant/Wall.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Elephant/Jump.png" type="Texture" id=7] +[ext_resource type="Script" path="res://Characters/Tux.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://b1ubrkswjkmg4" path="res://Assets/Characters/Elephant/Walk2.png" id="2"] +[ext_resource type="Texture2D" uid="uid://dhfj50q47tmr5" path="res://Assets/Characters/Elephant/Walk1.png" id="3"] +[ext_resource type="Texture2D" uid="uid://dggbekqiasbvp" path="res://Assets/Characters/Elephant/Back.png" id="4"] +[ext_resource type="Texture2D" uid="uid://bfr2ek0h8rveb" path="res://Assets/Characters/Elephant/Front.png" id="5"] +[ext_resource type="Texture2D" uid="uid://47xb7truren2" path="res://Assets/Characters/Elephant/Wall.png" id="6"] +[ext_resource type="Texture2D" uid="uid://cx8mq4nhpgn07" path="res://Assets/Characters/Elephant/Jump.png" id="7"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 4 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "back", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}], "loop": true, -"name": "idle", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "jump", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}, { +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "wall", -"speed": 5.0 +"name": &"run", +"speed": 10.0 }, { -"frames": [ ExtResource( 3 ), ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}, { +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "walk", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ), ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}], "loop": true, -"name": "run", -"speed": 10.0 -} ] +"name": &"wall", +"speed": 5.0 +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(12, 17) -[node name="Elephant" type="KinematicBody2D"] +[node name="Elephant" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 1 ) +script = ExtResource("1") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, 1.5) +shape = SubResource("2") diff --git a/Characters/Monkey.tscn b/Characters/Monkey.tscn index 8ed2938..0c1889a 100644 --- a/Characters/Monkey.tscn +++ b/Characters/Monkey.tscn @@ -1,58 +1,82 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=10 format=3 uid="uid://dy5pbcj1h7r00"] -[ext_resource path="res://Characters/Tux.gd" type="Script" id=1] -[ext_resource path="res://Assets/Characters/Monkey/Front.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Monkey/Wall.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Monkey/Jump.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Monkey/Back.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Monkey/Walk1.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Monkey/Walk2.png" type="Texture" id=7] +[ext_resource type="Script" path="res://Characters/Tux.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://c338yichhecvr" path="res://Assets/Characters/Monkey/Front.png" id="2"] +[ext_resource type="Texture2D" uid="uid://b23kvr62xexxi" path="res://Assets/Characters/Monkey/Wall.png" id="3"] +[ext_resource type="Texture2D" uid="uid://dqnwnuy3e1unr" path="res://Assets/Characters/Monkey/Jump.png" id="4"] +[ext_resource type="Texture2D" uid="uid://cjmgcegibbs3b" path="res://Assets/Characters/Monkey/Back.png" id="5"] +[ext_resource type="Texture2D" uid="uid://cv0um2orghk12" path="res://Assets/Characters/Monkey/Walk1.png" id="6"] +[ext_resource type="Texture2D" uid="uid://cieug1suk3wcv" path="res://Assets/Characters/Monkey/Walk2.png" id="7"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 5 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}], "loop": true, -"name": "back", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "idle", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "wall", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ), ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}, { +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "walk", -"speed": 5.0 +"name": &"run", +"speed": 10.0 }, { -"frames": [ ExtResource( 4 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}, { +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "jump", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ), ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], "loop": true, -"name": "run", -"speed": 10.0 -} ] +"name": &"wall", +"speed": 5.0 +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(10, 20) -[node name="Monkey" type="KinematicBody2D"] +[node name="Monkey" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 1 ) +script = ExtResource("1") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, -2.38419e-07) +shape = SubResource("2") diff --git a/Characters/Pidgin.tscn b/Characters/Pidgin.tscn index ba42eb0..5410b71 100644 --- a/Characters/Pidgin.tscn +++ b/Characters/Pidgin.tscn @@ -1,84 +1,112 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=14 format=3 uid="uid://dadno88dlu3eq"] -[ext_resource path="res://Assets/Characters/Pidgin/Fall1.png" type="Texture" id=1] -[ext_resource path="res://Assets/Characters/Pidgin/Slide.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Pidgin/Fall2.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Pidgin/Back.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Pidgin/Fall1Wings.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Pidgin/Wall.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Pidgin/Jump.png" type="Texture" id=7] -[ext_resource path="res://Assets/Characters/Pidgin/Walk2.png" type="Texture" id=8] -[ext_resource path="res://Characters/Dove.gd" type="Script" id=9] -[ext_resource path="res://Assets/Characters/Pidgin/Front.png" type="Texture" id=10] -[ext_resource path="res://Assets/Characters/Pidgin/Walk1.png" type="Texture" id=11] +[ext_resource type="Texture2D" uid="uid://o4p83pk1n66t" path="res://Assets/Characters/Pidgin/Fall1.png" id="1"] +[ext_resource type="Texture2D" uid="uid://rrfag5dhfel7" path="res://Assets/Characters/Pidgin/Slide.png" id="2"] +[ext_resource type="Texture2D" uid="uid://dbp26y6efrkda" path="res://Assets/Characters/Pidgin/Fall2.png" id="3"] +[ext_resource type="Texture2D" uid="uid://dmn06w00ol0tv" path="res://Assets/Characters/Pidgin/Back.png" id="4"] +[ext_resource type="Texture2D" uid="uid://gbcntftexor7" path="res://Assets/Characters/Pidgin/Fall1Wings.png" id="5"] +[ext_resource type="Texture2D" uid="uid://t7c0desi04ra" path="res://Assets/Characters/Pidgin/Wall.png" id="6"] +[ext_resource type="Texture2D" uid="uid://bkfn8al2da6si" path="res://Assets/Characters/Pidgin/Jump.png" id="7"] +[ext_resource type="Texture2D" uid="uid://cqyoyj6d4dkah" path="res://Assets/Characters/Pidgin/Walk2.png" id="8"] +[ext_resource type="Script" path="res://Characters/Dove.gd" id="9"] +[ext_resource type="Texture2D" uid="uid://cnuotyqgyqplm" path="res://Assets/Characters/Pidgin/Front.png" id="10"] +[ext_resource type="Texture2D" uid="uid://d8167647lwsv" path="res://Assets/Characters/Pidgin/Walk1.png" id="11"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 4 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "back", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 10 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1") +}], "loop": true, -"name": "idle", +"name": &"fall", "speed": 5.0 }, { -"frames": [ ExtResource( 6 ) ], -"loop": true, -"name": "wall", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}], +"loop": false, +"name": &"fall_stop", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ) ], -"loop": false, -"name": "fall_stop", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], +"loop": true, +"name": &"fall_stop_landing", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10") +}], "loop": true, -"name": "fall_stop_landing", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 2 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "run", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 1 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "fall", +"name": &"run", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ), ExtResource( 8 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("11") +}, { +"duration": 1.0, +"texture": ExtResource("8") +}], "loop": true, -"name": "walk", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6") +}], "loop": true, -"name": "jump", +"name": &"wall", "speed": 5.0 -} ] +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(12, 19) -[node name="Dove" type="KinematicBody2D"] +[node name="Dove" type="CharacterBody2D"] collision_mask = 15 -script = ExtResource( 9 ) +script = ExtResource("9") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(2.38419e-07, 0.5) +shape = SubResource("2") [node name="CheckFallStop" type="RayCast2D" parent="."] -enabled = true -cast_to = Vector2( 0, 150 ) +target_position = Vector2(0, 150) [node name="CheckFallLanding" type="RayCast2D" parent="."] -enabled = true diff --git a/Characters/Tux.tscn b/Characters/Tux.tscn index b3f110a..fdda659 100644 --- a/Characters/Tux.tscn +++ b/Characters/Tux.tscn @@ -1,84 +1,113 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=14 format=3 uid="uid://ddkfppytp3bje"] -[ext_resource path="res://Characters/Tux.gd" type="Script" id=1] -[ext_resource path="res://Assets/Characters/Tux/Front.png" type="Texture" id=2] -[ext_resource path="res://Assets/Characters/Tux/Wall.png" type="Texture" id=3] -[ext_resource path="res://Assets/Characters/Tux/Back.png" type="Texture" id=4] -[ext_resource path="res://Assets/Characters/Tux/Walk1.png" type="Texture" id=5] -[ext_resource path="res://Assets/Characters/Tux/Walk2.png" type="Texture" id=6] -[ext_resource path="res://Assets/Characters/Tux/Jump.png" type="Texture" id=7] -[ext_resource path="res://Assets/Characters/Tux/Slide.png" type="Texture" id=8] -[ext_resource path="res://Assets/Characters/Tux/Fall1.png" type="Texture" id=9] -[ext_resource path="res://Assets/Characters/Tux/Fall1Wings.png" type="Texture" id=10] -[ext_resource path="res://Assets/Characters/Tux/Fall2Wings.png" type="Texture" id=11] +[ext_resource type="Script" path="res://Characters/Tux.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://fg3wtt3q51ly" path="res://Assets/Characters/Tux/Front.png" id="2"] +[ext_resource type="Texture2D" uid="uid://djpwy1c8mbri4" path="res://Assets/Characters/Tux/Wall.png" id="3"] +[ext_resource type="Texture2D" uid="uid://cw26jrhhcu4wk" path="res://Assets/Characters/Tux/Back.png" id="4"] +[ext_resource type="Texture2D" uid="uid://b0femqwgwmyco" path="res://Assets/Characters/Tux/Walk1.png" id="5"] +[ext_resource type="Texture2D" uid="uid://dndtpfv7o2mf" path="res://Assets/Characters/Tux/Walk2.png" id="6"] +[ext_resource type="Texture2D" uid="uid://b87ss8k4j8qu0" path="res://Assets/Characters/Tux/Jump.png" id="7"] +[ext_resource type="Texture2D" uid="uid://ds2u0youtlt34" path="res://Assets/Characters/Tux/Slide.png" id="8"] +[ext_resource type="Texture2D" uid="uid://biuuco5wr0gvb" path="res://Assets/Characters/Tux/Fall1.png" id="9"] +[ext_resource type="Texture2D" uid="uid://kxdfm0mdwdom" path="res://Assets/Characters/Tux/Fall1Wings.png" id="10"] +[ext_resource type="Texture2D" uid="uid://dty1utxtd8qne" path="res://Assets/Characters/Tux/Fall2Wings.png" id="11"] -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ ExtResource( 2 ) ], +[sub_resource type="SpriteFrames" id="1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4") +}], "loop": true, -"name": "idle", +"name": &"back", "speed": 5.0 }, { -"frames": [ ExtResource( 4 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("9") +}], "loop": true, -"name": "back", +"name": &"fall", "speed": 5.0 }, { -"frames": [ ExtResource( 7 ) ], -"loop": true, -"name": "jump", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10") +}], +"loop": false, +"name": &"fall_stop", "speed": 5.0 }, { -"frames": [ ExtResource( 10 ) ], -"loop": false, -"name": "fall_stop", +"frames": [{ +"duration": 1.0, +"texture": ExtResource("11") +}], +"loop": true, +"name": &"fall_stop_landing", "speed": 5.0 }, { -"frames": [ ExtResource( 5 ), ExtResource( 6 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2") +}], "loop": true, -"name": "walk", +"name": &"idle", "speed": 5.0 }, { -"frames": [ ExtResource( 9 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("7") +}], "loop": true, -"name": "fall", +"name": &"jump", "speed": 5.0 }, { -"frames": [ ExtResource( 8 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("8") +}], "loop": true, -"name": "run", +"name": &"run", "speed": 5.0 }, { -"frames": [ ExtResource( 3 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5") +}, { +"duration": 1.0, +"texture": ExtResource("6") +}], "loop": true, -"name": "wall", +"name": &"walk", "speed": 5.0 }, { -"frames": [ ExtResource( 11 ) ], +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3") +}], "loop": true, -"name": "fall_stop_landing", +"name": &"wall", "speed": 5.0 -} ] +}] -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 9.21901, 11.2317 ) +[sub_resource type="RectangleShape2D" id="2"] +size = Vector2(13, 20) -[node name="Tux" type="KinematicBody2D"] +[node name="Tux" type="CharacterBody2D"] +position = Vector2(-1, 0) collision_mask = 15 -script = ExtResource( 1 ) +script = ExtResource("1") -[node name="Sprite" type="AnimatedSprite" parent="."] -scale = Vector2( 0.7, 0.7 ) -frames = SubResource( 1 ) -animation = "idle" -playing = true +[node name="Sprite2D" type="AnimatedSprite2D" parent="."] +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("1") +animation = &"idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource( 2 ) +position = Vector2(0.5, -2.38419e-07) +shape = SubResource("2") [node name="CheckFallStop" type="RayCast2D" parent="."] -enabled = true -cast_to = Vector2( 0, 150 ) +target_position = Vector2(0, 150) [node name="CheckFallLanding" type="RayCast2D" parent="."] -enabled = true -- cgit v1.2.3