Added lasers

This commit is contained in:
2024-05-08 20:40:55 +01:00
parent bff1c6864b
commit 93f6236c71
8 changed files with 157 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ enum {
PADDLE_CAPTURE,
PADDLE_SMALL,
PADDLE_LARGE,
PADDLE_LAZER
PADDLE_LASER
}
var mode : int = PADDLE_NORMAL
@@ -40,6 +40,7 @@ func show_paddle(paddle : Node2D) -> void:
$Small.visible = true if paddle == $Small else false
$Big.visible = true if paddle == $Big else false
$Magnet.visible = true if paddle == $Magnet else false
$Laser.visible = true if paddle == $Laser else false
$CollisionShape2D.shape.height = 32
if paddle == $Big: $CollisionShape2D.shape.height = 40
@@ -62,6 +63,11 @@ func normal() -> void:
show_paddle($Normal)
$CollisionShape2D.shape.height = 32
_switch_effect(PADDLE_NORMAL)
func laser() -> void:
show_paddle($Laser)
$CollisionShape2D.shape.height = 32
_switch_effect(PADDLE_LASER, 15)
func capture() -> void:
show_paddle($Magnet)
@@ -83,5 +89,5 @@ func is_normal() -> bool:
func is_capture() -> bool:
return mode == PADDLE_CAPTURE
func is_lazer() -> bool:
return mode == PADDLE_LAZER
func is_laser() -> bool:
return mode == PADDLE_LASER

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://dndemjw7up2r6"]
[gd_scene load_steps=11 format=3 uid="uid://dndemjw7up2r6"]
[ext_resource type="PhysicsMaterial" uid="uid://cql6t5hd40fgn" path="res://CorePhysics.tres" id="1_oa72h"]
[ext_resource type="Script" path="res://Paddle/Paddle.gd" id="1_swo0j"]
@@ -8,6 +8,7 @@
[ext_resource type="Texture2D" uid="uid://bmwoidu5wsvu6" path="res://Paddle/PaddleMagnet.png" id="6_8ubfk"]
[ext_resource type="AudioStream" uid="uid://ds7om6qbk3p6l" path="res://Sounds/Grow.wav" id="6_hpb6a"]
[ext_resource type="AudioStream" uid="uid://bd2o8lynhy3wn" path="res://Sounds/Shrink.wav" id="7_3krfd"]
[ext_resource type="Texture2D" uid="uid://byb16ek3xcdn1" path="res://Paddle/PaddleLaser.png" id="7_3m0i8"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_tamfm"]
radius = 4.0
@@ -86,6 +87,22 @@ offset_right = 16.0
offset_bottom = 4.0
texture = ExtResource("6_8ubfk")
[node name="Laser" type="Node2D" parent="."]
visible = false
[node name="Polygon2D" type="Polygon2D" parent="Laser"]
z_index = -1
position = Vector2(2, 4)
color = Color(0, 0, 0, 0.247059)
polygon = PackedVector2Array(-14, -4, 14, -4, 16, -2, 16, 2, 14, 4, -14, 4, -16, 2, -16, -2)
[node name="TextureRect" type="TextureRect" parent="Laser"]
offset_left = -16.0
offset_top = -4.0
offset_right = 16.0
offset_bottom = 4.0
texture = ExtResource("7_3m0i8")
[node name="EffectTimer" type="Timer" parent="."]
[node name="GrowSound" type="AudioStreamPlayer" parent="."]

BIN
Paddle/PaddleLaser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://byb16ek3xcdn1"
path="res://.godot/imported/PaddleLaser.png-8c27c343baed70e8b1b741a3e807b263.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Paddle/PaddleLaser.png"
dest_files=["res://.godot/imported/PaddleLaser.png-8c27c343baed70e8b1b741a3e807b263.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