Suppression des animation bounce in dans les dialogues et ajout d'un rayon de visibilité pour la grille
This commit is contained in:
@@ -10,5 +10,8 @@ func get_description() -> String:
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/tornado.svg")
|
||||
|
||||
func get_card_section_color() -> Color:
|
||||
return Color("#FF006E")
|
||||
|
||||
func modify_objective(objective : int) -> int:
|
||||
return roundi(objective * 2)
|
||||
@@ -5,6 +5,8 @@ const GRID_SHIFT : int = roundi(Region.TILE_SIZE / 2.)
|
||||
const GRID_SIZE : int = Region.TILE_SIZE
|
||||
const POINT_RADIUS : int = 5
|
||||
const POINT_COLOR : Color = Color.WHITE
|
||||
const POINT_VISIBILITY_RADIUS : int = 200
|
||||
const POINT_FULL_OPACITY_RADIUS : int = 100
|
||||
const POINT_RANDOM_SHIFT = roundi(Region.TILE_SIZE / 2.)
|
||||
|
||||
const REFRESH_TIME : float = 2.
|
||||
@@ -14,6 +16,8 @@ var refresh_timer : float = 0.
|
||||
var region : Region
|
||||
var noise : Noise
|
||||
|
||||
var points : Array[Vector2]
|
||||
|
||||
func _init(
|
||||
_region : Region
|
||||
):
|
||||
@@ -22,12 +26,14 @@ func _init(
|
||||
noise.seed = region.data.region_seed
|
||||
noise.noise_type = noise.TYPE_VALUE
|
||||
|
||||
points = get_grid_point()
|
||||
|
||||
func _process(delta):
|
||||
queue_redraw()
|
||||
refresh_timer += delta
|
||||
if refresh_timer > REFRESH_TIME:
|
||||
refresh_timer = 0
|
||||
queue_redraw()
|
||||
points = get_grid_point()
|
||||
var current_item = GameInfo.game_data.player_data.inventory.get_item()
|
||||
var target_opacity = (1.) if current_item and current_item.snap_usage_to_grid() else 0.
|
||||
|
||||
@@ -37,7 +43,7 @@ func _process(delta):
|
||||
0.1)
|
||||
|
||||
func _draw():
|
||||
for p in get_grid_point():
|
||||
for p in points:
|
||||
draw_point(p)
|
||||
|
||||
|
||||
@@ -66,8 +72,13 @@ func get_random_shift(pos: Vector2):
|
||||
|
||||
|
||||
func draw_point(pos: Vector2):
|
||||
draw_circle(
|
||||
pos,
|
||||
POINT_RADIUS,
|
||||
POINT_COLOR
|
||||
)
|
||||
var mouse_distance = get_global_mouse_position().distance_to(pos)
|
||||
|
||||
if mouse_distance < POINT_VISIBILITY_RADIUS:
|
||||
var color := POINT_COLOR
|
||||
color.a = min(1.,1 - (mouse_distance - POINT_FULL_OPACITY_RADIUS)/POINT_VISIBILITY_RADIUS)
|
||||
draw_circle(
|
||||
pos,
|
||||
POINT_RADIUS,
|
||||
color
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user