Zmiana dzialak plasmy - grafika

This commit is contained in:
Tomasz Boruc 2026-10-10 16:42:22 +02:00
parent e5067bb0e2
commit 4acb93ec2c
3 changed files with 47 additions and 2 deletions

BIN
assets/other/bullet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bpr6nvjx4h5u"
path="res://.godot/imported/bullet.png-66cc684355c2a62500163bc6295d59dc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/other/bullet.png"
dest_files=["res://.godot/imported/bullet.png-66cc684355c2a62500163bc6295d59dc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

@ -1,6 +1,8 @@
extends Area2D extends Area2D
const IMPACT_EFFECT_SCENE := preload("res://scenes/game/impact_effect.tscn") const IMPACT_EFFECT_SCENE := preload("res://scenes/game/impact_effect.tscn")
const PLASMA_TEXTURE := preload("res://assets/other/bullet.png")
const PLASMA_VISUAL_WIDTH := 24.0
var direction := Vector2.UP var direction := Vector2.UP
var projectile_speed := 600.0 var projectile_speed := 600.0
@ -165,8 +167,11 @@ func _draw() -> void:
_draw_missile_smoke() _draw_missile_smoke()
match weapon_kind: match weapon_kind:
ItemDefinition.WeaponKind.PLASMA: ItemDefinition.WeaponKind.PLASMA:
draw_circle(Vector2.ZERO, 6.0, Color(0.3, 0.85, 1.0, 0.95)) var texture_size := PLASMA_TEXTURE.get_size() * (PLASMA_VISUAL_WIDTH / PLASMA_TEXTURE.get_width())
draw_circle(Vector2.ZERO, 3.0, Color(0.85, 0.98, 1.0, 1.0)) # The source image points left; projectiles travel along their local +X.
draw_set_transform(Vector2.ZERO, PI)
draw_texture_rect(PLASMA_TEXTURE, Rect2(-texture_size * 0.5, texture_size), false)
draw_set_transform(Vector2.ZERO)
ItemDefinition.WeaponKind.MACHINE_GUN: ItemDefinition.WeaponKind.MACHINE_GUN:
draw_rect(Rect2(-7.0, -2.0, 14.0, 4.0), Color(1.0, 0.82, 0.38, 1.0)) draw_rect(Rect2(-7.0, -2.0, 14.0, 4.0), Color(1.0, 0.82, 0.38, 1.0))
ItemDefinition.WeaponKind.MISSILE: ItemDefinition.WeaponKind.MISSILE: