Level 3 Polished
This commit is contained in:
parent
690f174ed3
commit
5307c54d10
|
@ -5,7 +5,7 @@ resource_name = "Hit"
|
||||||
length = 0.1
|
length = 0.1
|
||||||
step = 0.05
|
step = 0.05
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("../Ogre/Skeleton Enemy3:modulate")
|
tracks/0/path = NodePath("Sprite:modulate")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
|
|
|
@ -5,7 +5,7 @@ resource_name = "Run"
|
||||||
length = 0.35
|
length = 0.35
|
||||||
loop = true
|
loop = true
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("../Ogre/Skeleton Enemy3:frame")
|
tracks/0/path = NodePath("Sprite:frame")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
|
|
|
@ -26,7 +26,7 @@ tracks/0/keys = {
|
||||||
|
|
||||||
[node name="Demon" type="KinematicBody2D"]
|
[node name="Demon" type="KinematicBody2D"]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 15
|
collision_mask = 7
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
@ -26,7 +26,7 @@ tracks/0/keys = {
|
||||||
|
|
||||||
[node name="Skeleton Enemy" type="KinematicBody2D"]
|
[node name="Skeleton Enemy" type="KinematicBody2D"]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 15
|
collision_mask = 7
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
@ -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 Hit.tres" type="Animation" id=3]
|
||||||
[ext_resource path="res://Music and Fonts(Misc.)/Ogre Run.tres" type="Animation" id=4]
|
[ext_resource path="res://Music and Fonts(Misc.)/Ogre Run.tres" type="Animation" id=4]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=3]
|
||||||
height = 4.0
|
extents = Vector2( 10, 11 )
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=2]
|
[sub_resource type="CapsuleShape2D" id=2]
|
||||||
radius = 12.0
|
radius = 12.0
|
||||||
|
@ -14,19 +14,18 @@ height = 6.0
|
||||||
|
|
||||||
[node name="Ogre" type="KinematicBody2D"]
|
[node name="Ogre" type="KinematicBody2D"]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 2147483663
|
collision_mask = 2147483655
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite" parent="."]
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
position = Vector2( 0, -17 )
|
position = Vector2( 0, -17 )
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
hframes = 4
|
hframes = 4
|
||||||
frame = 3
|
frame = 2
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
visible = false
|
position = Vector2( 1, -11 )
|
||||||
position = Vector2( 1, -12 )
|
shape = SubResource( 3 )
|
||||||
shape = SubResource( 1 )
|
|
||||||
|
|
||||||
[node name="DamageCD" type="Timer" parent="."]
|
[node name="DamageCD" type="Timer" parent="."]
|
||||||
wait_time = 0.5
|
wait_time = 0.5
|
||||||
|
|
|
@ -23,7 +23,7 @@ func _physics_process(_delta):
|
||||||
PlayerRaycast.cast_to = player_position - global_position
|
PlayerRaycast.cast_to = player_position - global_position
|
||||||
var collider = PlayerRaycast.get_collider()
|
var collider = PlayerRaycast.get_collider()
|
||||||
|
|
||||||
if dist <= 200:
|
if dist >= 200:
|
||||||
if collider != null && collider.has_method("get_type") && collider.get_type() == "player":
|
if collider != null && collider.has_method("get_type") && collider.get_type() == "player":
|
||||||
shoot_fireball(position.direction_to(player_position))
|
shoot_fireball(position.direction_to(player_position))
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
extends Enemy
|
extends Enemy
|
||||||
|
|
||||||
var contact_damage = 0.5
|
var contact_damage = 0.5
|
||||||
|
export var stationary: bool = false
|
||||||
|
|
||||||
onready var Spr = $Sprite
|
onready var Spr = $Sprite
|
||||||
onready var DamageCD = $DamageCD
|
onready var DamageCD = $DamageCD
|
||||||
onready var Hurtbox = $Area2D
|
onready var Hurtbox = $Area2D
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
gravity = 100
|
||||||
speed = 50
|
speed = 50
|
||||||
health = 5
|
health = 5
|
||||||
|
|
||||||
|
@ -19,18 +21,23 @@ func _physics_process(delta):
|
||||||
return
|
return
|
||||||
var player = Player.position
|
var player = Player.position
|
||||||
var distance = global_position.distance_to(player)
|
var distance = global_position.distance_to(player)
|
||||||
if distance <= 200:
|
if distance <= 200 and is_on_floor():
|
||||||
if player.x > global_position.x:
|
if player.x > global_position.x:
|
||||||
Spr.flip_h = false
|
Spr.flip_h = false
|
||||||
velocity.x = speed
|
velocity.x = speed
|
||||||
elif player.x < global_position.x:
|
elif player.x < global_position.x:
|
||||||
Spr.flip_h = true
|
Spr.flip_h = true
|
||||||
velocity.x = -speed
|
velocity.x = -speed
|
||||||
|
if stationary:
|
||||||
|
velocity.x = 0
|
||||||
if health <= 0:
|
if health <= 0:
|
||||||
queue_free()
|
queue_free()
|
||||||
if not is_on_floor():
|
if not is_on_floor():
|
||||||
velocity.y = 50
|
velocity.y = gravity
|
||||||
velocity = move_and_slide(velocity)
|
if is_on_floor() and is_on_wall():
|
||||||
|
velocity.y = -100
|
||||||
|
print("jump")
|
||||||
|
velocity = move_and_slide(velocity, Vector2.UP)
|
||||||
deal_damage()
|
deal_damage()
|
||||||
|
|
||||||
func deal_damage():
|
func deal_damage():
|
||||||
|
|
File diff suppressed because one or more lines are too long
4
levels/Campaign/Level 3/DisappearingTiles.gd
Normal file
4
levels/Campaign/Level 3/DisappearingTiles.gd
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
extends TileMap
|
||||||
|
|
||||||
|
func _on_Lever_on():
|
||||||
|
queue_free()
|
File diff suppressed because one or more lines are too long
|
@ -3,4 +3,5 @@ extends TileMap
|
||||||
|
|
||||||
|
|
||||||
func _on_Lever_on():
|
func _on_Lever_on():
|
||||||
queue_free()
|
collision_layer = 2
|
||||||
|
visible = true
|
||||||
|
|
|
@ -29,7 +29,7 @@ collision_mask = 2
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
monitorable = false
|
monitorable = false
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 4
|
collision_mask = 2147483652
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
modulate = Color( 0.945313, 1, 0, 1 )
|
modulate = Color( 0.945313, 1, 0, 1 )
|
||||||
|
|
|
@ -12,4 +12,5 @@ func _on_body_entered(body):
|
||||||
if body.get("health") != null:
|
if body.get("health") != null:
|
||||||
body.play_hit()
|
body.play_hit()
|
||||||
body.health -= damage * damage_mod
|
body.health -= damage * damage_mod
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ radius = 4.0
|
||||||
height = 7.99999
|
height = 7.99999
|
||||||
|
|
||||||
[node name="PhantomProjectile" type="KinematicBody2D"]
|
[node name="PhantomProjectile" type="KinematicBody2D"]
|
||||||
collision_layer = 8
|
collision_layer = 2147483648
|
||||||
collision_mask = 2
|
collision_mask = 2
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ shape = SubResource( 1 )
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
monitorable = false
|
monitorable = false
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 4
|
collision_mask = 2147483652
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
rotation = 1.5708
|
rotation = 1.5708
|
||||||
|
|
|
@ -25,7 +25,7 @@ func get_wand_type(wand_id):
|
||||||
Globals.Conduit2:
|
Globals.Conduit2:
|
||||||
is_triple = true
|
is_triple = true
|
||||||
print("triple")
|
print("triple")
|
||||||
var damage_mod = 0.75
|
var damage_mod = 0.5
|
||||||
Globals.Conduit3:
|
Globals.Conduit3:
|
||||||
is_bounce = true
|
is_bounce = true
|
||||||
print("bounce")
|
print("bounce")
|
||||||
|
@ -48,6 +48,7 @@ func launch(wand, mod = 1):
|
||||||
return energy_cost * energy_mod
|
return energy_cost * energy_mod
|
||||||
|
|
||||||
func on_impact(collision):
|
func on_impact(collision):
|
||||||
|
print(collision.collider)
|
||||||
if collision.collider.has_method("get_type") && collision.collider.get_type() == "enemy":
|
if collision.collider.has_method("get_type") && collision.collider.get_type() == "enemy":
|
||||||
var c = collision.collider
|
var c = collision.collider
|
||||||
c.health -= damage * damage_mod
|
c.health -= damage * damage_mod
|
||||||
|
|
|
@ -42,6 +42,9 @@ func fire(projectile):
|
||||||
return beam.energy_cost
|
return beam.energy_cost
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
|
if Player.energy <= 0:
|
||||||
|
for c in $ProjectileSpawn.get_children():
|
||||||
|
c.deactivate()
|
||||||
if event.is_action_released("shoot"):
|
if event.is_action_released("shoot"):
|
||||||
for c in $ProjectileSpawn.get_children():
|
for c in $ProjectileSpawn.get_children():
|
||||||
c.deactivate()
|
c.deactivate()
|
||||||
|
|
Loading…
Reference in a new issue