generated from bitbrain/godot-gamejam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
class_name Player | ||
extends Node2D | ||
|
||
@export var max_health: int = 10 | ||
var current_health: int | ||
|
||
|
||
func _ready() -> void: | ||
current_health = max_health # eventually make this carry over health between runs | ||
print('current health ' + str(State.player_stats.current_health)) | ||
|
||
|
||
func damage(value: int) -> void: | ||
current_health -= value | ||
print('current health ' + str(current_health)) | ||
State.player_stats.current_health -= value | ||
print('current health ' + str(State.player_stats.current_health)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
extends Node | ||
|
||
var player_deck : Array[Ingredient] = [load("res://scenes/ingredient_block/resources/godot_single.tres"),load("res://scenes/ingredient_block/resources/l_block.tres")] | ||
var player_deck : Array[Ingredient] = [ | ||
load("res://scenes/ingredient_block/resources/godot_single.tres"), | ||
load("res://scenes/ingredient_block/resources/l_block.tres") | ||
] | ||
|
||
var player_stats : Stats = Stats.new() | ||
|
||
func _init(health: int = 5, max_health: int = 10) -> void: | ||
player_stats.current_health = health | ||
player_stats.max_health = max_health | ||
|
||
print('starting health ' + str(player_stats.current_health)) |
Large diffs are not rendered by default.
Oops, something went wrong.