add 3rd monster

This commit is contained in:
Fusselkater 2022-07-19 22:22:16 +02:00
parent 75aa13cdeb
commit e1de3d0748
25 changed files with 1264 additions and 10 deletions

View file

@ -9,3 +9,5 @@ var keys = {
var coins = 0 var coins = 0
var health = 100 var health = 100
var player : KinematicBody2D = null

View file

@ -2,9 +2,9 @@ extends "res://objects/characters/monsters/monster.gd"
func _process(delta): func _process(delta):
if velocity != null: if velocity != null:
if not $RayBottomLeft.is_colliding(): if not $RayBottomLeft.is_colliding() or $RayLeft.is_colliding():
velocity.x = speed velocity.x = speed
if not $RayBottomRight.is_colliding(): if not $RayBottomRight.is_colliding() or $RayRight.is_colliding():
velocity.x = -speed velocity.x = -speed
func stomped_on_head(): func stomped_on_head():

View file

@ -43,7 +43,7 @@ script = ExtResource( 2 )
scale = Vector2( 0.2, 0.2 ) scale = Vector2( 0.2, 0.2 )
frames = SubResource( 1 ) frames = SubResource( 1 )
animation = "idle" animation = "idle"
frame = 6 frame = 8
playing = true playing = true
[node name="Collision" type="CollisionShape2D" parent="."] [node name="Collision" type="CollisionShape2D" parent="."]
@ -56,12 +56,24 @@ enabled = true
cast_to = Vector2( 0, 5 ) cast_to = Vector2( 0, 5 )
collision_mask = 4 collision_mask = 4
[node name="RayLeft" type="RayCast2D" parent="."]
position = Vector2( -38, 23 )
enabled = true
cast_to = Vector2( -5, 0 )
collision_mask = 4
[node name="RayBottomRight" type="RayCast2D" parent="."] [node name="RayBottomRight" type="RayCast2D" parent="."]
position = Vector2( 39, 23 ) position = Vector2( 39, 23 )
enabled = true enabled = true
cast_to = Vector2( 0, 5 ) cast_to = Vector2( 0, 5 )
collision_mask = 4 collision_mask = 4
[node name="RayRight" type="RayCast2D" parent="."]
position = Vector2( 39, 23 )
enabled = true
cast_to = Vector2( 5, 0 )
collision_mask = 4
[node name="RayPlayerLeft" type="RayCast2D" parent="."] [node name="RayPlayerLeft" type="RayCast2D" parent="."]
position = Vector2( -38, 21 ) position = Vector2( -38, 21 )
enabled = true enabled = true

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="26"
height="26"
viewBox="0 0 6.8791667 6.8791667"
version="1.1"
id="svg2585"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="fireball.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview2587"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="10.35098"
inkscape:cx="24.248912"
inkscape:cy="28.886154"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2582" />
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-51.457638,-44.830843)">
<g
id="g2725"
transform="translate(0.52916683,0.26458533)">
<path
stroke="none"
fill="#e86a17"
d="m 52.357225,45.756884 q 0.899584,-0.926041 2.182813,-0.926041 0.820208,0 1.494896,0.396875 1.349374,1.005416 0.224895,2.831041 l -0.119062,0.05292 q -1.150938,0.489479 -0.608542,1.349375 0.529167,0.899583 1.653646,-0.03969 l 0.0926,0.0926 q -0.224896,0.396875 -0.555625,0.740833 -0.899583,0.926042 -2.182812,0.926042 -1.283229,0 -2.182813,-0.926042 -0.899583,-0.926042 -0.899583,-2.248958 0,-1.309688 0.899583,-2.248959 m 1.653646,1.812396 q 0.370417,0.370417 0.873125,0.370417 0.515938,0 0.873125,-0.370417 0.370417,-0.370417 0.370417,-0.899583 0,-0.515938 -0.370417,-0.899584 -0.357187,-0.370416 -0.873125,-0.370416 -0.502708,0 -0.873125,0.370416 -0.357187,0.383646 -0.357187,0.899584 0,0.529166 0.357187,0.899583"
id="path1443"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#ee9255"
d="m 54.010871,47.56928 q -0.357187,-0.370417 -0.357187,-0.899583 0,-0.515938 0.357187,-0.899584 0.370417,-0.370416 0.873125,-0.370416 0.515938,0 0.873125,0.370416 0.370417,0.383646 0.370417,0.899584 0,0.529166 -0.370417,0.899583 -0.357187,0.370417 -0.873125,0.370417 -0.502708,0 -0.873125,-0.370417"
id="path1445"
style="stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/fireball.svg-06553e9f4e4b1f86e4c3d92e0cb5bd2d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/characters/monsters/03/assets/fireball.svg"
dest_files=[ "res://.import/fireball.svg-06553e9f4e4b1f86e4c3d92e0cb5bd2d.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="70"
height="60"
viewBox="0 0 18.520833 15.875"
version="1.1"
id="svg5518"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="sprite1.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview5520"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.914906"
inkscape:cx="-17.488135"
inkscape:cy="242.64788"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs5515" />
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-93.971492,-84.275396)">
<g
id="g5955"
transform="translate(-49.156334,-37.794102)">
<path
stroke="none"
fill="#dbdbdb"
d="m 151.46879,131.72635 q -0.0529,0.23813 -0.35719,0.42333 l -1.4552,0.83344 q -0.30428,0.17198 -0.58209,0.11906 -0.27781,-0.0661 -0.51594,-0.33073 v -0.0132 l -3.24114,-3.69094 q -0.26458,-0.3175 -0.38365,-0.58209 -0.26458,-0.60854 0.34396,-0.96572 l 2.10344,-1.23032 q 0.85989,-0.47625 1.54781,0.68792 l 2.42094,4.19365 q 0.17198,0.3175 0.11906,0.55562"
id="path4824"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#4f4f4f"
d="m 153.9691,132.85083 2.83105,-1.64042 q 0.68791,-0.39687 1.08479,0.29104 l 1.65364,2.83105 q 0.39688,0.70114 -0.29104,1.09802 l -2.84427,1.64041 q -0.70115,0.41011 -1.09802,-0.29104 l -1.64042,-2.84427 q -0.39687,-0.68792 0.30427,-1.08479"
id="path4826"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 151.45556,129.74198 0.21167,0.0397 h 0.0794 l 0.39688,0.0662 q 1.11125,0.19844 2.01083,0.62177 0.635,0.3175 1.19063,0.7276 1.33614,1.07157 1.34937,2.40771 -0.0132,1.30969 -1.3626,2.35479 -1.27,0.99219 -3.10886,1.36261 l -0.17198,0.0397 -0.38364,0.0529 -0.21167,0.0132 -0.17198,0.0265 h -0.0794 q -1.52136,-0.0529 -2.57969,-1.12448 -1.13771,-1.13771 -1.13771,-2.72521 -0.0132,-1.61396 1.13771,-2.75166 0.39688,-0.41011 0.89958,-0.68792 0.7673,-0.39688 1.68011,-0.42333 h 0.0794 v -0.0132 l 0.17198,0.0132"
id="path4828"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#414141"
d="m 149.96067,132.03062 q 0.39687,0 0.67468,0.27781 0.29105,0.29105 0.29105,0.68792 0,0.38365 -0.29105,0.67469 -0.27781,0.27781 -0.67468,0.27781 -0.39688,0 -0.67469,-0.27781 -0.29104,-0.29104 -0.29104,-0.67469 0,-0.39687 0.29104,-0.68792 0.27781,-0.27781 0.67469,-0.27781"
id="path4830"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 150.56921,135.7877 q 0.3175,0.33073 0.0132,0.64823 l -1.34938,1.33615 -0.13229,0.11906 q -0.27781,0.14552 -0.51594,-0.10583 l -1.34937,-1.33615 q -0.33073,-0.34396 -0.0132,-0.66146 l 1.34937,-1.33614 q 0.33073,-0.34396 0.66146,0 l 1.33615,1.33614"
id="path4832"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#ffffff"
d="m 155.62275,132.63916 -0.0132,0.0132 q -0.2249,0.26459 -0.48948,0.33073 -0.29104,0.0529 -0.58208,-0.11906 l -1.46844,-0.83344 q -0.30427,-0.18521 -0.35719,-0.42333 -0.0529,-0.23813 0.11907,-0.55563 l 2.42093,-4.18041 q 0.67469,-1.1774 1.54782,-0.68792 l 2.11666,1.21708 q 0.59531,0.34396 0.33073,0.96573 l -0.38364,0.58209 -3.24115,3.69093"
id="path4834"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#dbdbdb"
d="m 155.62275,132.63916 3.24115,-3.69093 0.38364,-0.58209 0.41011,0.41011 q 0.70114,0.71437 -0.4498,1.48166 l -3.5851,2.38125"
id="path4836"
style="stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/sprite1.svg-8aee01c247271956baa70511a2a06299.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/characters/monsters/03/assets/sprite1.svg"
dest_files=[ "res://.import/sprite1.svg-8aee01c247271956baa70511a2a06299.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="70"
height="60"
viewBox="0 0 18.520833 15.875"
version="1.1"
id="svg5518"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="sprite2.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview5520"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="3.659624"
inkscape:cx="-2.7325212"
inkscape:cy="75.417584"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs5515" />
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-93.971492,-84.275396)">
<g
id="g6594"
transform="translate(-0.1959007,0.27858964)">
<path
stroke="none"
fill="#dbdbdb"
d="m 102.2007,93.46845 -0.84666,1.4552 q -0.17198,0.30428 -0.43657,0.39688 l -0.62177,-0.0265 v -0.0132 L 95.639037,93.70656 Q 95.255391,93.56104 95.017266,93.40229 94.4881,93.00542 94.832058,92.38364 l 1.203854,-2.11666 Q 96.53862,89.43354 97.716016,90.095 l 4.206874,2.40771 q 0.30427,0.19843 0.38365,0.43656 0.0662,0.2249 -0.10584,0.52917"
id="path4838"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#4f4f4f"
d="m 107.90248,93.13772 q 0.68791,-0.39688 1.08479,0.29104 l 1.65364,2.83104 q 0.39688,0.70115 -0.29104,1.09802 l -2.84427,1.64042 q -0.70114,0.4101 -1.09802,-0.29104 l -1.64042,-2.84428 q -0.39687,-0.68791 0.30428,-1.08479 l 2.83104,-1.64041"
id="path4840"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 105.25664,92.39688 q 0.635,0.3175 1.19063,0.72761 1.33614,1.07156 1.34937,2.40771 -0.0132,1.30968 -1.3626,2.35479 -1.27,0.99219 -3.10885,1.3626 l -0.17198,0.0397 -0.38365,0.0529 -0.21167,0.0132 -0.17198,0.0265 h -0.0794 q -1.52135,-0.0529 -2.579685,-1.12448 -1.137709,-1.13771 -1.137709,-2.72521 -0.01323,-1.61395 1.137709,-2.75166 0.396875,-0.41011 0.899585,-0.68792 0.76729,-0.39687 1.6801,-0.42333 h 0.0794 v -0.0132 l 0.17198,0.0132 0.21167,0.0397 h 0.0794 l 0.39688,0.0662 q 1.11125,0.19843 2.01083,0.62177"
id="path4842"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#414141"
d="m 101.06299,93.95792 q 0.39688,0 0.67469,0.27782 0.29104,0.29104 0.29104,0.68791 0,0.38365 -0.29104,0.67469 -0.27781,0.27781 -0.67469,0.27781 -0.39687,0 -0.67468,-0.27781 -0.29104,-0.29104 -0.29104,-0.67469 0,-0.39687 0.29104,-0.68791 0.27781,-0.27782 0.67468,-0.27782"
id="path4844"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 98.337787,98.37647 q -0.330729,-0.34396 -0.01323,-0.66146 l 1.349375,-1.33615 q 0.330728,-0.34396 0.661458,0 l 1.33615,1.33615 q 0.3175,0.33073 0.0132,0.64823 l -1.34938,1.33614 -0.13229,0.11907 q -0.277813,0.14552 -0.515938,-0.10584 l -1.349375,-1.33614"
id="path4846"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#ffffff"
d="m 106.143,95.10886 -0.0265,0.0132 -0.58209,0.0397 q -0.27781,-0.10583 -0.44979,-0.39687 l -0.84666,-1.44198 q -0.17198,-0.3175 -0.10584,-0.55563 0.0794,-0.23812 0.38365,-0.4101 l 4.18042,-2.42094 q 1.17739,-0.67469 1.69333,0.18521 l 1.21708,2.11667 q 0.34396,0.58208 -0.19844,0.99219 l -0.62177,0.3175 -4.64343,1.56104"
id="path4848"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#dbdbdb"
d="m 106.143,95.10886 4.64343,-1.56104 0.62177,-0.3175 0.15875,0.56885 q 0.25136,0.95251 -1.1377,1.05834 l -4.28625,0.25135"
id="path4850"
style="stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/sprite2.svg-216a6a3b29f711bebdf533d0dd078bcd.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/characters/monsters/03/assets/sprite2.svg"
dest_files=[ "res://.import/sprite2.svg-216a6a3b29f711bebdf533d0dd078bcd.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="70"
height="60"
viewBox="0 0 18.520833 15.875"
version="1.1"
id="svg5518"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="sprite3.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview5520"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="3.659624"
inkscape:cx="-2.7325212"
inkscape:cy="75.417584"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs5515" />
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-93.971492,-84.275396)">
<g
id="g6101"
transform="translate(-33.829164,9.8539003)">
<path
stroke="none"
fill="#dbdbdb"
d="m 133.60162,79.260429 2.42094,4.193645 q 0.17198,0.3175 0.11906,0.555625 -0.0529,0.238125 -0.35719,0.423334 l -1.4552,0.833437 q -0.30428,0.171979 -0.58209,0.119063 -0.27781,-0.06615 -0.51594,-0.330729 v -0.01323 l -3.24114,-3.690937 q -0.26458,-0.3175 -0.38365,-0.582083 -0.26458,-0.608542 0.34396,-0.965729 l 2.10344,-1.230313 q 0.85989,-0.47625 1.54781,0.687917"
id="path4854"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#4f4f4f"
d="m 138.64193,85.134179 2.83105,-1.640417 q 0.68791,-0.396875 1.08479,0.291042 l 1.65364,2.831041 q 0.39688,0.701146 -0.29104,1.098021 l -2.84427,1.640417 q -0.70115,0.410104 -1.09802,-0.291042 l -1.64042,-2.844271 q -0.39687,-0.687916 0.30427,-1.084791"
id="path4856"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 140.01777,83.480533 q 1.33614,1.071562 1.34937,2.407708 -0.0132,1.309688 -1.3626,2.354792 -1.27,0.992187 -3.10886,1.362604 l -0.17198,0.03969 -0.38364,0.05292 -0.21167,0.01323 -0.17198,0.02646 h -0.0794 q -1.52136,-0.05292 -2.57969,-1.12448 -1.13771,-1.137708 -1.13771,-2.725208 -0.0132,-1.613958 1.13771,-2.751667 0.39688,-0.410104 0.89958,-0.687916 0.7673,-0.396875 1.68011,-0.423334 h 0.0794 v -0.01323 l 0.17198,0.01323 0.21167,0.03969 h 0.0794 l 0.39688,0.06615 q 1.11125,0.198437 2.01083,0.621771 0.635,0.3175 1.19063,0.727604"
id="path4858"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#585858"
d="m 135.24204,88.071054 q 0.3175,0.330729 0.0132,0.648229 l -1.34938,1.336146 -0.13229,0.119062 q -0.27781,0.145521 -0.51594,-0.105833 l -1.34937,-1.336146 q -0.33073,-0.343958 -0.0132,-0.661458 l 1.34937,-1.336146 q 0.33073,-0.343959 0.66146,0 l 1.33615,1.336146"
id="path4860"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#ffffff"
d="m 140.29558,84.922512 -0.0132,0.01323 q -0.2249,0.264583 -0.48948,0.330729 -0.29104,0.05292 -0.58208,-0.119062 l -1.46844,-0.833438 q -0.30427,-0.185208 -0.35719,-0.423333 -0.0529,-0.238125 0.11907,-0.555625 l 2.42093,-4.180417 q 0.67469,-1.177395 1.54782,-0.687916 l 2.11666,1.217083 q 0.59531,0.343958 0.33073,0.965729 l -0.38364,0.582083 -3.24115,3.690938"
id="path4862"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#dbdbdb"
d="m 140.29558,84.922512 3.24115,-3.690938 0.38364,-0.582083 0.41011,0.410104 q 0.70114,0.714375 -0.4498,1.481667 l -3.5851,2.38125"
id="path4864"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#414141"
d="m 133.48256,84.525637 q 0,-0.145521 0.0926,-0.251354 l 0.0132,-0.01323 q 0.10584,-0.105834 0.26459,-0.09261 0.14552,-0.01323 0.23812,0.09261 l 0.50271,0.502708 0.48948,-0.489479 q 0.10583,-0.105834 0.25135,-0.105834 0.14552,0 0.25136,0.105834 l 0.0132,0.01323 q 0.0926,0.0926 0.0926,0.251354 l -0.0926,0.251354 -0.48948,0.489479 0.47625,0.47625 q 0.10583,0.0926 0.10583,0.251355 0,0.14552 -0.10583,0.251354 l -0.0132,0.01323 q -0.0926,0.105833 -0.25136,0.0926 -0.14552,0 -0.25135,-0.0926 l -0.47625,-0.47625 -0.47625,0.489479 q -0.10583,0.0926 -0.26458,0.0926 -0.15875,0 -0.25136,-0.0926 l -0.0132,-0.01323 q -0.10583,-0.105833 -0.0926,-0.264583 0,-0.145521 0.10583,-0.238125 l 0.47625,-0.48948 -0.50271,-0.502708 q -0.0926,-0.105833 -0.0926,-0.251354"
id="path4866"
style="stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/sprite3.svg-e3c1074f0d2dee0c34f788effc022866.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/characters/monsters/03/assets/sprite3.svg"
dest_files=[ "res://.import/sprite3.svg-e3c1074f0d2dee0c34f788effc022866.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,20 @@
extends StaticBody2D
export(Vector2) var velocity
export(int) var damage = 5
# Called when the node enters the scene tree for the first time.
func _ready():
$Rotation.play("rotate")
$Animation.play("fade")
func _physics_process(delta):
position -= velocity
func _on_PlayerCollision(body):
body.monster_hit(-velocity.x * 10, damage)
queue_free()
func _on_screen_exited():
queue_free()

View file

@ -0,0 +1,68 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://objects/characters/monsters/03/assets/fireball.svg" type="Texture" id=1]
[ext_resource path="res://objects/characters/monsters/03/bullet.gd" type="Script" id=2]
[sub_resource type="CircleShape2D" id=1]
radius = 11.7047
[sub_resource type="Animation" id=2]
resource_name = "rotate"
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2, 0.4, 0.6, 0.8 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 0 ),
"update": 0,
"values": [ 0.0, 90.0, 180.0, 270.0, 360.0 ]
}
[sub_resource type="Animation" id=3]
resource_name = "fade"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[node name="Bullet" type="StaticBody2D"]
collision_layer = 0
collision_mask = 0
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Rotation" type="AnimationPlayer" parent="."]
anims/rotate = SubResource( 2 )
[node name="Animation" type="AnimationPlayer" parent="."]
anims/fade = SubResource( 3 )
[node name="PlayerCollision" type="Area2D" parent="."]
collision_layer = 0
[node name="Collision" type="CollisionShape2D" parent="PlayerCollision"]
shape = SubResource( 1 )
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
[connection signal="body_entered" from="PlayerCollision" to="." method="_on_PlayerCollision"]
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_screen_exited"]

View file

@ -0,0 +1,72 @@
extends ReferenceRect
export var speed : float = 5.0
const BULLET_PATH = "res://objects/characters/monsters/03/bullet.tscn"
var velocity = Vector2(speed, 0)
export var cooldown_time: float = 3.0
export var bullet_speed: float = 3.0
export var damage: int = 10
onready var level = get_parent()
var cooldown = false
onready var bullet_scene = preload(BULLET_PATH)
var bullet_vector = Vector2.ZERO
# Called when the node enters the scene tree for the first time.
func _ready():
randomize()
$monster.position.x = fmod(randi(), rect_size.x)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
# Move only if shoot animation is not played
if not $monster/Animation.is_playing():
_movement()
# Check angle and distance
var angle = $monster.global_position.angle_to_point(GlobalState.player.global_position)
var rounded_angle = fmod(abs(round(rad2deg(angle))), 90)
var distance = $monster.global_position.distance_to(GlobalState.player.global_position)
var direction = ($monster.global_position - GlobalState.player.global_position).normalized()
var player_is_left = direction.x > 0
# Shoot if in right distance/angle
if rounded_angle == 45 and cooldown == false \
and player_is_left != $monster/AnimatedSprite.flip_h \
and GlobalState.player.global_position.y <= rect_global_position.y + rect_size.y:
cooldown = true
# calculate bullet velocity
bullet_vector = ($monster.global_position - GlobalState.player.global_position).normalized()
$monster/Animation.play("shoot")
yield(get_tree().create_timer(cooldown_time), "timeout")
cooldown = false
func _movement():
# Move monster
$monster.position += velocity
if $monster.position.x >= rect_size.x or $monster.position.x <= 0:
velocity.x = -velocity.x
$monster/AnimatedSprite.flip_h = velocity.x > 0
func _on_Animatio_finished(anim_name):
if anim_name == "shoot" and $monster/Animation.current_animation_position != 0:
# generate bullet
var bullet = bullet_scene.instance()
bullet.global_position = $monster.global_position
if $monster/AnimatedSprite.flip_h:
bullet.global_position.x += 70
bullet.velocity = bullet_vector * bullet_speed
bullet.damage = damage
level.add_child(bullet)
print(bullet)
$monster/Animation.play_backwards("shoot")

