Skip to content

Commit

Permalink
Fixed small typos
Browse files Browse the repository at this point in the history
  • Loading branch information
CSaratakij committed Oct 20, 2016
1 parent 82a6f18 commit 753a8a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ui/ui_life.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ const RECT_WIDTH = 20
const RECT_HEIGHT = 20

var rects_life = [
Rect2(0, 0, RECT_WIDTH * 0, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 1, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 2, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 3, RECT_HEIGHT)
]
Rect2(0, 0, RECT_WIDTH * 0, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 1, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 2, RECT_HEIGHT),
Rect2(0, 0, RECT_WIDTH * 3, RECT_HEIGHT)
]

var current_life = 0
var current_rect_life = 0

onready var tree = get_tree()
onready var _life_sprite = get_node("Sprite")
onready var _health = tree.get_nodes_in_group("player")[0].get_node("health")
onready var _health = tree.get_nodes_in_group("player")[ 0 ].get_node("health")

func _ready():
set_process(true)

func _process(delta):
current_life = _health.get_current_life()
current_rect_life = rects_life[current_life]
current_rect_life = rects_life[ current_life ]
_life_sprite.set_region_rect(current_rect_life)

0 comments on commit 753a8a2

Please sign in to comment.