Level 3 Polished

This commit is contained in:
Logan 2020-07-23 14:43:42 -05:00
parent 690f174ed3
commit 5307c54d10
16 changed files with 183 additions and 185 deletions

View file

@ -5,7 +5,7 @@ resource_name = "Hit"
length = 0.1
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("../Ogre/Skeleton Enemy3:modulate")
tracks/0/path = NodePath("Sprite:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false

View file

@ -5,7 +5,7 @@ resource_name = "Run"
length = 0.35
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("../Ogre/Skeleton Enemy3:frame")
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false

View file

@ -26,7 +26,7 @@ tracks/0/keys = {
[node name="Demon" type="KinematicBody2D"]
collision_layer = 4
collision_mask = 15
collision_mask = 7
script = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View file

@ -26,7 +26,7 @@ tracks/0/keys = {
[node name="Skeleton Enemy" type="KinematicBody2D"]
collision_layer = 4
collision_mask = 15
collision_mask = 7
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View file

@ -5,8 +5,8 @@
[ext_resource path="res://Music and Fonts(Misc.)/Ogre Hit.tres" type="Animation" id=3]
[ext_resource path="res://Music and Fonts(Misc.)/Ogre Run.tres" type="Animation" id=4]
[sub_resource type="CapsuleShape2D" id=1]
height = 4.0
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 10, 11 )
[sub_resource type="CapsuleShape2D" id=2]
radius = 12.0
@ -14,19 +14,18 @@ height = 6.0
[node name="Ogre" type="KinematicBody2D"]
collision_layer = 4
collision_mask = 2147483663
collision_mask = 2147483655
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -17 )
texture = ExtResource( 2 )
hframes = 4
frame = 3
frame = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 1, -12 )
shape = SubResource( 1 )
position = Vector2( 1, -11 )
shape = SubResource( 3 )
[node name="DamageCD" type="Timer" parent="."]
wait_time = 0.5

View file

@ -23,7 +23,7 @@ func _physics_process(_delta):
PlayerRaycast.cast_to = player_position - global_position
var collider = PlayerRaycast.get_collider()
if dist <= 200:
if dist >= 200:
if collider != null && collider.has_method("get_type") && collider.get_type() == "player":
shoot_fireball(position.direction_to(player_position))

View file

@ -1,12 +1,14 @@
extends Enemy
var contact_damage = 0.5
export var stationary: bool = false
onready var Spr = $Sprite
onready var DamageCD = $DamageCD
onready var Hurtbox = $Area2D
func _ready():
gravity = 100
speed = 50
health = 5
@ -19,18 +21,23 @@ func _physics_process(delta):
return
var player = Player.position
var distance = global_position.distance_to(player)
if distance <= 200:
if distance <= 200 and is_on_floor():
if player.x > global_position.x:
Spr.flip_h = false
velocity.x = speed
elif player.x < global_position.x:
Spr.flip_h = true
velocity.x = -speed
if stationary:
velocity.x = 0
if health <= 0:
queue_free()
if not is_on_floor():
velocity.y = 50
velocity = move_and_slide(velocity)
velocity.y = gravity
if is_on_floor() and is_on_wall():
velocity.y = -100
print("jump")
velocity = move_and_slide(velocity, Vector2.UP)
deal_damage()
func deal_damage():

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
extends TileMap
func _on_Lever_on():
queue_free()

File diff suppressed because one or more lines are too long

View file

@ -3,4 +3,5 @@ extends TileMap
func _on_Lever_on():
queue_free()
collision_layer = 2
visible = true

View file

@ -29,7 +29,7 @@ collision_mask = 2
[node name="Area2D" type="Area2D" parent="."]
monitorable = false
collision_layer = 0
collision_mask = 4
collision_mask = 2147483652
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
modulate = Color( 0.945313, 1, 0, 1 )

View file

@ -12,4 +12,5 @@ func _on_body_entered(body):
if body.get("health") != null:
body.play_hit()
body.health -= damage * damage_mod

View file

@ -12,7 +12,7 @@ radius = 4.0
height = 7.99999
[node name="PhantomProjectile" type="KinematicBody2D"]
collision_layer = 8
collision_layer = 2147483648
collision_mask = 2
script = ExtResource( 2 )
@ -27,7 +27,7 @@ shape = SubResource( 1 )
[node name="Area2D" type="Area2D" parent="."]
monitorable = false
collision_layer = 0
collision_mask = 4
collision_mask = 2147483652
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
rotation = 1.5708

View file

@ -25,7 +25,7 @@ func get_wand_type(wand_id):
Globals.Conduit2:
is_triple = true
print("triple")
var damage_mod = 0.75
var damage_mod = 0.5
Globals.Conduit3:
is_bounce = true
print("bounce")
@ -48,6 +48,7 @@ func launch(wand, mod = 1):
return energy_cost * energy_mod
func on_impact(collision):
print(collision.collider)
if collision.collider.has_method("get_type") && collision.collider.get_type() == "enemy":
var c = collision.collider
c.health -= damage * damage_mod

View file

@ -42,6 +42,9 @@ func fire(projectile):
return beam.energy_cost
func _input(event):
if Player.energy <= 0:
for c in $ProjectileSpawn.get_children():
c.deactivate()
if event.is_action_released("shoot"):
for c in $ProjectileSpawn.get_children():
c.deactivate()