pillometer texture change depending on pill level
This commit is contained in:
parent
ef7529332f
commit
b5689a5511
@ -1,7 +1,7 @@
|
|||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
|
||||||
export(int) var _player_follow_pill_level = 3
|
export(int) var _player_follow_pill_level = Pills.LEVELS.MEDIUM
|
||||||
|
|
||||||
onready var visibility_cone_mesh = get_node("Visibility/VisibilityCone")
|
onready var visibility_cone_mesh = get_node("Visibility/VisibilityCone")
|
||||||
|
|
||||||
|
@ -7,12 +7,15 @@ var _labelDayTime: Label
|
|||||||
var _dayTime: ProgressBar
|
var _dayTime: ProgressBar
|
||||||
var _dayTimeVisual: TextureRect
|
var _dayTimeVisual: TextureRect
|
||||||
|
|
||||||
onready var _keyTexture = load("res://Resources/Models/key/key.png")
|
onready var _keyTexture = preload("res://Resources/Models/key/key.png")
|
||||||
var _cardTexture = {
|
var _cardTexture = {
|
||||||
1: preload("res://Resources/Models/keycard/lvl1_keycard.png"),
|
1: preload("res://Resources/Models/keycard/lvl1_keycard.png"),
|
||||||
2: preload("res://Resources/Models/keycard/lvl2_keycard.png")
|
2: preload("res://Resources/Models/keycard/lvl2_keycard.png")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onready var _pillFill = preload("res://Resources/Textures/pillLevel_fill.png")
|
||||||
|
onready var _pillDanger = preload("res://Resources/Textures/pillLevel_danger.png")
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
_container = get_node("InventoryContainer")
|
_container = get_node("InventoryContainer")
|
||||||
@ -50,11 +53,18 @@ func add_item (object):
|
|||||||
_container.add_child(rect)
|
_container.add_child(rect)
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
_labelPillLevel.text = "curLevel: " + String(Pills.get_level())
|
# pill level
|
||||||
_pillLevel.value = Pills.get_level()
|
var val = Pills.get_level()
|
||||||
var val = int(Daytime.get_time())
|
_labelPillLevel.text = "curLevel: " + String(val)
|
||||||
|
_pillLevel.value = val
|
||||||
|
if val < Pills.LEVELS.MEDIUM:
|
||||||
|
_pillLevel.set_progress_texture(_pillDanger)
|
||||||
|
elif _pillLevel.get_progress_texture() != _pillFill:
|
||||||
|
_pillLevel.set_progress_texture(_pillFill)
|
||||||
|
|
||||||
|
# day time
|
||||||
|
val = int(Daytime.get_time())
|
||||||
#_labelDayTime.text = "dayTime: " + String(val) + " - %02d:%02d" % [val/60%24, val%60]
|
#_labelDayTime.text = "dayTime: " + String(val) + " - %02d:%02d" % [val/60%24, val%60]
|
||||||
_dayTime.value = val
|
_dayTime.value = val
|
||||||
|
|
||||||
_dayTimeVisual.rect_rotation = ((val/_dayTime.max_value) * 180) - 90
|
_dayTimeVisual.rect_rotation = ((val/_dayTime.max_value) * 180) - 90
|
||||||
|
|
BIN
Resources/Textures/pillLevel_danger.png
Normal file
BIN
Resources/Textures/pillLevel_danger.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 345 B |
34
Resources/Textures/pillLevel_danger.png.import
Normal file
34
Resources/Textures/pillLevel_danger.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/pillLevel_danger.png-3f16593e6f8ad54ee32d61800bfb0c9f.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Resources/Textures/pillLevel_danger.png"
|
||||||
|
dest_files=[ "res://.import/pillLevel_danger.png-3f16593e6f8ad54ee32d61800bfb0c9f.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=true
|
||||||
|
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
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
Binary file not shown.
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 360 B |
@ -75,7 +75,7 @@ _global_script_class_icons={
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="retrace"
|
config/name="retrace"
|
||||||
run/main_scene="res://Level/World.tscn"
|
run/main_scene="res://Level/OutsideWorld.tscn"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user