selection arrow WIP
This commit is contained in:
parent
f1ab7db046
commit
cec498998d
6 changed files with 107 additions and 14 deletions
6
Assets/Icones/kenney_game_icons_vector.svg
Normal file
6
Assets/Icones/kenney_game_icons_vector.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 57 KiB |
38
Assets/Icones/kenney_game_icons_vector.svg.import
Normal file
38
Assets/Icones/kenney_game_icons_vector.svg.import
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://o83munu8dibp"
|
||||
path.s3tc="res://.godot/imported/kenney_game_icons_vector.svg-8cbffda53f15d20cee9e017816ea079e.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Icones/kenney_game_icons_vector.svg"
|
||||
dest_files=["res://.godot/imported/kenney_game_icons_vector.svg-8cbffda53f15d20cee9e017816ea079e.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
[gd_scene load_steps=25 format=3 uid="uid://ky0uewndeuwv"]
|
||||
[gd_scene load_steps=28 format=3 uid="uid://ky0uewndeuwv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://qqid42jkpkmv" path="res://Levels/world.gd" id="1_fj7yv"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1f6m15niwgt" path="res://Tiles/tile.tscn" id="3_aqk2v"]
|
||||
[ext_resource type="Texture2D" uid="uid://o83munu8dibp" path="res://Assets/Icones/kenney_game_icons_vector.svg" id="3_ikoig"]
|
||||
[ext_resource type="Script" uid="uid://caf3yamufmhd4" path="res://Scripts/PlayerManager.gd" id="3_ju8gl"]
|
||||
[ext_resource type="PackedScene" uid="uid://d17sleiqkdoo2" path="res://Assets/GLB format/selection-a.glb" id="3_tlwt5"]
|
||||
[ext_resource type="PackedScene" uid="uid://do7gm1gjhu1t5" path="res://Tiles/road.tscn" id="4_036b0"]
|
||||
[ext_resource type="Script" uid="uid://tpon511km4al" path="res://Scripts/WaveManager.gd" id="5_036b0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpjfo15otkfru" path="res://Tiles/cube.tscn" id="5_wse8f"]
|
||||
|
|
@ -19,6 +19,45 @@
|
|||
[ext_resource type="PackedScene" uid="uid://trsvfgyds26p" path="res://Assets/Meshes/SM_Polyson.glb" id="15_ikoig"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8qg6bkxv643o" path="res://Assets/Meshes/SM_Studio24.glb" id="16_ju8gl"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_oyb16"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite3DSelection:offset")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ikoig"]
|
||||
resource_name = "arrow_bobbing"
|
||||
length = 1.5
|
||||
loop_mode = 1
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite3DSelection:offset")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.8, 1.5),
|
||||
"transitions": PackedFloat32Array(1, 0.4, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 15), Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_43wwi"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_oyb16"),
|
||||
&"arrow_bobbing": SubResource("Animation_ikoig")
|
||||
}
|
||||
|
||||
[sub_resource type="Curve3D" id="Curve3D_aqk2v"]
|
||||
_data = {
|
||||
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 1.212, -0.5, 0.5, 0, 0, 0, 0, 0, 0, 9.787, -0.5, 0.5),
|
||||
|
|
@ -72,10 +111,25 @@ script = ExtResource("1_fj7yv")
|
|||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(-0.992981, -0.0586822, 0.10269, -0.00234758, 0.877843, 0.478943, -0.118251, 0.47534, -0.871819, 5.87173, 2.81458, -3.88415)
|
||||
|
||||
[node name="PlayerManager" parent="." instance=ExtResource("3_tlwt5")]
|
||||
visible = false
|
||||
[node name="PlayerManager" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.73017, 0.728414, 0)
|
||||
script = ExtResource("3_ju8gl")
|
||||
|
||||
[node name="Sprite3DSelection" type="Sprite3D" parent="PlayerManager"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0)
|
||||
modulate = Color(0.966071, 0.695469, 0, 1)
|
||||
pixel_size = 0.015
|
||||
billboard = 2
|
||||
alpha_cut = 1
|
||||
texture = ExtResource("3_ikoig")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(155, 0, 29, 35)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="PlayerManager"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_43wwi")
|
||||
}
|
||||
|
||||
[node name="Map" type="Node3D" parent="."]
|
||||
|
||||
[node name="Tile" parent="Map" instance=ExtResource("3_aqk2v")]
|
||||
|
|
@ -236,5 +290,3 @@ transform = Transform3D(1.08365, 0, 1.68098, 0, 2, 0, -1.68098, 0, 1.08365, 1.44
|
|||
|
||||
[connection signal="timeout" from="WaveManager/WaveTimer" to="WaveManager" method="_on_wave_timer_timeout"]
|
||||
[connection signal="timeout" from="WaveManager/TroopTimer" to="WaveManager" method="_on_troop_timer_timeout"]
|
||||
|
||||
[editable path="PlayerManager"]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ var _state = STATE.IDLE
|
|||
|
||||
@onready var cam : Camera3D = $"../Camera3D"
|
||||
@onready var the_cube : TheCube = %TheCube
|
||||
@onready var selection_icon : Sprite3D = $Sprite3DSelection
|
||||
|
||||
@onready var towers : Array[Tower]
|
||||
|
||||
|
|
@ -38,6 +39,7 @@ var selected_collider : CollisionObject3D
|
|||
func _ready() -> void:
|
||||
EventBus.tower_selected.connect(_on_EventBus_tower_selected)
|
||||
EventBus.tower_to_build.connect(_on_EventBus_tower_to_build)
|
||||
$AnimationPlayer.play("arrow_bobbing")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
handle_player_controls()
|
||||
|
|
@ -78,9 +80,7 @@ func handle_player_controls() -> void:
|
|||
|
||||
var collider : CollisionObject3D = ray_result.get("collider")
|
||||
selected_collider = collider
|
||||
|
||||
visible = true
|
||||
$"selection-a".visible = true
|
||||
global_position = collider.global_position
|
||||
global_position += Vector3(0.0,0.2,0.0)
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ func handle_player_controls() -> void:
|
|||
|
||||
if _state == STATE.PLACING:
|
||||
tower_to_place.sprite.modulate = "ff4545c8" #If the tower can't be placed he is red
|
||||
$"selection-a".visible = false
|
||||
selection_icon.visible = false
|
||||
if selected_collider is BuildTile: #if we are placing a tower, hide the selector model
|
||||
tower_to_place.sprite.modulate = "61ff45c8" #If the tower can be placed he is green
|
||||
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ func take_damage(damage : int) -> void:
|
|||
|
||||
|
||||
func win():
|
||||
get_tree().change_scene_to_file("res://UI/win_screen.tscn")
|
||||
Transition.goto("res://UI/win_screen.tscn")
|
||||
|
||||
|
||||
func death():
|
||||
get_tree().change_scene_to_file("res://UI/defeat_screen.tscn")
|
||||
Transition.goto("res://UI/defeat_screen.tscn")
|
||||
|
||||
func _on_EventBus_money_received(money_received : int):
|
||||
money += money_received
|
||||
|
|
|
|||
|
|
@ -11,8 +11,5 @@ bio = ""
|
|||
bullet_damage = 1
|
||||
tower_shop = Array[ExtResource("3_v16mf")]([])
|
||||
|
||||
[node name="Sprite3D" parent="." index="6"]
|
||||
modulate = Color(0.3795, 1, 0.27, 0.784314)
|
||||
|
||||
[node name="EnergyBar3D" parent="." index="7"]
|
||||
visible = true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue