Level 2 polished

This commit is contained in:
Logan 2020-07-23 12:16:10 -05:00
parent 2ff0e9625c
commit 17120f0b2e
12 changed files with 80 additions and 102 deletions

View file

@ -14,5 +14,5 @@ tracks/0/keys = {
"times": PoolRealArray( 0, 0.05, 0.1 ), "times": PoolRealArray( 0, 0.05, 0.1 ),
"transitions": PoolRealArray( 1, 1, 1 ), "transitions": PoolRealArray( 1, 1, 1 ),
"update": 0, "update": 0,
"values": [ Color( 0.964706, 0.462745, 0.462745, 1 ), Color( 10, 10, 10, 1 ), Color( 1, 1, 1, 1 ) ] "values": [ Color( 10, 10, 10, 1 ), Color( 10, 10, 10, 1 ), Color( 1, 1, 1, 1 ) ]
} }

View file

@ -1,7 +1,7 @@
[gd_resource type="Animation" format=2] [gd_resource type="Animation" format=2]
[resource] [resource]
resource_name = "Skeleton Hit" resource_name = "Hit"
length = 0.1 length = 0.1
step = 0.05 step = 0.05
tracks/0/type = "value" tracks/0/type = "value"

View file

@ -1,10 +1,8 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://ai/Script/Skeleton Enemy.gd" type="Script" id=1] [ext_resource path="res://ai/Script/Skeleton Enemy.gd" type="Script" id=1]
[ext_resource path="res://Music and Fonts(Misc.)/Skeleton Hit.tres" type="Animation" id=2] [ext_resource path="res://Music and Fonts(Misc.)/Skeleton Hit.tres" type="Animation" id=2]
[ext_resource path="res://art/Skeleton.png" type="Texture" id=3] [ext_resource path="res://art/Skeleton.png" type="Texture" id=3]
[ext_resource path="res://Music and Fonts(Misc.)/Ogre Hit.tres" type="Animation" id=4]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 5, 7 ) extents = Vector2( 5, 7 )
@ -44,16 +42,6 @@ enabled = true
cast_to = Vector2( 80, 0 ) cast_to = Vector2( 80, 0 )
collision_mask = 3 collision_mask = 3
[node name="RayCast2D3" type="RayCast2D" parent="."]
enabled = true
cast_to = Vector2( -80, -25 )
collision_mask = 3
[node name="RayCast2D4" type="RayCast2D" parent="."]
enabled = true
cast_to = Vector2( 80, -25 )
collision_mask = 3
[node name="ShootDelay" type="Timer" parent="."] [node name="ShootDelay" type="Timer" parent="."]
wait_time = 1.239 wait_time = 1.239
one_shot = true one_shot = true
@ -71,5 +59,4 @@ autoplay = "Skeleton Jump"
"anims/Skeleton Jump" = SubResource( 2 ) "anims/Skeleton Jump" = SubResource( 2 )
[node name="AnimationPlayer2" type="AnimationPlayer" parent="."] [node name="AnimationPlayer2" type="AnimationPlayer" parent="."]
anims/Hit = ExtResource( 4 ) anims/Hit = ExtResource( 2 )
"anims/Skeleton Hit" = ExtResource( 2 )

View file

@ -25,7 +25,7 @@ radius = 3.0
height = 2.0 height = 2.0
[node name="KinematicBody2D" type="KinematicBody2D"] [node name="KinematicBody2D" type="KinematicBody2D"]
collision_layer = 8 collision_layer = 16
collision_mask = 3 collision_mask = 3
script = ExtResource( 2 ) script = ExtResource( 2 )
__meta__ = { __meta__ = {

View file

@ -7,7 +7,7 @@ onready var ProjectileSpawn: Node2D = $Position2D
onready var PlayerRaycast: RayCast2D = $PlayerRaycast onready var PlayerRaycast: RayCast2D = $PlayerRaycast
func _ready(): func _ready():
health = 0.5 health = 2
knockback_amount = 700 knockback_amount = 700
func _physics_process(_delta): func _physics_process(_delta):

View file

@ -1,10 +1,18 @@
extends Enemy extends Enemy
export var max_range: int = 200
export var stationary: bool = false
var Spinning_Bone = preload("res://ai/Scenes/SpinningBone.tscn") var Spinning_Bone = preload("res://ai/Scenes/SpinningBone.tscn")
onready var ShootDelay : Timer = $ShootDelay onready var ShootDelay : Timer = $ShootDelay
onready var ProjectileSpawn: Node2D = $Position2D onready var ProjectileSpawn: Node2D = $Position2D
func _ready():
health = 1.5
$RayCast2D.cast_to.x = -1 * max_range
$RayCast2D2.cast_to.y = 1 * max_ranged
func apply_gravity(delta, modifier = 1): func apply_gravity(delta, modifier = 1):
velocity.y += gravity * delta * modifier velocity.y += gravity * delta * modifier
@ -28,7 +36,7 @@ func _physics_process(_delta):
velocity.x *= speed velocity.x *= speed
velocity = move_and_slide(velocity, UP) velocity = move_and_slide(velocity, UP)
if dist <= 200: if dist <= max_range and not stationary:
velocity.x = position.direction_to(Player.position).normalized().x velocity.x = position.direction_to(Player.position).normalized().x
else: else:
velocity = Vector2(0, 0) velocity = Vector2(0, 0)

View file

@ -8,7 +8,7 @@ onready var Hurtbox = $Area2D
func _ready(): func _ready():
speed = 50 speed = 50
health = 3 health = 5
func _physics_process(delta): func _physics_process(delta):
if knockback != Vector2.ZERO: if knockback != Vector2.ZERO:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@
radius = 6.08276 radius = 6.08276
[node name="EcoProjectile" type="KinematicBody2D"] [node name="EcoProjectile" type="KinematicBody2D"]
scale = Vector2( 1.5, 1.5 )
collision_layer = 8 collision_layer = 8
collision_mask = 6 collision_mask = 6
script = ExtResource( 2 ) script = ExtResource( 2 )

View file

@ -7,11 +7,10 @@ var projectile = null
onready var ChargeTimer: Timer = $ChargeTimer onready var ChargeTimer: Timer = $ChargeTimer
func fire(p): func fire(p):
print(p)
projectile = p projectile = p
if ChargeTimer.is_stopped(): if ChargeTimer.is_stopped():
ChargeTimer.start() ChargeTimer.start()
if charge_level == 0: if charge_level == 0 and p != null:
var temp = p.instance() var temp = p.instance()
get_tree().current_scene.add_child(temp) get_tree().current_scene.add_child(temp)
var energy = temp.energy_cost var energy = temp.energy_cost
@ -27,7 +26,7 @@ func _on_ChargeTimer_timeout():
func _input(event): func _input(event):
if event.is_action_released("shoot"): if event.is_action_released("shoot"):
ChargeTimer.stop() ChargeTimer.stop()
if charge_level <= 0: if charge_level <= 0 or projectile == null:
charge_level = 0 charge_level = 0
return return
var temp = projectile.instance() var temp = projectile.instance()

View file

@ -11,7 +11,6 @@ func _process(delta):
$Label.text = "F to Open" $Label.text = "F to Open"
if Input.is_action_just_pressed("open"): if Input.is_action_just_pressed("open"):
Player.current_scene = next_scene Player.current_scene = next_scene
print(Player.current_scene)
get_tree().change_scene(""+next_scene+"") get_tree().change_scene(""+next_scene+"")
else: else:
$Label.text = "Locked" $Label.text = "Locked"