pennymeat
This commit is contained in:
parent
26a351b408
commit
d6f5925198
4 changed files with 311 additions and 6 deletions
42
maps/future/pennymeat.gd
Normal file
42
maps/future/pennymeat.gd
Normal file
|
@ -0,0 +1,42 @@
|
|||
extends "res://maps/map.gd"
|
||||
|
||||
|
||||
const Lightning = preload("res://objects/gfx/lightning.tscn")
|
||||
|
||||
|
||||
export var min_interval: float
|
||||
export var max_interval: float
|
||||
export var fade_time: float
|
||||
|
||||
|
||||
onready var lightning_spawn: Node2D = $"%LightningSpawn"
|
||||
onready var bright_sky: ColorRect = $"%BrightSky"
|
||||
onready var lightning_timer: Timer = $"%LightningTimer"
|
||||
onready var clouds: Sprite = $"%Clouds"
|
||||
|
||||
|
||||
var slaughter_shard_collected := false
|
||||
|
||||
|
||||
func _spawn_lightning():
|
||||
var bolt = Lightning.instance()
|
||||
bright_sky.modulate.a = 1.0
|
||||
clouds.modulate = Color(1.2, 1.2, 1.2)
|
||||
bolt.position.x = rand_range(-100.0, 100.0)
|
||||
bolt.fade_time = fade_time
|
||||
lightning_spawn.add_child(bolt)
|
||||
var tween = create_tween()
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property(bright_sky, "modulate:a", 0.0, fade_time).set_trans(Tween.TRANS_EXPO)
|
||||
tween.tween_property(clouds, "modulate", Color.white, fade_time).set_trans(Tween.TRANS_EXPO)
|
||||
lightning_timer.start(rand_range(min_interval, max_interval))
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
._physics_process(delta)
|
||||
if get_tree().get_nodes_in_group("enemy").size() == 0:
|
||||
if not slaughter_shard_collected:
|
||||
Audio.play_shard_sound()
|
||||
Game.score += 500
|
||||
Game.shards_collected[0] = true
|
||||
slaughter_shard_collected = true
|
262
maps/future/pennymeat.tscn
Normal file
262
maps/future/pennymeat.tscn
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue