first commit
This commit is contained in:
29
Scripts/revolver.gd
Normal file
29
Scripts/revolver.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends Node3D
|
||||
|
||||
var bullet_target_pos = Vector3(2.231,0.03,4.612)
|
||||
|
||||
var loaded_bullets = Array()
|
||||
var max_bullets: int = 6
|
||||
var current_round: int = 0
|
||||
|
||||
|
||||
@export var is_player_revolver: bool = false
|
||||
@export var cylinder: Node3D
|
||||
|
||||
var is_cylinder_out: bool = false
|
||||
func _ready() -> void:
|
||||
if is_player_revolver:
|
||||
GameManager.set_player_revolver(self)
|
||||
else:
|
||||
GameManager.set_enemy_revolver(self)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if is_cylinder_out:
|
||||
cylinder.position = lerp(cylinder.position, Vector3(1.947,0.543,3.979), delta/ 0.1)
|
||||
else:
|
||||
cylinder.position = lerp(cylinder.position, Vector3(0,0.543,3.979), delta/ 0.1)
|
||||
func load_bullet(bullet_object):
|
||||
bullet_object.moveTo(to_global(bullet_target_pos))
|
||||
is_cylinder_out = true
|
||||
func shoot():
|
||||
pass
|
||||
Reference in New Issue
Block a user