summaryrefslogtreecommitdiff
path: root/Characters
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-01-22 16:40:46 +0100
committerDaniel Weipert <code@drogueronin.de>2021-01-22 16:40:46 +0100
commit3f4c07d2cf57bd364af6b09a3d5381d148aa713e (patch)
tree4fe53d2f627237e70a24ff7ec3d3815d07523c62 /Characters
parent485cd463b22e12394cd232812e2c3789ef37ab1c (diff)
New Characters! New Levels!
Diffstat (limited to 'Characters')
-rw-r--r--Characters/Character.gd4
-rw-r--r--Characters/Dove.tscn22
-rw-r--r--Characters/Elephant.gd5
-rw-r--r--Characters/Elephant.tscn58
4 files changed, 76 insertions, 13 deletions
diff --git a/Characters/Character.gd b/Characters/Character.gd
index bf16dbf..966d69d 100644
--- a/Characters/Character.gd
+++ b/Characters/Character.gd
@@ -72,13 +72,13 @@ func _physics_process(_delta):
$Sprite.play("wall")
if Input.is_action_just_pressed("ui_up"):
- Input.action_release("ui_left")
- Input.action_release("ui_right")
velocity.y = JUMPFORCE * 0.75
if direction == Enum.DIRECTION.LEFT:
+ Input.action_release("ui_left")
velocity.x = 2000
$Sprite.flip_h = false
elif direction == Enum.DIRECTION.RIGHT:
+ Input.action_release("ui_right")
velocity.x = -2000
$Sprite.flip_h = true
diff --git a/Characters/Dove.tscn b/Characters/Dove.tscn
index 14f99ce..34d0971 100644
--- a/Characters/Dove.tscn
+++ b/Characters/Dove.tscn
@@ -14,6 +14,11 @@
[sub_resource type="SpriteFrames" id=1]
animations = [ {
+"frames": [ ExtResource( 3 ) ],
+"loop": false,
+"name": "fall_stop",
+"speed": 5.0
+}, {
"frames": [ ExtResource( 6 ) ],
"loop": true,
"name": "back",
@@ -29,9 +34,9 @@ animations = [ {
"name": "jump",
"speed": 5.0
}, {
-"frames": [ ExtResource( 5 ), ExtResource( 8 ) ],
+"frames": [ ExtResource( 10 ) ],
"loop": true,
-"name": "walk",
+"name": "wall",
"speed": 5.0
}, {
"frames": [ ExtResource( 7 ) ],
@@ -39,9 +44,9 @@ animations = [ {
"name": "fall_stop_landing",
"speed": 5.0
}, {
-"frames": [ ExtResource( 4 ) ],
+"frames": [ ExtResource( 5 ), ExtResource( 8 ) ],
"loop": true,
-"name": "run",
+"name": "walk",
"speed": 5.0
}, {
"frames": [ ExtResource( 11 ) ],
@@ -49,14 +54,9 @@ animations = [ {
"name": "fall",
"speed": 5.0
}, {
-"frames": [ ExtResource( 3 ) ],
-"loop": false,
-"name": "fall_stop",
-"speed": 5.0
-}, {
-"frames": [ ExtResource( 10 ) ],
+"frames": [ ExtResource( 4 ) ],
"loop": true,
-"name": "wall",
+"name": "run",
"speed": 5.0
} ]
diff --git a/Characters/Elephant.gd b/Characters/Elephant.gd
new file mode 100644
index 0000000..b7c6d31
--- /dev/null
+++ b/Characters/Elephant.gd
@@ -0,0 +1,5 @@
+extends "res://Characters/Character.gd"
+
+
+func _ready():
+ pass
diff --git a/Characters/Elephant.tscn b/Characters/Elephant.tscn
new file mode 100644
index 0000000..5c41e9d
--- /dev/null
+++ b/Characters/Elephant.tscn
@@ -0,0 +1,58 @@
+[gd_scene load_steps=10 format=2]
+
+[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]
+
+[sub_resource type="SpriteFrames" id=1]
+animations = [ {
+"frames": [ ExtResource( 4 ) ],
+"loop": true,
+"name": "back",
+"speed": 5.0
+}, {
+"frames": [ ExtResource( 5 ) ],
+"loop": true,
+"name": "idle",
+"speed": 5.0
+}, {
+"frames": [ ExtResource( 7 ) ],
+"loop": true,
+"name": "jump",
+"speed": 5.0
+}, {
+"frames": [ ExtResource( 6 ) ],
+"loop": true,
+"name": "wall",
+"speed": 5.0
+}, {
+"frames": [ ExtResource( 3 ), ExtResource( 2 ) ],
+"loop": true,
+"name": "walk",
+"speed": 5.0
+}, {
+"frames": [ ExtResource( 3 ), ExtResource( 2 ) ],
+"loop": true,
+"name": "run",
+"speed": 10.0
+} ]
+
+[sub_resource type="RectangleShape2D" id=2]
+extents = Vector2( 9.21901, 11.2317 )
+
+[node name="Elephant" type="KinematicBody2D"]
+collision_mask = 15
+script = ExtResource( 1 )
+
+[node name="Sprite" type="AnimatedSprite" parent="."]
+scale = Vector2( 0.7, 0.7 )
+frames = SubResource( 1 )
+animation = "idle"
+playing = true
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+shape = SubResource( 2 )