fix player bullet pos

main
Just Dzhi 2023-10-01 19:54:33 +04:00
parent 797a133252
commit fae81e7d82
2 changed files with 8 additions and 8 deletions

View File

@ -5,10 +5,10 @@
[ext_resource path="res://res/shaders/colorize.tres" type="Material" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 4, 4 )
extents = Vector2( 3.5, 3.5 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 7, 11 )
extents = Vector2( 3.5, 9 )
[sub_resource type="Animation" id=4]
resource_name = "RESET"
@ -48,7 +48,7 @@ tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.9 ),
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ true, false ]
@ -83,7 +83,7 @@ shape = SubResource( 1 )
[node name="EnemyCollision" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyCollision"]
position = Vector2( 12, 12 )
position = Vector2( 11.5, 14 )
shape = SubResource( 2 )
[node name="DirtCollision" type="Area2D" parent="."]

View File

@ -9,7 +9,7 @@ var recharge_timer = .0
var invincible = false
var target: EnemyClass
var slowed = false
var speed = 100
var speed = 80
var draw_node
var bullet
@ -68,8 +68,8 @@ func _shoot():
bullet = bullet_preload.instance()
bullet.target = target
get_parent().add_child(bullet)
bullet.global_position.x = self.global_position.x + 12
bullet.global_position.y = self.global_position.y - 4
bullet.global_position.x = self.global_position.x + 8
bullet.global_position.y = self.global_position.y + 8
func _draw():
if target != null and is_instance_valid(target):
@ -107,7 +107,7 @@ func _physics_process(delta):
invincible = false
if slowed:
speed_multiplier = 0.18
speed_multiplier = 0.22
else:
speed_multiplier = 1.0