diff --git a/assets/other/bullet.png b/assets/other/bullet.png new file mode 100644 index 0000000..22048fd Binary files /dev/null and b/assets/other/bullet.png differ diff --git a/assets/other/bullet.png.import b/assets/other/bullet.png.import new file mode 100644 index 0000000..6cbcb8e --- /dev/null +++ b/assets/other/bullet.png.import @@ -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 diff --git a/scripts/game/weapon_projectile.gd b/scripts/game/weapon_projectile.gd index 1771248..978ceef 100644 --- a/scripts/game/weapon_projectile.gd +++ b/scripts/game/weapon_projectile.gd @@ -1,6 +1,8 @@ extends Area2D 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 projectile_speed := 600.0 @@ -165,8 +167,11 @@ func _draw() -> void: _draw_missile_smoke() match weapon_kind: ItemDefinition.WeaponKind.PLASMA: - draw_circle(Vector2.ZERO, 6.0, Color(0.3, 0.85, 1.0, 0.95)) - draw_circle(Vector2.ZERO, 3.0, Color(0.85, 0.98, 1.0, 1.0)) + var texture_size := PLASMA_TEXTURE.get_size() * (PLASMA_VISUAL_WIDTH / PLASMA_TEXTURE.get_width()) + # 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: draw_rect(Rect2(-7.0, -2.0, 14.0, 4.0), Color(1.0, 0.82, 0.38, 1.0)) ItemDefinition.WeaponKind.MISSILE: