Fix with magig

This commit is contained in:
dariasteam 2018-02-25 02:44:23 +00:00
parent b598676dcc
commit bd30ebbad4
5 changed files with 29 additions and 13 deletions

View file

@ -10,8 +10,7 @@ func _ready():
func _on_Apple_body_enter( body ):
if(body.is_in_group("player")):
body.add_milk(amount)
disconnect("body_enter",self,"_on_Area2D_body_enter")
body.add_milk(amount)
sound.play()
sprite.set_opacity(0)

View file

@ -26,7 +26,6 @@ onready var hud_milk = get_tree().get_nodes_in_group("milk_hud")[0]
onready var hud_life = get_tree().get_nodes_in_group("life_hud")[0]
onready var hud_cowbell = get_tree().get_nodes_in_group("cowbell_hud")[0]
onready var JUMP_SOUND = ResourceLoader.load("Sound/player_jump.ogg")
onready var cowbell_collector = get_node("cowbell_collector")
var can_jump = true
@ -130,8 +129,7 @@ func show_damage ():
func can_jump_more ():
return jump_time > 0
func play_sound(stream):
sound.set_stream(stream)
func play_sound():
sound.play()
func _fixed_process(delta):
@ -142,7 +140,7 @@ func _fixed_process(delta):
# Salto
if (can_jump and jump_key_pressed):
play_sound(JUMP_SOUND)
play_sound()
velocity.y = - JUMP_SPEED
jumping = true
jump_time = MAX_JUMP_TIME

View file

@ -76,7 +76,7 @@ collision/bounce = 0.0
collision/layers = 2048
collision/mask = 14
occluder/light_mask = 1
tile_data = IntArray( -2293773, 33, -2293772, 37, -2293771, 35, -2162722, 36, -2162721, 37, -2162720, 35, -2162701, 26, -2031650, 36, -2031649, 37, -2031648, 35, -1966098, 36, -1966097, 37, -1966096, 35, -1966088, 36, -1966087, 37, -1966086, 36, -1966085, 37, -1966084, 37, -1966083, 37, -1966082, 34, -1769493, 33, -1769492, 37, -1769491, 35, -1769490, 36, -1769489, 37, -1769488, 35, -1769478, 36, -1769477, 37, -1769476, 37, -1769475, 37, -1769474, 38, -1769473, 37, -1835008, 34, -1638421, 33, -1638420, 37, -1638419, 35, -1638402, 26, -1572887, 33, -1572886, 37, -1572885, 35, -1507349, 33, -1507348, 37, -1507347, 35, -1507345, 33, -1507344, 37, -1507343, 37, -1507342, 37, -1507341, 35, -1441815, 33, -1441814, 37, -1441813, 35, -1441809, 25, -1441806, 41, -1441798, 25, -1376277, 33, -1376276, 37, -1376275, 35, -1376266, 25, -1310743, 33, -1310742, 37, -1310741, 35, -1310723, 536870958, -1310722, 37, -1310721, 37, -1376256, 34, -1245191, 23, -1245190, 22, -1245189, 22, -1245188, 22, -1245187, 24, -1179671, 33, -1179670, 37, -1179669, 35, -1048599, 33, -1048598, 37, -1048597, 35, -1114112, 26, -917527, 33, -917526, 37, -917525, 37, -917524, 37, -917523, 37, -917522, 37, -917521, 37, -917520, 37, -917519, 37, -917518, 37, -917517, 37, -917516, 37, -917515, 37, -917514, 37, -917513, 37, -917512, 37, -917511, 35, -786450, 26, -851955, 35, -655363, 22 )
tile_data = IntArray( -2293773, 33, -2293772, 37, -2293771, 35, -2162722, 36, -2162721, 37, -2162720, 35, -2162701, 26, -2031650, 36, -2031649, 37, -2031648, 35, -1966098, 36, -1966097, 37, -1966096, 35, -1966088, 36, -1966087, 37, -1966086, 36, -1966085, 37, -1966084, 37, -1966083, 37, -1966082, 34, -1769493, 33, -1769492, 37, -1769491, 35, -1769490, 36, -1769489, 37, -1769488, 35, -1769478, 36, -1769477, 37, -1769476, 37, -1769475, 37, -1769474, 38, -1769473, 37, -1835008, 34, -1638421, 33, -1638420, 37, -1638419, 35, -1638402, 26, -1572887, 33, -1572886, 37, -1572885, 35, -1507349, 33, -1507348, 37, -1507347, 35, -1507345, 33, -1507344, 37, -1507343, 37, -1507342, 37, -1507341, 35, -1441815, 33, -1441814, 37, -1441813, 35, -1441809, 25, -1441806, 41, -1441798, 25, -1376277, 33, -1376276, 37, -1376275, 35, -1376266, 25, -1310743, 33, -1310742, 37, -1310741, 35, -1310723, 536870958, -1310722, 37, -1310721, 37, -1376256, 34, -1245191, 23, -1245190, 22, -1245189, 22, -1245188, 22, -1245187, 24, -1179671, 33, -1179670, 37, -1179669, 35, -1048599, 33, -1048598, 37, -1048597, 35, -1114112, 26, -917527, 33, -917526, 37, -917525, 37, -917524, 37, -917523, 37, -917522, 37, -917521, 37, -917520, 37, -917519, 37, -917518, 37, -917517, 37, -917516, 37, -917515, 37, -917514, 37, -917513, 37, -917512, 37, -917511, 35, -851989, 36, -851988, 37, -851987, 35, -851979, 36, -851978, 37, -851977, 35, -786450, 26, -851955, 35, -655363, 22 )
[node name="trees" type="TileMap" parent="."]
@ -116,7 +116,7 @@ collision/bounce = 0.0
collision/layers = 2
collision/mask = 15
occluder/light_mask = 1
tile_data = IntArray( -2490404, 13, -2424869, 13, -2424868, 13, -2359334, 13, -2359332, 13, -2359309, 32, -2293796, 13, -2293773, 31, -2293771, 13, -2293770, 13, -2293769, 13, -2293768, 13, -2228259, 0, -2228258, 2, -2228239, 13, -2228237, 30, -2228231, 13, -2162727, 13, -2162723, 3, -2162722, 5, -2162720, 13, -2162708, 14, -2162707, 1, -2162706, 1, -2162705, 1, -2162704, 1, -2162703, 2, -2162701, 13, -2162698, 0, -2162697, 2, -2162695, 0, -2162694, 1, -2162693, 1, -2162692, 15, -2162690, 32, -2228224, 31, -2097187, 3, -2097186, 5, -2097172, 6, -2097171, 7, -2097170, 7, -2097169, 7, -2097168, 7, -2097167, 8, -2097162, 3, -2097161, 5, -2097159, 17, -2097158, 7, -2097157, 7, -2097156, 8, -2097154, 31, -2162688, 31, -2031653, 13, -2031651, 3, -2031650, 5, -2031648, 13, -2031636, 13, -2031626, 3, -2031625, 12, -2031624, 15, -2031618, 31, -2097152, 31, -1966115, 3, -1966114, 5, -1966102, 13, -1966098, 13, -1966096, 0, -1966095, 2, -1966090, 17, -1966089, 10, -1966088, 5, -1966086, 13, -1966082, 31, -2031616, 31, -1900579, 3, -1900578, 12, -1900577, 1, -1900576, 1, -1900575, 1, -1900574, 1, -1900573, 1, -1900572, 1, -1900571, 1, -1900570, 1, -1900569, 1, -1900568, 1, -1900567, 1, -1900566, 2, -1900560, 3, -1900559, 5, -1900553, 3, -1900552, 5, -1900548, 13, -1900547, 13, -1900546, 31, -1966080, 31, -1835044, 13, -1835043, 6, -1835042, 7, -1835041, 7, -1835040, 7, -1835039, 7, -1835038, 7, -1835037, 7, -1835036, 7, -1835035, 7, -1835034, 7, -1835033, 7, -1835032, 7, -1835031, 7, -1835030, 8, -1835029, 32, -1835024, 3, -1835023, 5, -1835017, 6, -1835016, 8, -1835010, 31, -1900544, 31, -1769493, 31, -1769490, 13, -1769488, 3, -1769487, 5, -1769478, 13, -1769474, 31, -1835008, 31, -1703974, 13, -1703973, 13, -1703965, 20, -1703960, 13, -1703957, 31, -1703954, 13, -1703952, 17, -1703951, 12, -1703950, 15, -1703946, 14, -1703945, 1, -1703944, 1, -1703943, 1, -1703942, 2, -1703938, 30, -1769472, 31, -1638437, 13, -1638436, 0, -1638435, 1, -1638434, 1, -1638433, 1, -1638432, 1, -1638431, 1, -1638430, 1, -1638429, 1, -1638428, 1, -1638427, 1, -1638426, 1, -1638425, 1, -1638424, 2, -1638423, 32, -1638421, 31, -1638418, 13, -1638415, 17, -1638414, 16, -1638413, 13, -1638412, 13, -1638411, 13, -1638410, 3, -1638409, 4, -1638408, 11, -1638407, 7, -1638406, 8, -1638403, 0, -1638402, 2, -1703936, 31, -1572900, 6, -1572899, 7, -1572898, 7, -1572897, 7, -1572896, 7, -1572895, 7, -1572894, 7, -1572893, 7, -1572892, 7, -1572891, 7, -1572890, 7, -1572889, 7, -1572888, 8, -1572887, 31, -1572885, 31, -1572881, 32, -1572874, 17, -1572873, 7, -1572872, 16, -1572868, 32, -1572867, 17, -1572866, 16, -1638400, 31, -1507351, 31, -1507349, 31, -1507345, 30, -1507341, 13, -1507340, 13, -1507339, 13, -1507338, 13, -1507334, 18, -1507332, 30, -1572864, 31, -1441815, 31, -1441813, 31, -1441810, 0, -1441809, 2, -1441806, 29, -1441800, 14, -1441799, 1, -1441798, 1, -1441797, 1, -1441796, 2, -1507328, 31, -1376279, 31, -1376277, 31, -1376274, 3, -1376273, 5, -1376271, 0, -1376270, 2, -1376268, 0, -1376267, 1, -1376266, 1, -1376265, 1, -1376264, 9, -1376263, 7, -1376262, 7, -1376261, 7, -1376260, 8, -1441792, 31, -1310743, 31, -1310741, 30, -1310738, 6, -1310737, 8, -1310735, 6, -1310734, 8, -1310732, 6, -1310731, 7, -1310730, 7, -1310729, 10, -1310728, 5, -1376256, 31, -1245207, 31, -1245205, 0, -1245204, 2, -1245193, 3, -1245192, 12, -1245191, 1, -1245190, 1, -1245189, 1, -1245188, 1, -1245187, 2, -1310720, 31, -1179671, 31, -1179669, 3, -1179668, 5, -1179664, 20, -1179657, 6, -1179656, 7, -1179655, 7, -1179654, 7, -1179653, 7, -1179652, 7, -1179651, 8, -1245184, 31, -1114135, 31, -1114133, 3, -1114132, 12, -1114131, 1, -1114130, 1, -1114129, 1, -1114128, 1, -1114127, 1, -1114126, 1, -1114125, 1, -1114124, 1, -1114123, 1, -1114122, 1, -1114121, 2, -1179648, 30, -1048599, 31, -1048597, 6, -1048596, 7, -1048595, 7, -1048594, 7, -1048593, 7, -1048592, 7, -1048591, 7, -1048590, 7, -1048589, 7, -1048588, 7, -1048587, 7, -1048586, 7, -1048585, 16, -1048583, 0, -1048582, 1, -1048581, 1, -1048580, 1, -1048579, 1, -1048578, 1, -1048577, 1, -1114112, 1, -1114111, 2, -983063, 31, -983047, 6, -983046, 7, -983045, 7, -983044, 7, -983043, 7, -983042, 7, -983041, 7, -1048576, 7, -1048575, 8, -917527, 31, -851991, 31, -786455, 31, -786450, 13, -786440, 13, -720913, 13, -720903, 13, -720899, 20, -655376, 0, -655375, 2, -655366, 0, -655365, 1, -655364, 1, -655363, 1, -655362, 1, -655361, 1, -720896, 1, -720895, 1, -720894, 2, -589840, 6, -589839, 8, -589830, 6, -589829, 7, -589828, 7, -589827, 7, -589826, 7, -589825, 7, -655360, 7, -655359, 7, -655358, 8 )
tile_data = IntArray( -2490404, 13, -2424869, 13, -2424868, 13, -2359334, 13, -2359332, 13, -2359309, 32, -2293796, 13, -2293773, 31, -2293771, 13, -2293770, 13, -2293769, 13, -2293768, 13, -2228259, 0, -2228258, 2, -2228244, 0, -2228239, 13, -2228237, 30, -2228231, 13, -2162727, 13, -2162723, 3, -2162722, 5, -2162720, 13, -2162717, 13, -2162714, 13, -2162711, 13, -2162708, 0, -2162707, 1, -2162706, 1, -2162705, 1, -2162704, 1, -2162703, 2, -2162701, 13, -2162698, 0, -2162697, 2, -2162695, 0, -2162694, 1, -2162693, 1, -2162692, 15, -2162690, 32, -2228224, 31, -2097187, 3, -2097186, 5, -2097172, 6, -2097171, 7, -2097170, 7, -2097169, 7, -2097168, 7, -2097167, 8, -2097162, 3, -2097161, 5, -2097159, 17, -2097158, 7, -2097157, 7, -2097156, 8, -2097154, 31, -2162688, 31, -2031653, 13, -2031651, 3, -2031650, 5, -2031648, 13, -2031636, 13, -2031626, 3, -2031625, 12, -2031624, 15, -2031618, 31, -2097152, 31, -1966115, 3, -1966114, 5, -1966102, 13, -1966098, 13, -1966096, 0, -1966095, 2, -1966090, 17, -1966089, 10, -1966088, 5, -1966086, 13, -1966085, 13, -1966084, 13, -1966083, 13, -1966082, 31, -2031616, 31, -1900579, 3, -1900578, 12, -1900577, 1, -1900576, 1, -1900575, 1, -1900574, 1, -1900573, 1, -1900572, 1, -1900571, 1, -1900570, 1, -1900569, 1, -1900568, 1, -1900567, 1, -1900566, 2, -1900560, 3, -1900559, 5, -1900553, 3, -1900552, 5, -1900546, 31, -1966080, 31, -1835044, 13, -1835043, 6, -1835042, 7, -1835041, 7, -1835040, 7, -1835039, 7, -1835038, 7, -1835037, 7, -1835036, 7, -1835035, 7, -1835034, 7, -1835033, 7, -1835032, 7, -1835031, 7, -1835030, 8, -1835029, 32, -1835024, 3, -1835023, 5, -1835017, 6, -1835016, 8, -1835010, 31, -1900544, 31, -1769493, 31, -1769490, 13, -1769488, 3, -1769487, 5, -1769478, 13, -1769474, 31, -1835008, 31, -1703974, 13, -1703973, 13, -1703965, 20, -1703960, 13, -1703957, 31, -1703954, 13, -1703952, 17, -1703951, 12, -1703950, 15, -1703946, 14, -1703945, 1, -1703944, 1, -1703943, 1, -1703942, 2, -1703938, 30, -1769472, 31, -1638437, 13, -1638436, 0, -1638435, 1, -1638434, 1, -1638433, 1, -1638432, 1, -1638431, 1, -1638430, 1, -1638429, 1, -1638428, 1, -1638427, 1, -1638426, 1, -1638425, 1, -1638424, 2, -1638423, 32, -1638421, 31, -1638418, 13, -1638415, 17, -1638414, 16, -1638413, 13, -1638412, 13, -1638411, 13, -1638410, 3, -1638409, 4, -1638408, 11, -1638407, 7, -1638406, 8, -1638403, 0, -1638402, 2, -1703936, 31, -1572900, 6, -1572899, 7, -1572898, 7, -1572897, 7, -1572896, 7, -1572895, 7, -1572894, 7, -1572893, 7, -1572892, 7, -1572891, 7, -1572890, 7, -1572889, 7, -1572888, 8, -1572887, 31, -1572885, 31, -1572881, 32, -1572874, 17, -1572873, 7, -1572872, 16, -1572868, 32, -1572867, 17, -1572866, 16, -1638400, 31, -1507351, 31, -1507349, 31, -1507345, 30, -1507341, 13, -1507340, 13, -1507339, 13, -1507338, 13, -1507334, 18, -1507332, 30, -1572864, 31, -1441815, 31, -1441813, 31, -1441810, 0, -1441809, 2, -1441806, 29, -1441800, 14, -1441799, 1, -1441798, 1, -1441797, 1, -1441796, 2, -1507328, 31, -1376279, 31, -1376277, 31, -1376274, 3, -1376273, 5, -1376271, 0, -1376270, 2, -1376268, 0, -1376267, 1, -1376266, 1, -1376265, 1, -1376264, 9, -1376263, 7, -1376262, 7, -1376261, 7, -1376260, 8, -1441792, 31, -1310743, 31, -1310741, 30, -1310738, 6, -1310737, 8, -1310735, 6, -1310734, 8, -1310732, 6, -1310731, 7, -1310730, 7, -1310729, 10, -1310728, 5, -1376256, 31, -1245207, 31, -1245205, 0, -1245204, 2, -1245193, 3, -1245192, 12, -1245191, 1, -1245190, 1, -1245189, 1, -1245188, 1, -1245187, 2, -1310720, 31, -1179671, 31, -1179669, 3, -1179668, 5, -1179664, 20, -1179657, 6, -1179656, 7, -1179655, 7, -1179654, 7, -1179653, 7, -1179652, 7, -1179651, 8, -1245184, 31, -1114135, 31, -1114133, 3, -1114132, 12, -1114131, 1, -1114130, 1, -1114129, 1, -1114128, 1, -1114127, 1, -1114126, 1, -1114125, 1, -1114124, 1, -1114123, 1, -1114122, 1, -1114121, 2, -1179648, 30, -1048599, 31, -1048597, 6, -1048596, 7, -1048595, 7, -1048594, 7, -1048593, 7, -1048592, 7, -1048591, 7, -1048590, 7, -1048589, 7, -1048588, 7, -1048587, 7, -1048586, 7, -1048585, 16, -1048583, 0, -1048582, 1, -1048581, 1, -1048580, 1, -1048579, 1, -1048578, 1, -1048577, 1, -1114112, 1, -1114111, 2, -983063, 31, -983047, 6, -983046, 7, -983045, 7, -983044, 7, -983043, 7, -983042, 7, -983041, 7, -1048576, 7, -1048575, 8, -917527, 31, -851991, 31, -786455, 31, -786450, 13, -786440, 13, -720913, 13, -720903, 13, -720899, 20, -655376, 0, -655375, 2, -655366, 0, -655365, 1, -655364, 1, -655363, 1, -655362, 1, -655361, 1, -720896, 1, -720895, 1, -720894, 2, -589840, 6, -589839, 8, -589830, 6, -589829, 7, -589828, 7, -589827, 7, -589826, 7, -589825, 7, -655360, 7, -655359, 7, -655358, 8 )
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
@ -279,6 +279,18 @@ transform/pos = Vector2( 1670, 460 )
z/z = -2
amount = 20
[node name="Apple3" parent="apples" instance=ExtResource( 7 )]
transform/pos = Vector2( 3199.3, -276.187 )
z/z = -2
amount = 20
[node name="Apple4" parent="apples" instance=ExtResource( 7 )]
transform/pos = Vector2( 2417.57, 2110.73 )
z/z = -2
amount = 20
[node name="hearts" type="Node2D" parent="."]
[node name="Heart" parent="hearts" instance=ExtResource( 8 )]
@ -289,6 +301,14 @@ transform/pos = Vector2( -1250, -3930 )
transform/pos = Vector2( -1900, -2540 )
[node name="Heart2" parent="hearts" instance=ExtResource( 8 )]
transform/pos = Vector2( -156.963, -3730.15 )
[node name="Heart3" parent="hearts" instance=ExtResource( 8 )]
transform/pos = Vector2( -3435.65, -3726.35 )
[node name="cowbells" type="Node2D" parent="."]
transform/pos = Vector2( 500, 560 )
@ -1757,7 +1777,7 @@ transform/scale = Vector2( 1.7, 1.7 )
[node name="jail6" parent="Cages" instance=ExtResource( 13 )]
transform/pos = Vector2( -250, -3380 )
transform/pos = Vector2( -495.771, -3402.32 )
transform/scale = Vector2( 1.7, 1.7 )
[node name="jail7" parent="Cages" instance=ExtResource( 13 )]

View file

@ -2,8 +2,7 @@ extends Button
export(PackedScene) var scene
func _ready():
connect("pressed", self, "_on_Button_pressed")
func _ready():
set_process_input(true)
func _on_Button_pressed():

View file

@ -2,8 +2,8 @@ extends Node
const MENU_MUSIC = preload ("res://Music/dangerous_hills.ogg")
var base_price_heart = 1000
var base_price_milk = 1000
var base_price_heart = 500
var base_price_milk = 500
var increment_price_heart = 2
var increment_price_milk = 2