View file

@ -0,0 +1,58 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://objects/characters/monsters/03/assets/sprite1.svg" type="Texture" id=1]
[ext_resource path="res://objects/characters/monsters/03/assets/sprite2.svg" type="Texture" id=2]
[ext_resource path="res://objects/characters/monsters/03/monster_03.gd" type="Script" id=3]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 1 ), ExtResource( 2 ) ],
"loop": true,
"name": "flying",
"speed": 10.0
} ]
[sub_resource type="CircleShape2D" id=2]
radius = 35.0
[sub_resource type="Animation" id=3]
resource_name = "shoot"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("AnimatedSprite:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 0, 0, 1 ) ]
}
[node name="Monster03 Shape" type="ReferenceRect"]
margin_right = 630.0
margin_bottom = 70.0
script = ExtResource( 3 )
[node name="monster" type="StaticBody2D" parent="."]
position = Vector2( 0, 70 )
collision_layer = 0
collision_mask = 0
[node name="AnimatedSprite" type="AnimatedSprite" parent="monster"]
position = Vector2( 35, -35 )
frames = SubResource( 1 )
animation = "flying"
playing = true
[node name="Collision" type="CollisionShape2D" parent="monster"]
position = Vector2( 35, -35 )
shape = SubResource( 2 )
[node name="Animation" type="AnimationPlayer" parent="monster"]
playback_process_mode = 0
anims/shoot = SubResource( 3 )
[connection signal="animation_finished" from="monster/Animation" to="." method="_on_Animatio_finished"]

