Merge pull request 'Book_AbilitySystem' (#30) from Book_AbilitySystem into dev

Reviewed-on: https://code.booklordofthe.dev///Booklordofthedings/GMTK-2024/pulls/30
This commit is contained in:
Booklordofthedings 2024-08-17 19:17:47 +02:00
commit ee82118a9d
2 changed files with 43 additions and 2 deletions

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=14 format=3 uid="uid://ba6afuig8bqrg"] [gd_scene load_steps=15 format=3 uid="uid://ba6afuig8bqrg"]
[ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"] [ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"]
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"] [ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"]
[ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"] [ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"]
[ext_resource type="Script" path="res://scripts/ui_actions.gd" id="3_b82rx"]
[ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"] [ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"]
[ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"] [ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"]
[ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"] [ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"]
@ -32,13 +33,15 @@ visible = false
[node name="UILayer" type="CanvasLayer" parent="."] [node name="UILayer" type="CanvasLayer" parent="."]
[node name="UI" type="Control" parent="UILayer"] [node name="UI" type="Control" parent="UILayer" node_paths=PackedStringArray("player")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("3_b82rx")
player = NodePath("../../Player")
[node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"] [node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"]
layout_mode = 0 layout_mode = 0
@ -90,3 +93,7 @@ shape = SubResource("RectangleShape2D_nnio8")
[node name="RightWall" type="CollisionShape2D" parent="Walls"] [node name="RightWall" type="CollisionShape2D" parent="Walls"]
position = Vector2(690, -2.5) position = Vector2(690, -2.5)
shape = SubResource("RectangleShape2D_h7316") shape = SubResource("RectangleShape2D_h7316")
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleUp" to="UILayer/UI" method="select_up"]
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleDown" to="UILayer/UI" method="select_down"]
[connection signal="pressed" from="UILayer/UI/HBoxContainer/TextureButton" to="UILayer/UI" method="select_mirror"]

View file

@ -0,0 +1,34 @@
extends Node
@export var player : CharacterBody2D;
var current_selected = "none";
func _process(delta: float) -> void:
if Input.is_action_just_pressed("click"):
if current_selected == "scale_up":
scale_up()
elif current_selected == "scale_down":
scale_down()
elif current_selected == "mirror":
mirror();
func select_up():
current_selected = "scale_up"
func select_down():
current_selected = "scale_down"
func select_mirror():
current_selected = "mirror"
func scale_up():
pass #Hir hochscalieren einbauen
func scale_down():
pass #Hir runterscalieren einbauen
func mirror():
pass #Hir mirror einbauen einbauen