diff --git a/Sound Effects/Hit Wall.wav b/Sound Effects/Hit Wall.wav new file mode 100644 index 0000000..27603c0 Binary files /dev/null and b/Sound Effects/Hit Wall.wav differ diff --git a/Sound Effects/Hit Wall.wav.import b/Sound Effects/Hit Wall.wav.import index e85757e..7f84c3f 100644 --- a/Sound Effects/Hit Wall.wav.import +++ b/Sound Effects/Hit Wall.wav.import @@ -17,5 +17,5 @@ force/max_rate=false force/max_rate_hz=44100 edit/trim=false edit/normalize=false -edit/loop=true +edit/loop=false compress/mode=0 diff --git a/Sound Effects/Hit.wav b/Sound Effects/Hit.wav index 15857dc..3380c20 100644 Binary files a/Sound Effects/Hit.wav and b/Sound Effects/Hit.wav differ diff --git a/Sound Effects/Hit.wav.import b/Sound Effects/Hit.wav.import index 3b96089..095990d 100644 --- a/Sound Effects/Hit.wav.import +++ b/Sound Effects/Hit.wav.import @@ -17,5 +17,5 @@ force/max_rate=false force/max_rate_hz=44100 edit/trim=false edit/normalize=false -edit/loop=true +edit/loop=false compress/mode=0 diff --git a/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg b/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg deleted file mode 100644 index ce95719..0000000 Binary files a/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg and /dev/null differ diff --git a/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg.import b/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg.import deleted file mode 100644 index 83c6c09..0000000 --- a/Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg-cdec0b7f82f2b8c50604c5b31f7e0660.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://Sound Effects/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg" -dest_files=[ "res://.import/interface-bit-game-pixel-art-platformer-mobile-desktop-version-appearance-level-dark-dungeon-brick-walls-torches-126375076.jpg-cdec0b7f82f2b8c50604c5b31f7e0660.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/ai/BadFireball.tscn b/ai/BadFireball.tscn new file mode 100644 index 0000000..ba49fbf --- /dev/null +++ b/ai/BadFireball.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://ai/Hell Projectile.gd" type="Script" id=1] +[ext_resource path="res://art/Bad Fireball.png" type="Texture" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "Fireeball" +length = 0.2 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Bad Fireball: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 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ 1, 0 ] +} + +[sub_resource type="CircleShape2D" id=2] +radius = 4.54199 + +[node name="KinematicBody2D" type="KinematicBody2D"] +collision_layer = 8 +collision_mask = 3 +script = ExtResource( 1 ) + +[node name="BadFireball" type="Sprite" parent="."] +texture = ExtResource( 2 ) +hframes = 2 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="BadFireball"] +autoplay = "Fireeball" +anims/Fireeball = SubResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 2 ) diff --git a/ai/Enemy.gd b/ai/Enemy.gd new file mode 100644 index 0000000..7f8f6f5 --- /dev/null +++ b/ai/Enemy.gd @@ -0,0 +1,36 @@ +extends KinematicBody2D + +class_name Enemy + +var speed = 60 +var gravity =500 +var health = 5 +const UP = Vector2(0, -1) + +var velocity = Vector2() + +func apply_gravity(delta, modifier = 1): + velocity.y += gravity * delta * modifier + +func _physics_process(_delta): + if Globals.player != null: + if $RayCast2D.get_collider() != null && $RayCast2D.get_collider().has_method("get_type") and $RayCast2D.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + elif $RayCast2D2.get_collider() != null && $RayCast2D2.get_collider().has_method("get_type") and $RayCast2D2.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + elif $RayCast2D3.get_collider() != null && $RayCast2D3.get_collider().has_method("get_type") and $RayCast2D3.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + elif $RayCast2D4.get_collider() != null && $RayCast2D4.get_collider().has_method("get_type") and $RayCast2D4.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + else: + velocity.x = position.direction_to(Globals.player).normalized().x + apply_gravity(_delta) + velocity.x *= speed + velocity = move_and_slide(velocity, UP) + if velocity.x > 0: + # $(Enemy Sprite).flip_h = false + elif velocity.x < 0: + # $(Enemy Sprite).flip_h = true + + if is_on_wall() and is_on_floor(): + velocity.y = -150 diff --git a/ai/Hell Projectile.gd b/ai/Hell Projectile.gd new file mode 100644 index 0000000..a1ebcfa --- /dev/null +++ b/ai/Hell Projectile.gd @@ -0,0 +1,14 @@ +extends Projectile + +func launch_right(): + velocity = (Vector2.RIGHT * speed) +func launch_left(): + velocity = (Vector2.LEFT * speed) +func launch_upleft(): + velocity = (Vector2(-1, -1).normalized() * speed) +func launch_upright(): + velocity = (Vector2(1, -1).normalized() * speed) +func on_impact(collision): + if collision.collider.has_method("get_type"): + collision.collider.set_health(collision.collider.get_health() - 1) + queue_free() diff --git a/ai/Hell.gd b/ai/Hell.gd new file mode 100644 index 0000000..b29ac01 --- /dev/null +++ b/ai/Hell.gd @@ -0,0 +1,67 @@ +extends KinematicBody2D + +var Hell_Projectile = preload("res://ai/BadFireball.tscn") +var speed = 60 +var gravity =500 +var health = 5 +const UP = Vector2(0, -1) + + +onready var ShootDelay : Timer = $ShootDelay +onready var ProjectileSpawn: Node2D = $Position2D + +var velocity = Vector2() + +func apply_gravity(delta, modifier = 1): + velocity.y += gravity * delta * modifier + +func _physics_process(_delta): + if Globals.player != null: + if $RayCast2D.get_collider() != null && $RayCast2D.get_collider().has_method("get_type") and $RayCast2D.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + if ShootDelay.is_stopped(): + var temp = Hell_Projectile.instance() + get_tree().current_scene.add_child(temp) + temp.global_position = ProjectileSpawn.global_position + temp.launch_left() + ShootDelay.start() + queue_free() + elif $RayCast2D2.get_collider() != null && $RayCast2D2.get_collider().has_method("get_type") and $RayCast2D2.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + if ShootDelay.is_stopped(): + var temp = Hell_Projectile.instance() + get_tree().current_scene.add_child(temp) + temp.global_position = ProjectileSpawn.global_position + temp.launch_right() + ShootDelay.start() + queue_free() + elif $RayCast2D3.get_collider() != null && $RayCast2D3.get_collider().has_method("get_type") and $RayCast2D3.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + if ShootDelay.is_stopped(): + var temp = Hell_Projectile.instance() + get_tree().current_scene.add_child(temp) + temp.global_position = ProjectileSpawn.global_position + temp.launch_upleft() + ShootDelay.start() + queue_free() + elif $RayCast2D4.get_collider() != null && $RayCast2D4.get_collider().has_method("get_type") and $RayCast2D4.get_collider().get_type() == "player": + velocity = Vector2(0, 0) + if ShootDelay.is_stopped(): + var temp = Hell_Projectile.instance() + get_tree().current_scene.add_child(temp) + temp.global_position = ProjectileSpawn.global_position + temp.launch_upright() + ShootDelay.start() + queue_free() + else: + velocity.x = position.direction_to(Globals.player).normalized().x + apply_gravity(_delta) + velocity.x *= speed + velocity = move_and_slide(velocity, UP) + if velocity.x > 0: + $Hell.flip_h = false + elif velocity.x < 0: + $Hell.flip_h = true + + if is_on_wall() and is_on_floor(): + velocity.y = -150 diff --git a/ai/Hell.tscn b/ai/Hell.tscn new file mode 100644 index 0000000..11dc643 --- /dev/null +++ b/ai/Hell.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://art/Hell Dude.png" type="Texture" id=1] +[ext_resource path="res://ai/Hell.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 5.06709, 5.78183 ) + +[sub_resource type="Animation" id=1] +resource_name = "Devil" +length = 0.6 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Hell: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, 7 ] +} + +[node name="KinematicBody2D" type="KinematicBody2D"] +collision_layer = 4 +collision_mask = 3 +script = ExtResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 0, 1.87833 ) +shape = SubResource( 2 ) + +[node name="RayCast2D" type="RayCast2D" parent="."] +position = Vector2( 0, 1.87833 ) +enabled = true +cast_to = Vector2( -80, 0 ) +collision_mask = 3 + +[node name="RayCast2D2" type="RayCast2D" parent="."] +position = Vector2( 0, 1.87833 ) +enabled = true +cast_to = Vector2( 80, 0 ) +collision_mask = 3 + +[node name="RayCast2D3" type="RayCast2D" parent="."] +position = Vector2( 0, 1.87833 ) +enabled = true +cast_to = Vector2( 80, -25 ) +collision_mask = 3 + +[node name="RayCast2D4" type="RayCast2D" parent="."] +position = Vector2( 0, 1.87833 ) +enabled = true +cast_to = Vector2( -80, -25 ) +collision_mask = 3 + +[node name="Hell" type="Sprite" parent="."] +position = Vector2( -7.56425, -7.87261 ) +texture = ExtResource( 1 ) +centered = false +hframes = 8 +frame = 4 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "Devil" +anims/Devil = SubResource( 1 ) + +[node name="ShootDelay" type="Timer" parent="."] +wait_time = 1.239 + +[node name="Position2D" type="Position2D" parent="."] diff --git a/ai/SpinningBone.tscn b/ai/SpinningBone.tscn index 92e6d8a..30a92ac 100644 --- a/ai/SpinningBone.tscn +++ b/ai/SpinningBone.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://art/SpinningBone.png" type="Texture" id=1] [ext_resource path="res://ai/SpinningBone.gd" type="Script" id=2] -[ext_resource path="res://Sound Effects/Hit.wav" type="AudioStream" id=3] -[ext_resource path="res://Sound Effects/Hit Wall.wav" type="AudioStream" id=4] [sub_resource type="Animation" id=1] resource_name = "Bone Throw" @@ -46,13 +44,3 @@ autoplay = "Bone Throw" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 2 ) - -[node name="Node" type="Node" parent="."] - -[node name="Hit Wall" type="AudioStreamPlayer" parent="Node"] -stream = ExtResource( 3 ) -pitch_scale = 0.77 - -[node name="Hit" type="AudioStreamPlayer" parent="Node"] -stream = ExtResource( 4 ) -pitch_scale = 0.54 diff --git a/art/Bad Fireball.png b/art/Bad Fireball.png new file mode 100644 index 0000000..8485255 Binary files /dev/null and b/art/Bad Fireball.png differ diff --git a/art/Bad Fireball.png.import b/art/Bad Fireball.png.import new file mode 100644 index 0000000..62a7e76 --- /dev/null +++ b/art/Bad Fireball.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Bad Fireball.png-b8d2f205bab3eba50d8e3057a8d2bbfa.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/Bad Fireball.png" +dest_files=[ "res://.import/Bad Fireball.png-b8d2f205bab3eba50d8e3057a8d2bbfa.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/art/Hell Dude.png b/art/Hell Dude.png new file mode 100644 index 0000000..c72026e Binary files /dev/null and b/art/Hell Dude.png differ diff --git a/art/Hell Dude.png.import b/art/Hell Dude.png.import new file mode 100644 index 0000000..89f67b4 --- /dev/null +++ b/art/Hell Dude.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hell Dude.png-3a79ccc71e7c6c23716b1e57c1bce4c9.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/Hell Dude.png" +dest_files=[ "res://.import/Hell Dude.png-3a79ccc71e7c6c23716b1e57c1bce4c9.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/levels/World.tscn b/levels/World.tscn index a7386f3..d0b271e 100644 --- a/levels/World.tscn +++ b/levels/World.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://meta/DungeonTilemap.tscn" type="PackedScene" id=1] [ext_resource path="res://characters/Player.tscn" type="PackedScene" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://Music and Fonts(Misc.)/Keb3q1.png" type="Texture" id=6] [ext_resource path="res://art/Pedestal.png" type="Texture" id=7] [ext_resource path="res://ai/Skeleton Enemy.tscn" type="PackedScene" id=8] +[ext_resource path="res://ai/Hell.tscn" type="PackedScene" id=9] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 169.977, 24.8286 ) @@ -148,9 +149,6 @@ __meta__ = { "_edit_group_": true } -[node name="Skeleton Enemy" parent="." instance=ExtResource( 8 )] -position = Vector2( 371.515, 139.784 ) - [node name="Player" parent="." instance=ExtResource( 2 )] position = Vector2( -38.2158, 143.114 ) @@ -253,4 +251,10 @@ __meta__ = { [node name="AnimationPlayer2" type="AnimationPlayer" parent="text/Text3"] autoplay = "Type Writer" "anims/Type Writer" = SubResource( 8 ) + +[node name="Hell" parent="." instance=ExtResource( 9 )] +position = Vector2( 280.961, 130.283 ) + +[node name="Skeleton Enemy" parent="." instance=ExtResource( 8 )] +position = Vector2( 417.222, 131.88 ) [connection signal="body_entered" from="Area2D" to="text/Text2" method="_on_body_entered"] diff --git a/project.godot b/project.godot index 960899e..2c082df 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,11 @@ _global_script_classes=[ { "path": "res://script/ItemPickup.gd" }, { "base": "KinematicBody2D", +"class": "Enemy", +"language": "GDScript", +"path": "res://ai/Enemy.gd" +}, { +"base": "KinematicBody2D", "class": "Projectile", "language": "GDScript", "path": "res://script/Projectile.gd" @@ -31,6 +36,7 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "Collectable": "", +"Enemy": "", "Projectile": "", "StateMachine": "", "Wand": "" diff --git a/script/Projectile.gd b/script/Projectile.gd index 2b3fc13..aeeecc2 100644 --- a/script/Projectile.gd +++ b/script/Projectile.gd @@ -3,6 +3,8 @@ class_name Projectile export var speed = 300 var velocity = Vector2.ZERO +onready var Hit = get_node("Node/Hit") +onready var Hit_Wall = get_node("Node/Hit Wall") func _physics_process(delta): var collision = move_and_collide(velocity * delta)