The stone axe is given to the player at level 5

This commit is contained in:
2023-11-04 13:45:37 -07:00
parent bf126ec69c
commit 8ec03fefa8
3 changed files with 12 additions and 3 deletions

View File

@ -64,6 +64,12 @@ func _process(delta):
if inventory.points >= (get_total_points_for_next_level()): if inventory.points >= (get_total_points_for_next_level()):
inventory.points -= get_total_points_for_next_level() inventory.points -= get_total_points_for_next_level()
status.level += 1 status.level += 1
level_up()
func level_up():
if status.level in game_data.level_tools:
change_tool(game_data.level_tools[status.level])
func _input(event): func _input(event):
if event is InputEventMouseMotion: if event is InputEventMouseMotion:

View File

@ -1,8 +1,7 @@
[gd_scene load_steps=8 format=3 uid="uid://4dsm0l7s6vki"] [gd_scene load_steps=7 format=3 uid="uid://4dsm0l7s6vki"]
[ext_resource type="Texture2D" uid="uid://gfxfxkfu8uk4" path="res://textures/character/character.svg" id="1_f7cgp"] [ext_resource type="Texture2D" uid="uid://gfxfxkfu8uk4" path="res://textures/character/character.svg" id="1_f7cgp"]
[ext_resource type="Script" path="res://data/character/character.gd" id="1_qlitf"] [ext_resource type="Script" path="res://data/character/character.gd" id="1_qlitf"]
[ext_resource type="Texture2D" uid="uid://b7hh5vuwdmg0v" path="res://textures/tools/stick.svg" id="3_q8qyo"]
[ext_resource type="PackedScene" uid="uid://vaapoj5q16ko" path="res://data/character/hud.tscn" id="4_vgn11"] [ext_resource type="PackedScene" uid="uid://vaapoj5q16ko" path="res://data/character/hud.tscn" id="4_vgn11"]
[sub_resource type="CircleShape2D" id="CircleShape2D_653al"] [sub_resource type="CircleShape2D" id="CircleShape2D_653al"]
@ -56,6 +55,5 @@ texture = ExtResource("1_f7cgp")
[node name="tool" type="Sprite2D" parent="body_pivot/body"] [node name="tool" type="Sprite2D" parent="body_pivot/body"]
z_index = -1 z_index = -1
texture = ExtResource("3_q8qyo")
[node name="hud" parent="." instance=ExtResource("4_vgn11")] [node name="hud" parent="." instance=ExtResource("4_vgn11")]

View File

@ -15,3 +15,8 @@ var tools = {
"offset": Vector2(-80, -195) "offset": Vector2(-80, -195)
} }
} }
var level_tools = {
1: "stick",
5: "stone_axe"
}