From b40da120e30d4521736c99392c08e97de2da34ae Mon Sep 17 00:00:00 2001 From: Logan B <113468801+LoganLDB@users.noreply.github.com> Date: Sat, 29 Oct 2022 22:07:02 +0100 Subject: adjusting sprites --- Bullet.tscn | 3 ++- KinematicBody2D.gd | 2 +- Player.tscn | 4 ++-- assets/htm_tex.png | Bin 0 -> 422593 bytes 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 assets/htm_tex.png diff --git a/Bullet.tscn b/Bullet.tscn index f79445f..1d8b9e4 100644 --- a/Bullet.tscn +++ b/Bullet.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://Bullet.gd" type="Script" id=1] -[ext_resource path="res://icon.png" type="Texture" id=2] +[ext_resource path="res://assets/bullet.png" type="Texture" id=2] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 31, 31 ) @@ -13,4 +13,5 @@ script = ExtResource( 1 ) shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="."] +scale = Vector2( 0.05, 0.05 ) texture = ExtResource( 2 ) diff --git a/KinematicBody2D.gd b/KinematicBody2D.gd index 96484f3..4f2949c 100644 --- a/KinematicBody2D.gd +++ b/KinematicBody2D.gd @@ -34,5 +34,5 @@ func _physics_process(delta): get_owner().add_child(obj) var bodies = get_overlapping_bodies() for body in bodies: - if not "Bullet" in body.get_name(): + if body.get_name() != "Bullet": emit_signal("hit", delta) diff --git a/Player.tscn b/Player.tscn index 9fd285e..6c2c34a 100644 --- a/Player.tscn +++ b/Player.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://KinematicBody2D.gd" type="Script" id=1] -[ext_resource path="res://icon.png" type="Texture" id=2] +[ext_resource path="res://assets/htm_tex.png" type="Texture" id=2] [sub_resource type="CircleShape2D" id=1] @@ -13,5 +13,5 @@ shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="CollisionShape2D"] position = Vector2( -1, -4 ) -scale = Vector2( 0.515625, 0.53125 ) +scale = Vector2( 0.03, 0.03 ) texture = ExtResource( 2 ) diff --git a/assets/htm_tex.png b/assets/htm_tex.png new file mode 100644 index 0000000..039e2e3 Binary files /dev/null and b/assets/htm_tex.png differ -- cgit v1.2.3-70-g09d2