From 787d20463e02a2ab9353f1320e791c5445acc236 Mon Sep 17 00:00:00 2001 From: baldas_h Date: Sat, 4 Apr 2020 16:33:25 +0200 Subject: [PATCH] [EDIT] implemented animation --- Assets/spriteset test.png | Bin 0 -> 8683 bytes Assets/spriteset test.png.import | 34 +++++ Scene/Player.tscn | 228 ++++++++++++++++++++++++++++++- Scene/TestScene.tscn | 24 ++-- Scripts/Player.gd | 14 +- project.godot | 55 ++++++++ 6 files changed, 332 insertions(+), 23 deletions(-) create mode 100644 Assets/spriteset test.png create mode 100644 Assets/spriteset test.png.import diff --git a/Assets/spriteset test.png b/Assets/spriteset test.png new file mode 100644 index 0000000000000000000000000000000000000000..01cccc84a9e568d49ee327bf7542770874df960b GIT binary patch literal 8683 zcmb7qc|4SR`@gNwVsKh9BvG0SjIsW1o$oon^X)v(^ZGu2F!$Wo=ej+5OXWMktb0@v0&yMh1F#Ru})*w|g|wY09=+t{$NoqFN^qTH}X^GJOX_EFtk2<_Nt zMDla3y*d{~QXiXVXqi=K7$UElitE=%>O9XJ9=-0$Z@wY40YV>yALP0ype?eocf<63 zE%VK#kU~%RpxCupZ=x^XydC=C_v#b(U-6MY-0F0&y1J)aLQgRi`{cnxGecq>)CZrW zyQ+=R3$`d{x`RjFIVe`0*Mv69&hnFgvnv)coEKf-k!jW${cTh=jZ<)FkNLvtRo6zU zLNzqWoNeP>+U@E4sX_N%3)kMNJ*$;l(CuA&^>_v`G6ixOA)->CC$WonPsaBreB8Vl zQnuX#v5spoH^f0Hxle^u)eKHWoi}obF3q^D+#Njw|+q<{7rI4Z?$+2c(&O~wW z%y5R4(zg;zovHhHKC@9C_E{#!PgLmV5{kZ`|cjy7;#y=c*J5Es= zrg9uP%~r##8ZM2!Lx;5`1#GCOcYs~JxUO_=(dxzQ>+R}1h2{i+5b(O{-9xdl@qO9( zV?TJxAb^eS7@NNK#oJ!&GYPN;Ws*CN8FiayAA5?yaQ!jYkuT|T8mqLY^ln9)7&(Hhhz++H4e(&Mk7lndOi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pq&z-E9WHu`UUe@# z2+EbHX<@o#4NzZ9A;@V@@z3XDnBNR~bMm}t7`fJY0W9*tEDm7wrFne*>aC%+a^&mg zCc2W>g_@r?-@ju*vhbq0_d8%|>Y7&lapbQ}4O4DOsWyuzi5xmwP0zws$9lu0L&hRP zNMDk!ET7nord^~LS!Nu2OZ7TCz#dL5bJs#Wl8n}E>zLG*zkai@g!C09sr zem=fkHMpT3(pj_C4fSEA4iQt7K}nz9OB5txveY~->UxPPH#l87v~)Cycv)T-txj&u z?z2N@o#QhNinl{Qp?nHgCbdn?1Kqx&HA3C?hcNAx(#n4HlIxV+o0}Ta*RYGGi}YP$ zHzGz2qi${}=cKWNqw0}d&r=YZq|@Yj0dV%DF1lZs&J(^a0vK@=H~PHV1SJ{W#O_UdI=vb;{-~ybx2R2#urTpgo!PGnx@{RuilU}n+_hs15jeR zXeOa6O_0~ceGn)+ROJX&?6XchI4-svm+`@Uy_aTAX+`Ny?@RFt09l!!MeH|n1oJ;o~|37@Ko|FIp literal 0 HcmV?d00001 diff --git a/Assets/spriteset test.png.import b/Assets/spriteset test.png.import new file mode 100644 index 0000000..acd1a77 --- /dev/null +++ b/Assets/spriteset test.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/spriteset test.png-0553e234092c6eb7487a24328c16a2f4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/spriteset test.png" +dest_files=[ "res://.import/spriteset test.png-0553e234092c6eb7487a24328c16a2f4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Scene/Player.tscn b/Scene/Player.tscn index 03d71f4..e459c37 100644 --- a/Scene/Player.tscn +++ b/Scene/Player.tscn @@ -1,17 +1,237 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=26 format=2] -[ext_resource path="res://Assets/Placeholder.png" type="Texture" id=1] +[ext_resource path="res://Assets/spriteset test.png" type="Texture" id=1] [ext_resource path="res://Scripts/Player.gd" type="Script" id=2] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 16.1674, 5.57349 ) +extents = Vector2( 15.5015, 46.849 ) + +[sub_resource type="Animation" id=6] +resource_name = "IdleDown" +length = 0.1 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 7 ] +} + +[sub_resource type="Animation" id=7] +resource_name = "IdleLeft" +length = 0.1 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 14 ] +} + +[sub_resource type="Animation" id=8] +resource_name = "IdleRight" +length = 0.1 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} + +[sub_resource type="Animation" id=9] +resource_name = "IdleTop" +length = 0.1 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 21 ] +} + +[sub_resource type="Animation" id=2] +resource_name = "RunDown" +length = 0.7 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 8, 9, 10, 11, 12, 13, 7 ] +} + +[sub_resource type="Animation" id=3] +resource_name = "RunLeft" +length = 0.7 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 15, 16, 17, 18, 19, 20, 14 ] +} + +[sub_resource type="Animation" id=4] +resource_name = "RunRight" +length = 0.7 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 1, 2, 3, 4, 5, 6, 0 ] +} + +[sub_resource type="Animation" id=5] +resource_name = "RunUp" +length = 0.7 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 22, 23, 24, 25, 26, 27, 21 ] +} + +[sub_resource type="AnimationNodeAnimation" id=10] +animation = "IdleLeft" + +[sub_resource type="AnimationNodeAnimation" id=11] +animation = "IdleDown" + +[sub_resource type="AnimationNodeAnimation" id=12] +animation = "IdleRight" + +[sub_resource type="AnimationNodeAnimation" id=13] +animation = "IdleTop" + +[sub_resource type="AnimationNodeBlendSpace2D" id=14] +blend_point_0/node = SubResource( 10 ) +blend_point_0/pos = Vector2( -1.1, 0 ) +blend_point_1/node = SubResource( 11 ) +blend_point_1/pos = Vector2( 0, 1.1 ) +blend_point_2/node = SubResource( 12 ) +blend_point_2/pos = Vector2( 1, 0 ) +blend_point_3/node = SubResource( 13 ) +blend_point_3/pos = Vector2( 0, -1 ) +min_space = Vector2( -1.1, -1 ) +max_space = Vector2( 1, 1.1 ) +blend_mode = 1 + +[sub_resource type="AnimationNodeAnimation" id=15] +animation = "RunLeft" + +[sub_resource type="AnimationNodeAnimation" id=16] +animation = "RunDown" + +[sub_resource type="AnimationNodeAnimation" id=17] +animation = "RunRight" + +[sub_resource type="AnimationNodeAnimation" id=18] +animation = "RunUp" + +[sub_resource type="AnimationNodeBlendSpace2D" id=19] +blend_point_0/node = SubResource( 15 ) +blend_point_0/pos = Vector2( -1.1, 0 ) +blend_point_1/node = SubResource( 16 ) +blend_point_1/pos = Vector2( 0, 1.1 ) +blend_point_2/node = SubResource( 17 ) +blend_point_2/pos = Vector2( 1, 0 ) +blend_point_3/node = SubResource( 18 ) +blend_point_3/pos = Vector2( 0, -1 ) +min_space = Vector2( -1.1, -1 ) +max_space = Vector2( 1, 1.1 ) +blend_mode = 1 + +[sub_resource type="AnimationNodeStateMachineTransition" id=20] + +[sub_resource type="AnimationNodeStateMachineTransition" id=21] + +[sub_resource type="AnimationNodeStateMachine" id=22] +states/Idle/node = SubResource( 14 ) +states/Idle/position = Vector2( 408, 64 ) +states/Run/node = SubResource( 19 ) +states/Run/position = Vector2( 632, 64 ) +transitions = [ "Idle", "Run", SubResource( 20 ), "Run", "Idle", SubResource( 21 ) ] +start_node = "Idle" + +[sub_resource type="AnimationNodeStateMachinePlayback" id=23] [node name="KinematicBody2D" type="KinematicBody2D"] script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 1 ) +hframes = 28 +frame = 9 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 0, 10.3147 ) +position = Vector2( -0.681107, -0.583321 ) shape = SubResource( 1 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/IdleDown = SubResource( 6 ) +anims/IdleLeft = SubResource( 7 ) +anims/IdleRight = SubResource( 8 ) +anims/IdleTop = SubResource( 9 ) +anims/RunDown = SubResource( 2 ) +anims/RunLeft = SubResource( 3 ) +anims/RunRight = SubResource( 4 ) +anims/RunUp = SubResource( 5 ) + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource( 22 ) +anim_player = NodePath("../AnimationPlayer") +active = true +parameters/playback = SubResource( 23 ) +parameters/Idle/blend_position = Vector2( -1.1, 0.0314158 ) +parameters/Run/blend_position = Vector2( -0.0925897, 0.517895 ) diff --git a/Scene/TestScene.tscn b/Scene/TestScene.tscn index b330133..ad10279 100644 --- a/Scene/TestScene.tscn +++ b/Scene/TestScene.tscn @@ -25,35 +25,35 @@ texture = ExtResource( 2 ) shape = SubResource( 1 ) [node name="Player2" parent="." instance=ExtResource( 1 )] -position = Vector2( 221.278, 126.847 ) +position = Vector2( 221.278, 126.45 ) [node name="Clopinette" parent="." instance=ExtResource( 3 )] -position = Vector2( 90.0584, 291.46 ) +position = Vector2( 96.6926, 271.557 ) scriptName = "res://Scripts/PaintEffects/Invisibility.gd" [node name="Clopinette2" parent="." instance=ExtResource( 3 )] -position = Vector2( 354.897, 298.002 ) +position = Vector2( 305.804, 276.773 ) scriptName = "res://Scripts/PaintEffects/Upscale.gd" [node name="Clopinette3" parent="." instance=ExtResource( 3 )] -position = Vector2( 589.812, 295.726 ) +position = Vector2( 580.834, 292.621 ) scriptName = "res://Scripts/PaintEffects/Downscale.gd" [node name="Label" type="Label" parent="."] -margin_left = 60.8618 -margin_top = 252.548 -margin_right = 128.862 -margin_bottom = 266.548 +margin_left = 67.496 +margin_top = 232.645 +margin_right = 135.496 +margin_bottom = 246.645 text = "Invisibilité" __meta__ = { "_edit_use_anchors_": false } [node name="Label2" type="Label" parent="."] -margin_left = 313.979 -margin_top = 250.273 -margin_right = 397.979 -margin_bottom = 264.273 +margin_left = 263.559 +margin_top = 234.351 +margin_right = 347.559 +margin_bottom = 248.351 text = "Gigantisation" __meta__ = { "_edit_use_anchors_": false diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 71238cf..2f21ca2 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -10,9 +10,9 @@ var curLife = MAX_LIFE var coroutines = [] -#onready var animationPlayer = $AnimationPlayer -#onready var animationTree = $AnimationTree -#onready var animationState = animationTree.get("parameters/playback") +onready var animationPlayer = $AnimationPlayer +onready var animationTree = $AnimationTree +onready var animationState = animationTree.get("parameters/playback") func _process(delta): updatePaintEffects(delta) @@ -34,12 +34,12 @@ func _physics_process(delta): input_vector = input_vector.normalized() if input_vector != Vector2.ZERO: -# animationTree.set("parameters/Idle/blend_position", input_vector) -# animationTree.set("parameters/Run/blend_position", input_vector) -# animationState.travel("Run") + animationTree.set("parameters/Idle/blend_position", input_vector) + animationTree.set("parameters/Run/blend_position", input_vector) + animationState.travel("Run") vel = vel.move_toward(input_vector * MAX_SPEED, ACCELERATION * delta) else: -# animationState.travel("Idle") + animationState.travel("Idle") vel = vel.move_toward(Vector2.ZERO, FRICTION * delta) vel = move_and_slide(vel) diff --git a/project.godot b/project.godot index 6c96d20..2d301e9 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,61 @@ config/name="Paint Jam 2020" run/main_scene="res://Scene/TestScene.tscn" config/icon="res://icon.png" +[display] + +window/size/width=320 +window/size/height=180 +window/size/test_width=1280 +window/size/test_height=720 +window/stretch/mode="2d" +window/stretch/aspect="keep" + +[importer_defaults] + +texture={ +"compress/bptc_ldr": 0, +"compress/hdr_mode": 0, +"compress/lossy_quality": 0.7, +"compress/mode": 0, +"compress/normal_map": 0, +"detect_3d": false, +"flags/anisotropic": false, +"flags/filter": false, +"flags/mipmaps": false, +"flags/repeat": 0, +"flags/srgb": 2, +"process/HDR_as_SRGB": false, +"process/fix_alpha_border": true, +"process/invert_color": false, +"process/premult_alpha": false, +"size_limit": 0, +"stream": false, +"svg/scale": 1.0 +} + +[input] + +ui_right2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) + ] +} +ui_left2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) + ] +} +ui_up2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null) + ] +} +ui_down2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) + ] +} + [rendering] quality/driver/driver_name="GLES2"