quite incredible
This commit is contained in:
parent
94ed6c6c68
commit
b6daa18e6c
5 changed files with 113 additions and 0 deletions
|
@ -240,3 +240,6 @@ func _enter_code():
|
||||||
"LASERTAG":
|
"LASERTAG":
|
||||||
Game.can_use_shield = true
|
Game.can_use_shield = true
|
||||||
is_cheating = true
|
is_cheating = true
|
||||||
|
"INCREDIBLE":
|
||||||
|
var cat = load("res://objects/enemy/uncanny_cat.tscn").instance()
|
||||||
|
Game.get_map().add_child(cat)
|
||||||
|
|
BIN
graphics/secret/uncanny.png
Normal file
BIN
graphics/secret/uncanny.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
35
graphics/secret/uncanny.png.import
Normal file
35
graphics/secret/uncanny.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/uncanny.png-a842bbb579fb6147c3e65cfee5536a0b.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/secret/uncanny.png"
|
||||||
|
dest_files=[ "res://.import/uncanny.png-a842bbb579fb6147c3e65cfee5536a0b.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
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
31
objects/enemy/uncanny_cat.gd
Normal file
31
objects/enemy/uncanny_cat.gd
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
extends "res://objects/enemy/enemy.gd"
|
||||||
|
|
||||||
|
|
||||||
|
export var acceleration: float = 8.0
|
||||||
|
export var max_speed: float = 16.0
|
||||||
|
|
||||||
|
|
||||||
|
var velocity: Vector2 = Vector2.ZERO
|
||||||
|
|
||||||
|
|
||||||
|
onready var player: Node2D = get_tree().get_nodes_in_group("player")[0]
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if not is_instance_valid(player):
|
||||||
|
return
|
||||||
|
|
||||||
|
var target = (player.global_position - global_position).normalized()
|
||||||
|
velocity += target * acceleration * delta
|
||||||
|
velocity = velocity.clamped(max_speed)
|
||||||
|
|
||||||
|
global_position += velocity * delta
|
||||||
|
|
||||||
|
func _on_Hitbox_area_entered(area):
|
||||||
|
#Kill player
|
||||||
|
if area.is_in_group("player_hitbox"):
|
||||||
|
area.get_parent().die()
|
||||||
|
$Jumpscare.visible = true
|
||||||
|
$JumpscareSound.play()
|
||||||
|
var tween = create_tween()
|
||||||
|
tween.tween_property($Jumpscare, "visible", false, 0).set_delay(1.7)
|
44
objects/enemy/uncanny_cat.tscn
Normal file
44
objects/enemy/uncanny_cat.tscn
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/secret/uncanny.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://objects/enemy/uncanny_cat.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://audio/sounds/scrump_die.ogg" type="AudioStream" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
|
radius = 7.0
|
||||||
|
|
||||||
|
[node name="UncannyCat" type="Node2D"]
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
blood = false
|
||||||
|
acceleration = 48.0
|
||||||
|
max_speed = 56.0
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Hitbox" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="JumpscareSound" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource( 3 )
|
||||||
|
pitch_scale = 2.0
|
||||||
|
bus = "sound"
|
||||||
|
|
||||||
|
[node name="Jumpscare" type="CanvasLayer" parent="."]
|
||||||
|
visible = false
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Jumpscare"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="Jumpscare"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 6
|
||||||
|
|
||||||
|
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue