mirror of
https://gitee.com/freeyz/godot-mota.git
synced 2024-12-23 01:09:25 +08:00
战斗完成增加英雄金币
This commit is contained in:
parent
4599dadf6e
commit
3c8ec9d039
@ -28,7 +28,7 @@ region = Rect2( 0, 160, 32, 32 )
|
|||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=5]
|
[sub_resource type="AtlasTexture" id=5]
|
||||||
atlas = ExtResource( 7 )
|
atlas = ExtResource( 7 )
|
||||||
region = Rect2( 0, 192, 32, 32 )
|
region = Rect2( 0, 224, 32, 32 )
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=6]
|
[sub_resource type="StreamTexture" id=6]
|
||||||
load_path = "res://.import/icons_old.png-15488db7964fa7b4e69cdc7d96c7bd7f.stex"
|
load_path = "res://.import/icons_old.png-15488db7964fa7b4e69cdc7d96c7bd7f.stex"
|
||||||
|
@ -75,43 +75,54 @@ position = Vector2( 80, 144 )
|
|||||||
|
|
||||||
[node name="MonsterSprite" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 112, 336 )
|
position = Vector2( 112, 336 )
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite4" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite4" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 144, 464 )
|
position = Vector2( 144, 464 )
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite6" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite6" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 272, 464 )
|
position = Vector2( 272, 464 )
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite7" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite7" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 272, 400 )
|
position = Vector2( 272, 400 )
|
||||||
animation = "bluePriest"
|
animation = "bluePriest"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite8" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite8" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 80, 208 )
|
position = Vector2( 80, 208 )
|
||||||
animation = "bluePriest"
|
animation = "bluePriest"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite9" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite9" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 304, 272 )
|
position = Vector2( 304, 272 )
|
||||||
animation = "skeleton"
|
animation = "skeleton"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite10" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite10" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 336, 208 )
|
position = Vector2( 336, 208 )
|
||||||
animation = "skeletonSoilder"
|
animation = "skeletonSoilder"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite5" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite5" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 112, 432 )
|
position = Vector2( 112, 432 )
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite11" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite11" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 144, 400 )
|
position = Vector2( 144, 400 )
|
||||||
animation = "bat"
|
animation = "bat"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite2" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite2" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 48, 336 )
|
position = Vector2( 48, 336 )
|
||||||
animation = "redSlime"
|
animation = "redSlime"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="MonsterSprite3" parent="Items" instance=ExtResource( 6 )]
|
[node name="MonsterSprite3" parent="Items" instance=ExtResource( 6 )]
|
||||||
position = Vector2( 208, 272 )
|
position = Vector2( 208, 272 )
|
||||||
animation = "redSlime"
|
animation = "redSlime"
|
||||||
|
frame = 1
|
||||||
|
|
||||||
[node name="PlayerProps4" parent="Items" instance=ExtResource( 10 )]
|
[node name="PlayerProps4" parent="Items" instance=ExtResource( 10 )]
|
||||||
position = Vector2( 306.1, 432 )
|
position = Vector2( 306.1, 432 )
|
||||||
|
@ -26,6 +26,8 @@ func on_player_touched(player):
|
|||||||
yield(skill_sprite,"animation_finished")
|
yield(skill_sprite,"animation_finished")
|
||||||
#减扣英雄血量
|
#减扣英雄血量
|
||||||
player.hp -= hurt
|
player.hp -= hurt
|
||||||
|
#增加金币
|
||||||
|
player.money += monster_info.money
|
||||||
#删除怪物
|
#删除怪物
|
||||||
monster_sprite.queue_free()
|
monster_sprite.queue_free()
|
||||||
player.resume()
|
player.resume()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
[ext_resource path="res://src/npc/GiveBook.gd" type="Script" id=1]
|
[ext_resource path="res://src/npc/GiveBook.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://src/npc/npc_spriteframes.tres" type="SpriteFrames" id=2]
|
[ext_resource path="res://src/npc/npc_spriteframes.tres" type="SpriteFrames" id=2]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 16, 16 )
|
extents = Vector2( 16, 16 )
|
||||||
|
|
||||||
[node name="BookNpc" type="StaticBody2D"]
|
[node name="BookNpc" type="StaticBody2D"]
|
||||||
@ -14,7 +14,7 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
frames = ExtResource( 2 )
|
frames = ExtResource( 2 )
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
[ext_resource path="res://assets/images/npcs.png" type="Texture" id=4]
|
[ext_resource path="res://assets/images/npcs.png" type="Texture" id=4]
|
||||||
[ext_resource path="res://assets/fonts/Droid Sans Fallback.ttf" type="DynamicFontData" id=5]
|
[ext_resource path="res://assets/fonts/Droid Sans Fallback.ttf" type="DynamicFontData" id=5]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=6]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 48, 16 )
|
extents = Vector2( 48, 16 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=2]
|
[sub_resource type="AtlasTexture" id=2]
|
||||||
@ -29,6 +29,8 @@ animations = [ {
|
|||||||
size = 12
|
size = 12
|
||||||
font_data = ExtResource( 5 )
|
font_data = ExtResource( 5 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id=6]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=7]
|
[sub_resource type="StyleBoxEmpty" id=7]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=8]
|
[sub_resource type="StyleBoxEmpty" id=8]
|
||||||
@ -37,15 +39,13 @@ font_data = ExtResource( 5 )
|
|||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=10]
|
[sub_resource type="StyleBoxEmpty" id=10]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id=11]
|
|
||||||
|
|
||||||
[node name="Shop" type="StaticBody2D"]
|
[node name="Shop" type="StaticBody2D"]
|
||||||
position = Vector2( 176, 144 )
|
position = Vector2( 176, 144 )
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2( 32, 0 )
|
position = Vector2( 32, 0 )
|
||||||
shape = SubResource( 6 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="Left" type="Sprite" parent="."]
|
[node name="Left" type="Sprite" parent="."]
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
@ -65,7 +65,6 @@ region_enabled = true
|
|||||||
region_rect = Rect2( 0, 736, 32, 32 )
|
region_rect = Rect2( 0, 736, 32, 32 )
|
||||||
|
|
||||||
[node name="ShopDialog" type="PopupDialog" parent="."]
|
[node name="ShopDialog" type="PopupDialog" parent="."]
|
||||||
visible = true
|
|
||||||
margin_left = -80.0
|
margin_left = -80.0
|
||||||
margin_top = 16.0
|
margin_top = 16.0
|
||||||
margin_right = 146.0
|
margin_right = 146.0
|
||||||
@ -125,11 +124,11 @@ __meta__ = {
|
|||||||
margin_top = 8.0
|
margin_top = 8.0
|
||||||
margin_right = 160.0
|
margin_right = 160.0
|
||||||
margin_bottom = 30.0
|
margin_bottom = 30.0
|
||||||
custom_styles/hover = SubResource( 7 )
|
custom_styles/hover = SubResource( 6 )
|
||||||
custom_styles/pressed = SubResource( 8 )
|
custom_styles/pressed = SubResource( 7 )
|
||||||
custom_styles/focus = SubResource( 9 )
|
custom_styles/focus = SubResource( 8 )
|
||||||
custom_styles/disabled = SubResource( 10 )
|
custom_styles/disabled = SubResource( 9 )
|
||||||
custom_styles/normal = SubResource( 11 )
|
custom_styles/normal = SubResource( 10 )
|
||||||
custom_fonts/font = ExtResource( 1 )
|
custom_fonts/font = ExtResource( 1 )
|
||||||
text = "生命+100"
|
text = "生命+100"
|
||||||
|
|
||||||
@ -137,11 +136,11 @@ text = "生命+100"
|
|||||||
margin_top = 38.0
|
margin_top = 38.0
|
||||||
margin_right = 160.0
|
margin_right = 160.0
|
||||||
margin_bottom = 60.0
|
margin_bottom = 60.0
|
||||||
custom_styles/hover = SubResource( 7 )
|
custom_styles/hover = SubResource( 6 )
|
||||||
custom_styles/pressed = SubResource( 8 )
|
custom_styles/pressed = SubResource( 7 )
|
||||||
custom_styles/focus = SubResource( 9 )
|
custom_styles/focus = SubResource( 8 )
|
||||||
custom_styles/disabled = SubResource( 10 )
|
custom_styles/disabled = SubResource( 9 )
|
||||||
custom_styles/normal = SubResource( 11 )
|
custom_styles/normal = SubResource( 10 )
|
||||||
custom_fonts/font = ExtResource( 1 )
|
custom_fonts/font = ExtResource( 1 )
|
||||||
text = "攻击力+2"
|
text = "攻击力+2"
|
||||||
|
|
||||||
@ -149,11 +148,11 @@ text = "攻击力+2"
|
|||||||
margin_top = 68.0
|
margin_top = 68.0
|
||||||
margin_right = 160.0
|
margin_right = 160.0
|
||||||
margin_bottom = 90.0
|
margin_bottom = 90.0
|
||||||
custom_styles/hover = SubResource( 7 )
|
custom_styles/hover = SubResource( 6 )
|
||||||
custom_styles/pressed = SubResource( 8 )
|
custom_styles/pressed = SubResource( 7 )
|
||||||
custom_styles/focus = SubResource( 9 )
|
custom_styles/focus = SubResource( 8 )
|
||||||
custom_styles/disabled = SubResource( 10 )
|
custom_styles/disabled = SubResource( 9 )
|
||||||
custom_styles/normal = SubResource( 11 )
|
custom_styles/normal = SubResource( 10 )
|
||||||
custom_fonts/font = ExtResource( 1 )
|
custom_fonts/font = ExtResource( 1 )
|
||||||
text = "防御力+4"
|
text = "防御力+4"
|
||||||
|
|
||||||
@ -161,11 +160,11 @@ text = "防御力+4"
|
|||||||
margin_top = 98.0
|
margin_top = 98.0
|
||||||
margin_right = 160.0
|
margin_right = 160.0
|
||||||
margin_bottom = 120.0
|
margin_bottom = 120.0
|
||||||
custom_styles/hover = SubResource( 7 )
|
custom_styles/hover = SubResource( 6 )
|
||||||
custom_styles/pressed = SubResource( 8 )
|
custom_styles/pressed = SubResource( 7 )
|
||||||
custom_styles/focus = SubResource( 9 )
|
custom_styles/focus = SubResource( 8 )
|
||||||
custom_styles/disabled = SubResource( 10 )
|
custom_styles/disabled = SubResource( 9 )
|
||||||
custom_styles/normal = SubResource( 11 )
|
custom_styles/normal = SubResource( 10 )
|
||||||
custom_fonts/font = ExtResource( 1 )
|
custom_fonts/font = ExtResource( 1 )
|
||||||
text = "离开"
|
text = "离开"
|
||||||
[connection signal="pressed" from="ShopDialog/VBoxContainer/AddHp" to="." method="_on_AddHp_pressed"]
|
[connection signal="pressed" from="ShopDialog/VBoxContainer/AddHp" to="." method="_on_AddHp_pressed"]
|
||||||
|
Loading…
Reference in New Issue
Block a user