forked from team-sg/hero-mark-2
add palette-cycling cheat (closes #126)
This commit is contained in:
parent
8d3373e771
commit
ed32a378c4
1 changed files with 21 additions and 0 deletions
|
@ -140,3 +140,24 @@ func _enter_code():
|
|||
"HYDROCITY":
|
||||
var player = get_tree().get_nodes_in_group("player").pop_back()
|
||||
player.oxygen_timer.start(0.001)
|
||||
"FLUX":
|
||||
var player = get_tree().get_nodes_in_group("player").pop_back()
|
||||
# set up tween
|
||||
var tween = create_tween().set_loops()
|
||||
# open palettes directory for listing
|
||||
var dir = Directory.new()
|
||||
if dir.open("res://graphics/player/palettes/") == OK:
|
||||
# loop through files in directory
|
||||
dir.list_dir_begin(true, true)
|
||||
var file_name = dir.get_next()
|
||||
while file_name != "":
|
||||
# act on any pngs
|
||||
if file_name.ends_with(".png"):
|
||||
# load the texture
|
||||
var texture = load("res://graphics/player/palettes/" + file_name)
|
||||
# add step to the tween for that texture
|
||||
tween.tween_property(player.sprite, "material:shader_param/palette", texture, 0.0)
|
||||
tween.tween_interval(0.2)
|
||||
file_name = dir.get_next()
|
||||
dir.list_dir_end()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue