basic command blocks now working

This commit is contained in:
Clevertop 2024-08-10 22:37:32 +10:00
parent 220ca2886f
commit 52426368b1
15 changed files with 235 additions and 14 deletions

BIN
Commands/abjuration.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cvut6ofjhaltn"
path="res://.godot/imported/abjuration.png-e924163c93f8355d3837a8bb3eef13a4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Commands/abjuration.png"
dest_files=["res://.godot/imported/abjuration.png-e924163c93f8355d3837a8bb3eef13a4.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmvnccuywukyw"
path="res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Commands/controlled_blink_new.png"
dest_files=["res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

BIN
Commands/haste_new.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dx8s88cut5kka"
path="res://.godot/imported/haste_new.png-0ba91c6aeea5d133877fab9bb8289326.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Commands/haste_new.png"
dest_files=["res://.godot/imported/haste_new.png-0ba91c6aeea5d133877fab9bb8289326.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

BIN
Commands/jump.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

35
Commands/jump.png.import Normal file
View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vc7wwv4wgabf"
path.s3tc="res://.godot/imported/jump.png-30c1e703fef0a7ddf5535f3a6331dad8.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Commands/jump.png"
dest_files=["res://.godot/imported/jump.png-30c1e703fef0a7ddf5535f3a6331dad8.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cxljjpwweuds0"
path="res://.godot/imported/phase_shift_new.png-891079484e26e9cd007d0e1ac60bd618.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Commands/phase_shift_new.png"
dest_files=["res://.godot/imported/phase_shift_new.png-891079484e26e9cd007d0e1ac60bd618.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

BIN
Commands/swiftness_new.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://sopxcutu5u66"
path="res://.godot/imported/swiftness_new.png-e5f8fbc540408356f1ccb80b8fc5c8ed.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Commands/swiftness_new.png"
dest_files=["res://.godot/imported/swiftness_new.png-e5f8fbc540408356f1ccb80b8fc5c8ed.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

View file

@ -7,10 +7,10 @@
[ext_resource type="Material" uid="uid://didvwdmm46bmq" path="res://Assets/Materials/green_floor.tres" id="3_mnhg8"]
[ext_resource type="Texture2D" uid="uid://c1fesrqdpjloa" path="res://Assets/Textures/ice_0_old.png" id="4_v03h0"]
[ext_resource type="PackedScene" uid="uid://dqvq4ybcpws87" path="res://Commands/command_block.tscn" id="5_81jk1"]
[ext_resource type="Texture2D" uid="uid://dc23iehev1s8w" path="res://Assets/Textures/crystal_wall_2.png" id="6_g3qnb"]
[ext_resource type="Texture2D" uid="uid://bb8771vptn2l8" path="res://Assets/Textures/transparent_wall_new.png" id="6_nv7xj"]
[ext_resource type="Texture2D" uid="uid://dd150xco2ee5q" path="res://Assets/Textures/cobalt_stone_4.png" id="7_qjeey"]
[ext_resource type="PackedScene" uid="uid://cq4rfdsc5kghr" path="res://Commands/command_pedestal.tscn" id="10_sghta"]
[ext_resource type="Texture2D" uid="uid://vc7wwv4wgabf" path="res://Commands/jump.png" id="10_x6wpo"]
[sub_resource type="BoxMesh" id="BoxMesh_21vdj"]
material = ExtResource("2_0aj3l")
@ -138,15 +138,20 @@ mesh = SubResource("BoxMesh_lcav8")
[node name="CollisionShape3D" type="CollisionShape3D" parent="EndZone/Area3D"]
shape = SubResource("BoxShape3D_y4l56")
[node name="BaseCommand" parent="." instance=ExtResource("5_81jk1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.76166, 1.32179, -1.59377)
[node name="JumpCommand2" parent="." instance=ExtResource("5_81jk1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 1.322, -1.5)
command_name = "jump"
command_sprite = ExtResource("6_g3qnb")
command_sprite = ExtResource("10_x6wpo")
[node name="BaseCommand2" parent="." instance=ExtResource("5_81jk1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.70813, 1.32179, -1.59377)
[node name="JumpCommand3" parent="." instance=ExtResource("5_81jk1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 1.322, -1.5)
command_name = "jump"
command_sprite = ExtResource("7_qjeey")
command_sprite = ExtResource("10_x6wpo")
[node name="JumpCommand4" parent="." instance=ExtResource("5_81jk1")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1.322, -1.5)
command_name = "jump"
command_sprite = ExtResource("10_x6wpo")
[node name="Pedestals" type="Node3D" parent="."]
@ -180,4 +185,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 2.5)
[node name="CommandPedestal10" parent="Pedestals" instance=ExtResource("10_sghta")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 1.5)
[connection signal="broadcast" from="." to="Player" method="_on_chrono_manager_broadcast"]
[connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"]

View file

@ -37,10 +37,12 @@ func _process(delta):
print("Tick: " + str(current_tick))
for i in pedestals.size():
if i+1 == current_tick:
pedestals[i].mesh.mesh.material = pedestal_on_mat
else:
pass
#pedestals[i].mesh.material
var activated_pedestal = pedestals[i]
activated_pedestal.mesh.mesh.material = pedestal_on_mat
if activated_pedestal.has_command:
print("broadcasting: " + activated_pedestal.placed_command.command_name)
broadcast.emit(activated_pedestal.placed_command.command_name)
pass

View file

@ -24,9 +24,9 @@ func _physics_process(delta):
if not is_on_floor():
velocity.y -= gravity * delta
# Handle jump.
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Handle jump. # now handled by chronos
#if Input.is_action_just_pressed("jump") and is_on_floor():
#velocity.y = JUMP_VELOCITY
#free the mouse for debugging
if Input.is_action_just_pressed("esc"):
@ -99,3 +99,11 @@ func drop():
held_object.freeze = false
has_object = false
func _on_chrono_manager_broadcast(command):
match command:
"jump":
velocity.y = JUMP_VELOCITY
_:
printerr("bad command sent")