View file

@ -108,9 +108,6 @@ func _physics_process(delta):
# Jump # Jump
if Input.is_action_just_pressed("jump"): if Input.is_action_just_pressed("jump"):
if $RayBottomLeft.is_colliding() or $RayBottomRight.is_colliding() or $RayBottomCenter.is_colliding(): if $RayBottomLeft.is_colliding() or $RayBottomRight.is_colliding() or $RayBottomCenter.is_colliding():
print("Left: " + str($RayBottomLeft.is_colliding()))
print("Center: " + str($RayBottomCenter.is_colliding()))
print("Right: " + str($RayBottomRight.is_colliding()))
jump() jump()
func _next_player_state(): func _next_player_state():

115
objects/key/assets/blue.svg Normal file
View file

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="59.800102"
height="36.107059"
viewBox="0 0 15.82211 9.5533261"
version="1.1"
id="svg4151"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="blue.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview4153"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.914906"
inkscape:cx="-178.16038"
inkscape:cy="241.55487"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs4148">
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,148.89724,92.38972)"
id="gradient2">
<stop
offset="0"
stop-color="#73CD4B"
id="stop12" />
<stop
offset="1"
stop-color="#509F2D"
id="stop14" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,123.34536,204.73574)"
id="gradient1">
<stop
offset="0"
stop-color="#E86A17"
id="stop7" />
<stop
offset="1"
stop-color="#C15813"
id="stop9" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,142.14283,156.44071)"
id="gradient3">
<stop
offset="0"
stop-color="#1EA7E1"
id="stop17" />
<stop
offset="1"
stop-color="#1786B5"
id="stop19" />
</linearGradient>
</defs>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-136.39554,-84.583607)">
<g
id="g4543"
transform="translate(6.7542804,-64.050933)">
<path
stroke="none"
fill="#69c5eb"
d="m 129.64126,153.56998 v -0.0132 -0.0265 -0.0265 -0.0265 -0.0661 q 0,-1.85208 0.9525,-3.175 l 0.0265,-0.0397 q 0.35719,-0.48948 0.76729,-0.83344 0.89959,-0.75406 2.06375,-0.7276 h 0.0132 q 1.15094,-0.0265 2.06375,0.7276 0.39688,0.34396 0.75406,0.83344 l 0.0397,0.0529 q 0.56886,0.80698 0.79375,1.79916 h 7.24959 q 0.46302,-0.0132 0.80697,0.42334 0.29105,0.37041 0.29105,0.89958 v 0.0661 l -0.0132,0.18521 q -0.0661,-0.35719 -0.27782,-0.62178 -0.34395,-0.43656 -0.80697,-0.42333 h -7.24959 q -0.22489,-0.99219 -0.79375,-1.79917 l -0.0397,-0.0529 q -0.35718,-0.48948 -0.75406,-0.83344 -0.91281,-0.75406 -2.06375,-0.7276 h -0.0132 q -1.16416,-0.0265 -2.06375,0.7276 -0.4101,0.34396 -0.76729,0.83344 l -0.0265,0.0397 q -0.88635,1.23031 -0.93927,2.91041 l -0.0132,-0.10583 m 2.65907,0.13229 0.0265,0.17198 q 0.0397,0.39687 0.18521,0.7276 l 0.26459,0.47625 0.0265,0.0661 q 0.27782,0.34396 0.64823,0.39687 0.37042,-0.0529 0.64823,-0.39687 l 0.0397,-0.0661 0.2249,-0.38364 0.22489,-0.74084 0.0132,-0.0794 v -0.0661 l 0.0132,-0.0794 v -0.0529 0.21167 0.0265 0.0265 q 0,0.96572 -0.47625,1.66687 l -0.0397,0.0661 q -0.27781,0.34395 -0.64823,0.39687 -0.37041,-0.0529 -0.64823,-0.39687 l -0.0265,-0.0661 q -0.48948,-0.70115 -0.48948,-1.66687 l 0.0132,-0.23813"
id="path1377"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#1ea7e1"
d="m 132.30033,153.70227 -0.0132,0.23813 q 0,0.96572 0.48948,1.66687 l 0.0265,0.0661 q 0.27782,0.34395 0.64823,0.39687 0.37042,-0.0529 0.64823,-0.39687 l 0.0397,-0.0661 q 0.47625,-0.70115 0.47625,-1.66687 v -0.0265 -0.0265 -0.21167 0.0529 -0.3175 -0.0265 -0.0265 q -0.0132,-0.93927 -0.47625,-1.61396 -0.29104,-0.4101 -0.68792,-0.46302 -0.39687,0.0529 -0.68791,0.46302 h 0.0132 q -0.48948,0.68792 -0.48948,1.66688 l 0.0132,0.27781 v 0.0132 m 13.14979,-0.0794 q -0.0529,0.37041 -0.27782,0.66145 v 0.0132 q -0.27781,0.33073 -0.64822,0.38365 v 0.0132 h -4.7625 -2.61938 q -0.23812,1.07156 -0.84667,1.93146 h -0.0132 q -1.15093,1.60073 -2.81781,1.56104 h -0.0132 q -1.6801,0.0397 -2.83104,-1.56104 -0.93927,-1.27 -0.97896,-3.05594 l 0.0132,0.10583 q 0.0529,-1.6801 0.93927,-2.91041 l 0.0265,-0.0397 q 0.35719,-0.48948 0.76729,-0.83344 0.89959,-0.75406 2.06375,-0.7276 h 0.0132 q 1.15094,-0.0265 2.06375,0.7276 0.39688,0.34396 0.75406,0.83344 l 0.0397,0.0529 q 0.56886,0.80698 0.79375,1.79917 h 7.24959 q 0.46302,-0.0132 0.80697,0.42333 0.21167,0.26459 0.27782,0.62178"
id="path1379"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="url(#gradient3)"
d="m 144.52408,154.69446 v 2.69875 q 0,0.79375 -0.79375,0.79375 h -0.59532 q -0.10583,0 -0.18521,-0.0794 -0.0794,-0.0794 -0.0794,-0.18521 v -0.39687 h -1.45521 v 0.39687 l -0.0794,0.18521 -0.18521,0.0794 h -0.59531 q -0.79375,0 -0.79375,-0.79375 v -2.69875 h 4.7625"
id="path1381"
style="fill:url(#gradient3);stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/blue.svg-657a662c90e1984b91b07f0ce2798bca.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/key/assets/blue.svg"
dest_files=[ "res://.import/blue.svg-657a662c90e1984b91b07f0ce2798bca.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="59.800102"
height="36.107059"
viewBox="0 0 15.82211 9.5533261"
version="1.1"
id="svg4151"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="green.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview4153"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.914906"
inkscape:cx="-178.16038"
inkscape:cy="241.55487"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs4148">
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,148.89724,92.38972)"
id="gradient2">
<stop
offset="0"
stop-color="#73CD4B"
id="stop12" />
<stop
offset="1"
stop-color="#509F2D"
id="stop14" />
</linearGradient>
</defs>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-136.39554,-84.583607)">
<g
id="g4305">
<path
stroke="none"
fill="#73cd4b"
d="m 136.39567,89.518991 0.0132,0.105833 q 0.0529,-1.680104 0.93927,-2.910416 l 0.0265,-0.03969 q 0.35719,-0.489479 0.76729,-0.833437 0.89959,-0.754063 2.06375,-0.727604 h 0.0132 q 1.15094,-0.02646 2.06375,0.727604 0.39688,0.343958 0.75406,0.833437 l 0.0397,0.05292 q 0.56886,0.806979 0.79375,1.799167 h 7.24959 q 0.46302,-0.01323 0.80697,0.423333 0.21167,0.264583 0.27782,0.621771 -0.0529,0.370416 -0.27782,0.661458 v 0.01323 q -0.27781,0.330729 -0.64822,0.383646 v 0.01323 h -4.7625 -2.61938 q -0.23812,1.071563 -0.84667,1.931459 h -0.0132 q -1.15093,1.600729 -2.81781,1.561041 h -0.0132 q -1.6801,0.03969 -2.83104,-1.561041 -0.93927,-1.27 -0.97896,-3.055938 m 4.97417,0.15875 v -0.3175 -0.02646 -0.02646 q -0.0132,-0.939271 -0.47625,-1.613959 -0.29104,-0.410104 -0.68792,-0.463021 -0.39687,0.05292 -0.68791,0.463021 h 0.0132 q -0.48948,0.687917 -0.48948,1.666875 l 0.0132,0.277813 v 0.01323 l -0.0132,0.238125 q 0,0.965729 0.48948,1.666875 l 0.0265,0.06615 q 0.27782,0.343958 0.64823,0.396875 0.37042,-0.05292 0.64823,-0.396875 l 0.0397,-0.06615 q 0.47625,-0.701146 0.47625,-1.666875 v -0.02646 -0.02646 -0.211667 0.05292"
id="path1371"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#b1e39b"
d="m 141.36984,89.677741 v -0.05292 0.211667 0.02646 0.02646 q 0,0.965729 -0.47625,1.666875 l -0.0397,0.06615 q -0.27781,0.343958 -0.64823,0.396875 -0.37041,-0.05292 -0.64823,-0.396875 l -0.0265,-0.06615 q -0.48948,-0.701146 -0.48948,-1.666875 l 0.0132,-0.238125 0.0264,0.171979 q 0.0397,0.396875 0.18521,0.727604 l 0.26459,0.47625 0.0265,0.06615 q 0.27782,0.343958 0.64823,0.396875 0.37042,-0.05292 0.64823,-0.396875 l 0.0397,-0.06615 0.2249,-0.383646 0.22489,-0.740833 0.0132,-0.07937 v -0.06615 l 0.0132,-0.07937 m 10.83469,-0.105833 q -0.0661,-0.357188 -0.27782,-0.621771 -0.34395,-0.436562 -0.80697,-0.423333 h -7.24959 q -0.22489,-0.992188 -0.79375,-1.799167 l -0.0397,-0.05292 q -0.35718,-0.489479 -0.75406,-0.833437 -0.91281,-0.754063 -2.06375,-0.727604 h -0.0132 q -1.16416,-0.02646 -2.06375,0.727604 -0.4101,0.343958 -0.76729,0.833437 l -0.0265,0.03969 q -0.88635,1.230312 -0.93927,2.910416 l -0.0132,-0.105833 v -0.01323 -0.02646 -0.02646 -0.02646 -0.06615 q 0,-1.852083 0.9525,-3.175 l 0.0265,-0.03969 q 0.35719,-0.489479 0.76729,-0.833438 0.89959,-0.754062 2.06375,-0.727604 h 0.0132 q 1.15094,-0.02646 2.06375,0.727604 0.39688,0.343959 0.75406,0.833438 l 0.0397,0.05292 q 0.56886,0.80698 0.79375,1.799167 h 7.24959 q 0.46302,-0.01323 0.80697,0.423333 0.29105,0.370417 0.29105,0.899584 v 0.06614 l -0.0132,0.185209"
id="path1373"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="url(#gradient2)"
d="m 146.51599,90.64347 h 4.7625 v 2.69875 q 0,0.79375 -0.79375,0.79375 h -0.59532 q -0.10583,0 -0.18521,-0.07937 -0.0794,-0.07937 -0.0794,-0.185208 v -0.396875 h -1.45521 v 0.396875 l -0.0794,0.185208 -0.18521,0.07937 h -0.59531 q -0.79375,0 -0.79375,-0.79375 v -2.69875"
id="path1375"
style="fill:url(#gradient2);stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/green.svg-d87e4559b2bc73f58b43fd1e23918fe6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/key/assets/green.svg"
dest_files=[ "res://.import/green.svg-d87e4559b2bc73f58b43fd1e23918fe6.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="59.800102"
height="36.107059"
viewBox="0 0 15.82211 9.5533261"
version="1.1"
id="svg4151"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="red.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview4153"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.914906"
inkscape:cx="-178.16038"
inkscape:cy="241.55487"
inkscape:window-width="3440"
inkscape:window-height="1367"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs4148">
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,148.89724,92.38972)"
id="gradient2">
<stop
offset="0"
stop-color="#73CD4B"
id="stop12" />
<stop
offset="1"
stop-color="#509F2D"
id="stop14" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
x1="-819.20001"
x2="819.20001"
spreadMethod="pad"
gradientTransform="matrix(0,-0.00226084,0.00213165,0,123.34536,204.73574)"
id="gradient1">
<stop
offset="0"
stop-color="#E86A17"
id="stop7" />
<stop
offset="1"
stop-color="#C15813"
id="stop9" />
</linearGradient>
</defs>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-136.39554,-84.583607)">
<g
id="g4411"
transform="translate(25.55184,-112.34586)">
<path
stroke="none"
fill="#ef975c"
d="m 110.8438,201.86501 v -0.0132 -0.0265 -0.0265 -0.0265 -0.0662 q 0,-1.85208 0.9525,-3.175 l 0.0264,-0.0397 q 0.35719,-0.48948 0.7673,-0.83343 0.89958,-0.75407 2.06375,-0.72761 h 0.0132 q 1.15093,-0.0265 2.06375,0.72761 0.39687,0.34395 0.75406,0.83343 l 0.0397,0.0529 q 0.56885,0.80698 0.79375,1.79917 h 7.24958 q 0.46302,-0.0132 0.80698,0.42333 0.29104,0.37042 0.29104,0.89958 v 0.0661 l -0.0132,0.18521 q -0.0661,-0.35719 -0.27781,-0.62177 -0.34396,-0.43657 -0.80698,-0.42334 h -7.24958 q -0.2249,-0.99218 -0.79375,-1.79916 l -0.0397,-0.0529 q -0.35719,-0.48948 -0.75406,-0.83344 -0.91282,-0.75406 -2.06375,-0.7276 h -0.0132 q -1.16417,-0.0265 -2.06375,0.7276 -0.41011,0.34396 -0.7673,0.83344 l -0.0264,0.0397 q -0.88636,1.23031 -0.93927,2.91041 l -0.0132,-0.10583 m 2.65906,0.13229 0.0265,0.17198 q 0.0397,0.39688 0.18521,0.72761 l 0.26458,0.47625 0.0265,0.0661 q 0.27781,0.34396 0.64823,0.39688 0.37041,-0.0529 0.64823,-0.39688 l 0.0397,-0.0661 0.2249,-0.38365 0.22489,-0.74083 0.0132,-0.0794 v -0.0661 l 0.0132,-0.0794 v -0.0529 0.21167 0.0265 0.0265 q 0,0.96573 -0.47625,1.66687 l -0.0397,0.0661 q -0.27782,0.34396 -0.64823,0.39687 -0.37042,-0.0529 -0.64823,-0.39687 l -0.0265,-0.0661 q -0.48948,-0.70114 -0.48948,-1.66687 l 0.0132,-0.23813"
id="path1365"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="#e86a17"
d="m 113.50286,201.9973 -0.0132,0.23813 q 0,0.96573 0.48948,1.66687 l 0.0265,0.0661 q 0.27781,0.34396 0.64823,0.39687 0.37041,-0.0529 0.64823,-0.39687 l 0.0397,-0.0661 q 0.47625,-0.70114 0.47625,-1.66687 v -0.0265 -0.0265 -0.21167 0.0529 -0.3175 -0.0265 -0.0265 q -0.0132,-0.93927 -0.47625,-1.61395 -0.29104,-0.41011 -0.68791,-0.46302 -0.39688,0.0529 -0.68792,0.46302 h 0.0132 q -0.48948,0.68791 -0.48948,1.66687 l 0.0132,0.27781 v 0.0132 m 13.14979,-0.0794 q -0.0529,0.37041 -0.27781,0.66146 v 0.0132 q -0.27781,0.33072 -0.64823,0.38364 v 0.0132 h -4.7625 -2.61938 q -0.23812,1.07156 -0.84666,1.93146 h -0.0132 q -1.15094,1.60073 -2.81781,1.56104 h -0.0132 q -1.68011,0.0397 -2.83105,-1.56104 -0.93927,-1.27 -0.97895,-3.05594 l 0.0132,0.10583 q 0.0529,-1.6801 0.93927,-2.91041 l 0.0264,-0.0397 q 0.35719,-0.48948 0.7673,-0.83344 0.89958,-0.75406 2.06375,-0.7276 h 0.0132 q 1.15093,-0.0265 2.06375,0.7276 0.39687,0.34396 0.75406,0.83344 l 0.0397,0.0529 q 0.56885,0.80698 0.79375,1.79916 h 7.24958 q 0.46302,-0.0132 0.80698,0.42334 0.21166,0.26458 0.27781,0.62177"
id="path1367"
style="stroke-width:0.264583" />
<path
stroke="none"
fill="url(#gradient1)"
d="m 125.72661,202.98949 v 2.69875 q 0,0.79375 -0.79375,0.79375 h -0.59531 l -0.18521,-0.0794 q -0.0794,-0.0794 -0.0794,-0.18521 v -0.39688 h -1.45521 v 0.39688 l -0.0794,0.18521 -0.18521,0.0794 h -0.59531 q -0.79375,0 -0.79375,-0.79375 v -2.69875 h 4.7625"
id="path1369"
style="fill:url(#gradient1);stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/red.svg-5e0d9927135ee14e7c4d20a1d0350a1a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://objects/key/assets/red.svg"
dest_files=[ "res://.import/red.svg-5e0d9927135ee14e7c4d20a1d0350a1a.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=true
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -1,11 +1,20 @@
extends StaticBody2D extends StaticBody2D
enum KEY_COLOR{
yellow,
red,
green,
blue
}
export(KEY_COLOR) var key_color = "yellow"
func _ready(): func _ready():
$Sprite.texture = load("res://objects/key/assets/" + str(KEY_COLOR.keys()[key_color]) + ".svg")
$Sprite/AnimationPlayer.play("default") $Sprite/AnimationPlayer.play("default")
func _on_PlayerCollision(body): func _on_PlayerCollision(body):
if visible: if visible:
GlobalState.keys['yellow'] = true GlobalState.keys[str(KEY_COLOR.keys()[key_color])] = true
$SoundCollected.play() $SoundCollected.play()
hide() hide()

File diff suppressed because one or more lines are too long

View file

@ -19,6 +19,7 @@ func load_level(next_scene := level_path, fade_out : bool = false):
current_level.queue_free() current_level.queue_free()
remove_child(current_level) remove_child(current_level)
current_level = load(next_scene).instance() current_level = load(next_scene).instance()
GlobalState.player = current_level.get_node("Player")
level_path = next_scene level_path = next_scene
$HUD.hud_visible(current_level.hud_visible) $HUD.hud_visible(current_level.hud_visible)
$HUD.set_font_color(current_level.hud_color) $HUD.set_font_color(current_level.hud_color)