wip animation for beat and pressed jog
This commit is contained in:
parent
a510963a3c
commit
e565b86c19
3 changed files with 150 additions and 9 deletions
Binary file not shown.
10
node_2d.gd
10
node_2d.gd
|
|
@ -54,13 +54,21 @@ func _unhandled_input(input_event):
|
|||
if input_event is InputEventMIDI:
|
||||
if debug > 0:
|
||||
_print_midi_info(input_event)
|
||||
if input_event.channel == beat_channel and ((input_event.pitch == beat_note and input_event.velocity == 127) or input_event.controller_number == 10):
|
||||
if !midi_beat and input_event.channel == beat_channel and ((input_event.pitch == beat_note and input_event.velocity == 127) or input_event.controller_number == 10):
|
||||
if !midi_beat:
|
||||
$beat/AnimationPlayer.play("beat")
|
||||
midi_beat = true
|
||||
if input_event.channel == beat_channel and ((input_event.pitch == beat_note and input_event.velocity == 0) or input_event.controller_number == 9):
|
||||
if midi_beat:
|
||||
$beat/AnimationPlayer.play_backwards("beat")
|
||||
midi_beat = false
|
||||
if input_event.channel == jog_channel and ((input_event.pitch == jog_note and input_event.velocity == 127) or input_event.controller_number == spin_note_1):
|
||||
if !midi_jog:
|
||||
$jog/AnimationPlayer.play("jog")
|
||||
midi_jog = true
|
||||
if input_event.channel == jog_channel and ((input_event.pitch == jog_note and input_event.velocity == 0) or input_event.controller_number == spin_note_2):
|
||||
if midi_jog:
|
||||
$jog/AnimationPlayer.play_backwards("jog")
|
||||
midi_jog = false
|
||||
if (input_event.channel == spin_channel_1 or input_event.channel == spin_channel_2) and input_event.controller_value == left:
|
||||
midi_turnleft = true
|
||||
|
|
|
|||
149
node_2d.tscn
149
node_2d.tscn
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://chynesmvg3dl5"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://chynesmvg3dl5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://pa6jmogeid3x" path="res://art/turn.PNG" id="1_58q2i"]
|
||||
[ext_resource type="Script" path="res://node_2d.gd" id="1_r100h"]
|
||||
|
|
@ -6,6 +6,128 @@
|
|||
|
||||
[sub_resource type="GDScript" id="GDScript_grk35"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_e5aqk"]
|
||||
resource_name = "jog"
|
||||
length = 0.02
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1688, 342)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.01),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [4.43314, 4.11898]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_720f4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1688, 342)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [4.43314]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pi6b0"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_720f4"),
|
||||
"jog": SubResource("Animation_e5aqk")
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bdwea"]
|
||||
resource_name = "beat"
|
||||
length = 0.02
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("beat:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.01),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(137, 307), Vector2(158, 371)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("beat:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.01),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [-1.29154, -0.959931]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_khjd8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("beat:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(137, 307)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("beat:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-1.29154]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jc7n3"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_khjd8"),
|
||||
"beat": SubResource("Animation_bdwea")
|
||||
}
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource("1_r100h")
|
||||
|
||||
|
|
@ -20,15 +142,26 @@ scale = Vector2(0.22, 0.22)
|
|||
texture = ExtResource("1_58q2i")
|
||||
script = SubResource("GDScript_grk35")
|
||||
|
||||
[node name="left_bark" type="Sprite2D" parent="."]
|
||||
position = Vector2(137, 307)
|
||||
rotation = -1.29154
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("3_grsrk")
|
||||
|
||||
[node name="right_bark" type="Sprite2D" parent="."]
|
||||
[node name="jog" type="Sprite2D" parent="."]
|
||||
position = Vector2(1688, 342)
|
||||
rotation = 4.43314
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("3_grsrk")
|
||||
flip_v = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="jog"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_pi6b0")
|
||||
}
|
||||
|
||||
[node name="beat" type="Sprite2D" parent="."]
|
||||
position = Vector2(137, 307)
|
||||
rotation = -1.29154
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("3_grsrk")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="beat"]
|
||||
root_node = NodePath("../..")
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_jc7n3")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue