monstre.tscn (4033B)
1 [gd_scene load_steps=26 format=2] 2 3 [ext_resource path="res://icon.png" type="Texture" id=1] 4 [ext_resource path="res://monstre.gd" type="Script" id=2] 5 [ext_resource path="res://diable_walk.png" type="Texture" id=3] 6 [ext_resource path="res://diable_att.png" type="Texture" id=4] 7 [ext_resource path="res://diable_die.png" type="Texture" id=5] 8 [ext_resource path="res://hit.wav" type="AudioStream" id=6] 9 [ext_resource path="res://attack2.wav" type="AudioStream" id=7] 10 11 [sub_resource type="AtlasTexture" id=12] 12 flags = 4 13 atlas = ExtResource( 3 ) 14 region = Rect2( 0, 0, 32, 32 ) 15 16 [sub_resource type="AtlasTexture" id=13] 17 flags = 4 18 atlas = ExtResource( 3 ) 19 region = Rect2( 32, 0, 32, 32 ) 20 21 [sub_resource type="AtlasTexture" id=14] 22 flags = 4 23 atlas = ExtResource( 3 ) 24 region = Rect2( 64, 0, 32, 32 ) 25 26 [sub_resource type="AtlasTexture" id=15] 27 flags = 4 28 atlas = ExtResource( 3 ) 29 region = Rect2( 96, 0, 32, 32 ) 30 31 [sub_resource type="AtlasTexture" id=8] 32 flags = 4 33 atlas = ExtResource( 4 ) 34 region = Rect2( 0, 0, 32, 32 ) 35 36 [sub_resource type="AtlasTexture" id=9] 37 flags = 4 38 atlas = ExtResource( 4 ) 39 region = Rect2( 32, 0, 32, 32 ) 40 41 [sub_resource type="AtlasTexture" id=10] 42 flags = 4 43 atlas = ExtResource( 4 ) 44 region = Rect2( 64, 0, 32, 32 ) 45 46 [sub_resource type="AtlasTexture" id=11] 47 flags = 4 48 atlas = ExtResource( 4 ) 49 region = Rect2( 96, 0, 32, 32 ) 50 51 [sub_resource type="AtlasTexture" id=1] 52 flags = 4 53 atlas = ExtResource( 5 ) 54 region = Rect2( 0, 0, 32, 32 ) 55 56 [sub_resource type="AtlasTexture" id=2] 57 flags = 4 58 atlas = ExtResource( 5 ) 59 region = Rect2( 32, 0, 32, 32 ) 60 61 [sub_resource type="AtlasTexture" id=3] 62 flags = 4 63 atlas = ExtResource( 5 ) 64 region = Rect2( 64, 0, 32, 32 ) 65 66 [sub_resource type="AtlasTexture" id=4] 67 flags = 4 68 atlas = ExtResource( 5 ) 69 region = Rect2( 96, 0, 32, 32 ) 70 71 [sub_resource type="AtlasTexture" id=5] 72 flags = 4 73 atlas = ExtResource( 5 ) 74 region = Rect2( 128, 0, 32, 32 ) 75 76 [sub_resource type="AtlasTexture" id=6] 77 flags = 4 78 atlas = ExtResource( 5 ) 79 region = Rect2( 160, 0, 32, 32 ) 80 81 [sub_resource type="AtlasTexture" id=7] 82 flags = 4 83 atlas = ExtResource( 5 ) 84 region = Rect2( 192, 0, 32, 32 ) 85 86 [sub_resource type="SpriteFrames" id=16] 87 animations = [ { 88 "frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ], 89 "loop": true, 90 "name": "walk", 91 "speed": 5.0 92 }, { 93 "frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ], 94 "loop": true, 95 "name": "attack", 96 "speed": 5.0 97 }, { 98 "frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ], 99 "loop": false, 100 "name": "die", 101 "speed": 5.0 102 } ] 103 104 [sub_resource type="CapsuleShape2D" id=18] 105 radius = 5.0 106 height = 18.0 107 108 [sub_resource type="CircleShape2D" id=17] 109 radius = 12.0 110 111 [node name="monstre" type="Node2D" groups=["monstres"]] 112 script = ExtResource( 2 ) 113 114 [node name="Sprite" type="AnimatedSprite" parent="."] 115 frames = SubResource( 16 ) 116 animation = "attack" 117 frame = 1 118 119 [node name="AttackArea" type="Area2D" parent="Sprite"] 120 121 [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/AttackArea"] 122 position = Vector2( 11, 0 ) 123 shape = SubResource( 18 ) 124 125 [node name="HitArea" type="Area2D" parent="Sprite"] 126 127 [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/HitArea"] 128 shape = SubResource( 17 ) 129 130 [node name="oldSprite" type="Sprite" parent="."] 131 visible = false 132 scale = Vector2( 0.46875, 0.46875 ) 133 texture = ExtResource( 1 ) 134 135 [node name="lifebar_bg" type="Polygon2D" parent="."] 136 position = Vector2( -10, -6 ) 137 z_index = 1 138 color = Color( 0.411765, 0.411765, 0.411765, 1 ) 139 polygon = PoolVector2Array( 0, -13, 0, -9, 21, -9, 21, -13 ) 140 141 [node name="lifebar" type="Polygon2D" parent="."] 142 position = Vector2( -10, -12 ) 143 z_index = 1 144 color = Color( 1, 0, 0, 1 ) 145 polygon = PoolVector2Array( 0, -7, 0, -3, 21, -3, 21, -7 ) 146 147 [node name="HitSound" type="AudioStreamPlayer2D" parent="."] 148 stream = ExtResource( 6 ) 149 volume_db = 9.0 150 pitch_scale = 2.0 151 152 [node name="AttackSound" type="AudioStreamPlayer2D" parent="."] 153 stream = ExtResource( 7 ) 154 volume_db = 4.0