Synced bullets

This commit is contained in:
Kristofers Solo 2021-11-11 16:05:08 +02:00
parent abdace6d1d
commit 2722f28b64
13 changed files with 168 additions and 110 deletions

View File

@ -2,13 +2,15 @@ extends KinematicBody2D
export var debugMode = false export var debugMode = false
var hp = 100 setget set_hp var trajectory:String = 'line'
var trajectory_line = 'line'
var player_bullet = load("res://source/entities/bullet/player_bullet.tscn") var bullet
var player_bullet = load("res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn")
var username_text = load("res://source/scenes/OVERLAY/elements/username_text.tscn") var username_text = load("res://source/scenes/OVERLAY/elements/username_text.tscn")
var username setget username_set var username setget username_set
var username_text_instance = null var username_text_instance = null
var hp = 100 setget set_hp
var can_shoot = true var can_shoot = true
var is_reloading = false var is_reloading = false
@ -22,15 +24,30 @@ puppet var puppet_weapon_angle = 0
puppet var puppet_direction = "left" puppet var puppet_direction = "left"
puppet var puppet_theme = "01" puppet var puppet_theme = "01"
puppet var puppet_character_states = {} puppet var puppet_character_states = {}
puppet var puppet_bullet_position = Vector2() setget puppet_bullet_position_set
onready var tween = $Tween onready var tween = $Tween
onready var sprite = $player_sprite onready var sprite = $player_sprite
onready var reload_timer = $reload_timer onready var reload_timer = $reload_timer
onready var shoot_point = $shoot_point onready var shoot_point = $"weaponHolder/Player-character-theme-gun/shoot_point"
onready var hit_timer = $hit_timer onready var hit_timer = $hit_timer
var bullet_env = {
'line' : preload("res://source/entities/shooting/Line_Trajectory/Line_Env.tscn"),
'sine' : preload("res://source/entities/shooting/Sine_Trajectory/Sine_Env.tscn"),
'parab' : preload("res://source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn"),
'hyper' : preload("res://source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn")
}
var bullet_trajectory = {
'line' : preload("res://source/entities/shooting/Line_Trajectory/Line_Barrel.tscn"),
'sine' : preload("res://source/entities/shooting/Sine_Trajectory/Sine_Barrel.tscn"),
'parab' : preload("res://source/entities/shooting/Parabolic_Trajectory/Parabolic_Barrel.tscn"),
'hyper' : preload("res://source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Barrel.tscn")
}
# Instance of data pre_processors # Instance of data pre_processors
var VDIR_preset_pre_processor_instance = preload("res://source/assets/scripts/pre_processors/vdir_pre_processor.gd").new() var VDIR_preset_pre_processor_instance = preload("res://source/assets/scripts/pre_processors/vdir_pre_processor.gd").new()
var UIN_preset_pre_processor_instance = preload("res://source/assets/scripts/pre_processors/uin_pre_processor.gd").new() var UIN_preset_pre_processor_instance = preload("res://source/assets/scripts/pre_processors/uin_pre_processor.gd").new()
@ -227,15 +244,15 @@ func _physics_process(delta) -> void:
velocityVDIR.y -= deccelerationSpeed velocityVDIR.y -= deccelerationSpeed
velocityVDIR = Vector2(clamp(velocityVDIR.x, -maxMovementSpeed.x, maxMovementSpeed.x), clamp(velocityVDIR.y, -maxMovementSpeed.y, maxMovementSpeed.y)) velocityVDIR = Vector2(clamp(velocityVDIR.x, -maxMovementSpeed.x, maxMovementSpeed.x), clamp(velocityVDIR.y, -maxMovementSpeed.y, maxMovementSpeed.y))
move_and_slide(velocityVDIR.rotated(rotationalHolder)) move_and_slide(velocityVDIR.rotated(rotationalHolder))
#if Input.is_action_pressed("input_shoot") and can_shoot and not is_reloading:
# rpc("instance_bullet", get_tree().get_network_unique_id())
# is_reloading = true
# reload_timer.start()
rotate_weapon() rotate_weapon()
choose_trajectory()
enable_trajectory_line(trajectory_line)
if Input.is_action_just_released("input_shoot") and can_shoot and not is_reloading:
# shoot(trajectory)
rpc("shoot", trajectory, get_tree().get_network_unique_id())
is_reloading = true
reload_timer.start()
else: else:
rotation = lerp_angle(rotation, puppet_rotation, delta * 8) rotation = lerp_angle(rotation, puppet_rotation, delta * 8)
#rotation = puppet_rotation #rotation = puppet_rotation
@ -251,18 +268,42 @@ func _physics_process(delta) -> void:
else: else:
$player_animated_sprite.play("idle-speed-"+direction+"-"+theme) $player_animated_sprite.play("idle-speed-"+direction+"-"+theme)
$Particles2D.set_emitting(false) $Particles2D.set_emitting(false)
rotate_weapon() rotate_weapon()
if not tween.is_active(): if not tween.is_active():
pass pass
if hp <= 0: if hp <= 0:
if get_tree().is_network_server(): if get_tree().is_network_server():
rpc("destroy") rpc("destroy")
func choose_trajectory():
if Input.is_action_just_pressed("line"):
trajectory = 'line'
trajectory_line = 'line'
elif Input.is_action_just_pressed("sine"):
trajectory = 'sine'
trajectory_line = 'sine'
elif Input.is_action_just_pressed("parab"):
trajectory = 'parab'
trajectory_line = 'parab'
elif Input.is_action_just_pressed("hyper"):
trajectory = 'hyper'
trajectory_line = 'hyper'
sync func shoot(trajectory:String, id):
bullet = bullet_env[trajectory].instance()
add_child(bullet)
bullet.global_position = shoot_point.global_position
bullet.global_rotation = shoot_point.global_rotation
func enable_trajectory_line(trajectory_line:String):
var x = bullet_trajectory[trajectory_line].instance()
add_child(x)
x.global_position = shoot_point.global_position
x.global_rotation = shoot_point.global_rotation
func _draw(): func _draw():
if debugMode: if debugMode:
@ -290,6 +331,11 @@ func puppet_position_set(new_value) -> void:
tween.start() tween.start()
func puppet_bullet_position_set(new_value) -> void:
puppet_bullet_position = new_value
tween.interpolate_property(self, "global_position", global_position, puppet_bullet_position, 0.1)
tween.start()
func set_hp(new_value): func set_hp(new_value):
hp = new_value hp = new_value
if get_tree().has_network_peer(): if get_tree().has_network_peer():
@ -330,15 +376,7 @@ func _on_network_tick_rate_timeout():
rset_unreliable("puppet_weapon_angle", weaponAngle) rset_unreliable("puppet_weapon_angle", weaponAngle)
rset_unreliable("puppet_direction", direction) rset_unreliable("puppet_direction", direction)
#rset_unreliable("puppet_character_states", characterStates) #rset_unreliable("puppet_character_states", characterStates)
rset_unreliable("puppet_bullet_position", bullet)
sync func instance_bullet(id):
var player_bullet_instance = Global.instance_node_at_location(player_bullet, PersistentNodes, shoot_point.global_position)
player_bullet_instance.name = "Bullet" + name + str(Network.networked_object_name_index)
player_bullet_instance.set_network_master(id)
player_bullet_instance.player_rotation = rotation
player_bullet_instance.player_owner = id
Network.networked_object_name_index += 1
sync func update_position(pos): sync func update_position(pos):
@ -360,7 +398,7 @@ func _on_hit_timer_timeout():
func _on_hitbox_area_entered(area): func _on_hitbox_area_entered(area):
if get_tree().is_network_server(): if get_tree().is_network_server():
if area.is_in_group("Player_damager") and area.get_parent().player_owner != int(name): if area.is_in_group("Player_damager"):
rpc("hit_by_damager", area.get_parent().damage) rpc("hit_by_damager", area.get_parent().damage)
area.get_parent().rpc("destroy") area.get_parent().rpc("destroy")
@ -428,3 +466,6 @@ func rotate_weapon():
$"weaponHolder/Player-character-theme-gun".position = weaponPosition $"weaponHolder/Player-character-theme-gun".position = weaponPosition
$"weaponHolder/Player-character-theme-gun".rotation_degrees = weaponAngle $"weaponHolder/Player-character-theme-gun".rotation_degrees = weaponAngle
pass pass

View File

@ -18,8 +18,6 @@ var bullet_trajectory = {
} }
func choose_trajectory(): func choose_trajectory():
trajectory
trajectory_line
if Input.is_action_just_pressed("line"): if Input.is_action_just_pressed("line"):
trajectory = 'line' trajectory = 'line'
trajectory_line = 'line' trajectory_line = 'line'
@ -39,7 +37,6 @@ func shoot(trajectory:String):
get_parent().get_parent().get_parent().add_child(bullet) get_parent().get_parent().get_parent().add_child(bullet)
bullet.global_position = $Shooting_Point.global_position bullet.global_position = $Shooting_Point.global_position
bullet.global_rotation = $Shooting_Point.global_rotation bullet.global_rotation = $Shooting_Point.global_rotation
pass
func enable_trajectory_line(trajectory_line:String): func enable_trajectory_line(trajectory_line:String):
@ -53,7 +50,5 @@ func enable_trajectory_line(trajectory_line:String):
func _process(delta): func _process(delta):
choose_trajectory() choose_trajectory()
enable_trajectory_line(trajectory_line) enable_trajectory_line(trajectory_line)
if Input.is_action_just_pressed("input_shoot"): # if Input.is_action_just_released("input_shoot"):
pass # shoot(trajectory)
elif Input.is_action_just_released("input_shoot"):
shoot(trajectory)

View File

@ -1,5 +1,6 @@
extends Sprite extends Sprite
export(int) var damage = 25
var velocity = Vector2() var velocity = Vector2()
var speed_hyper = 100 var speed_hyper = 100
var time = 0.05 var time = 0.05

View File

@ -1,5 +1,6 @@
extends Sprite extends Sprite
export(int) var damage = 25
export var speed_line = 1000 export var speed_line = 1000
var velocity = Vector2() var velocity = Vector2()
@ -12,7 +13,6 @@ func follow_line_trajectory():
velocity.y = time*a_parameter velocity.y = time*a_parameter
func _process(delta): func _process(delta):
follow_line_trajectory() follow_line_trajectory()
time += delta time += delta

View File

@ -1,6 +1,7 @@
extends Sprite extends Sprite
export var speed_parab = 100 export(int) var damage = 25
export(int) var speed_parab = 100
var velocity = Vector2() var velocity = Vector2()
var time = 0 var time = 0

View File

@ -1,6 +1,7 @@
extends Sprite extends Sprite
export var speed = 100 export(int) var damage = 25
export(int) var speed = 100
var velocity = Vector2() var velocity = Vector2()
var time = 0 var time = 0

View File

@ -1,7 +1,7 @@
extends CanvasLayer extends CanvasLayer
# if 0, then singleplayer will work, if 1, then multiplayer only # if 0, then singleplayer will work, if 1, then multiplayer only
var winner_amount = 0 var winner_amount = 1
onready var win_timer = $Control/winner/win_timer onready var win_timer = $Control/winner/win_timer
onready var winner = $Control/winner onready var winner = $Control/winner

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=177 format=2] [gd_scene load_steps=176 format=2]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/na/Player-character-theme-01.png" type="Texture" id=1] [ext_resource path="res://source/assets/sprites/character/player/theme/01/na/Player-character-theme-01.png" type="Texture" id=1]
[ext_resource path="res://source/assets/scripts/player_handlers/player_collider_handler.gd" type="Script" id=2] [ext_resource path="res://source/assets/scripts/player_handlers/player_collider_handler.gd" type="Script" id=2]
@ -15,7 +15,6 @@
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 7.png" type="Texture" id=13] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 7.png" type="Texture" id=13]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 12.png" type="Texture" id=14] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 12.png" type="Texture" id=14]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 10.png" type="Texture" id=15] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 10.png" type="Texture" id=15]
[ext_resource path="res://source/assets/scripts/shooting/Gun_.gd" type="Script" id=16]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 18.png" type="Texture" id=18] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 18.png" type="Texture" id=18]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/right_r/Player-character-theme-01_anim-idle 34.png" type="Texture" id=19] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/right_r/Player-character-theme-01_anim-idle 34.png" type="Texture" id=19]
[ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 17.png" type="Texture" id=20] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle 17.png" type="Texture" id=20]
@ -175,35 +174,20 @@
[sub_resource type="SpriteFrames" id=2] [sub_resource type="SpriteFrames" id=2]
animations = [ { animations = [ {
"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ],
"loop": true,
"name": "idle-speed-right-02",
"speed": 25.0
}, {
"frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ], "frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ],
"loop": true, "loop": true,
"name": "boost-speed-right-04", "name": "move-speed-right-04",
"speed": 50.0
}, {
"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ],
"loop": true,
"name": "boost-speed-right-03",
"speed": 50.0
}, {
"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ],
"loop": true,
"name": "move-speed-right-03",
"speed": 35.0 "speed": 35.0
}, { }, {
"frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ], "frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ],
"loop": true, "loop": true,
"name": "idle-speed-right-04", "name": "boost-speed-left-01",
"speed": 25.0 "speed": 50.0
}, { }, {
"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], "frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ],
"loop": true, "loop": true,
"name": "idle-speed-left-04", "name": "move-speed-left-04",
"speed": 25.0 "speed": 35.0
}, { }, {
"frames": [ ExtResource( 73 ), ExtResource( 57 ), ExtResource( 65 ), ExtResource( 64 ), ExtResource( 54 ), ExtResource( 71 ), ExtResource( 58 ), ExtResource( 66 ), ExtResource( 62 ), ExtResource( 59 ), ExtResource( 56 ), ExtResource( 60 ), ExtResource( 63 ), ExtResource( 50 ), ExtResource( 61 ), ExtResource( 67 ), ExtResource( 72 ), ExtResource( 51 ), ExtResource( 68 ), ExtResource( 69 ) ], "frames": [ ExtResource( 73 ), ExtResource( 57 ), ExtResource( 65 ), ExtResource( 64 ), ExtResource( 54 ), ExtResource( 71 ), ExtResource( 58 ), ExtResource( 66 ), ExtResource( 62 ), ExtResource( 59 ), ExtResource( 56 ), ExtResource( 60 ), ExtResource( 63 ), ExtResource( 50 ), ExtResource( 61 ), ExtResource( 67 ), ExtResource( 72 ), ExtResource( 51 ), ExtResource( 68 ), ExtResource( 69 ) ],
"loop": true, "loop": true,
@ -215,16 +199,6 @@ animations = [ {
"name": "boost-speed-right-02", "name": "boost-speed-right-02",
"speed": 50.0 "speed": 50.0
}, { }, {
"frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ],
"loop": true,
"name": "move-speed-right-04",
"speed": 35.0
}, {
"frames": [ ExtResource( 48 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 32 ), ExtResource( 13 ), ExtResource( 40 ), ExtResource( 6 ), ExtResource( 15 ), ExtResource( 22 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 37 ), ExtResource( 23 ), ExtResource( 39 ), ExtResource( 20 ), ExtResource( 18 ), ExtResource( 7 ), ExtResource( 34 ) ],
"loop": true,
"name": "boost-speed-left-01",
"speed": 50.0
}, {
"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], "frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ],
"loop": true, "loop": true,
"name": "boost-speed-right-01", "name": "boost-speed-right-01",
@ -235,6 +209,11 @@ animations = [ {
"name": "move-speed-right-01", "name": "move-speed-right-01",
"speed": 35.0 "speed": 35.0
}, { }, {
"frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ],
"loop": true,
"name": "boost-speed-right-04",
"speed": 50.0
}, {
"frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ], "frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ],
"loop": true, "loop": true,
"name": "move-speed-left-03", "name": "move-speed-left-03",
@ -245,16 +224,6 @@ animations = [ {
"name": "move-speed-left-01", "name": "move-speed-left-01",
"speed": 35.0 "speed": 35.0
}, { }, {
"frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ],
"loop": true,
"name": "boost-speed-left-03",
"speed": 50.0
}, {
"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ],
"loop": true,
"name": "move-speed-right-02",
"speed": 35.0
}, {
"frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ], "frames": [ ExtResource( 5 ), ExtResource( 42 ), ExtResource( 35 ), ExtResource( 24 ), ExtResource( 8 ), ExtResource( 31 ), ExtResource( 30 ), ExtResource( 38 ), ExtResource( 10 ), ExtResource( 43 ), ExtResource( 41 ), ExtResource( 33 ), ExtResource( 44 ), ExtResource( 19 ), ExtResource( 29 ), ExtResource( 25 ), ExtResource( 36 ), ExtResource( 12 ), ExtResource( 45 ), ExtResource( 21 ) ],
"loop": true, "loop": true,
"name": "idle-speed-right-01", "name": "idle-speed-right-01",
@ -265,6 +234,16 @@ animations = [ {
"name": "idle-speed-left-02", "name": "idle-speed-left-02",
"speed": 25.0 "speed": 25.0
}, { }, {
"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ],
"loop": true,
"name": "boost-speed-right-03",
"speed": 50.0
}, {
"frames": [ ExtResource( 114 ), ExtResource( 128 ), ExtResource( 93 ), ExtResource( 107 ), ExtResource( 117 ), ExtResource( 102 ), ExtResource( 81 ), ExtResource( 118 ), ExtResource( 76 ), ExtResource( 115 ), ExtResource( 127 ), ExtResource( 123 ), ExtResource( 113 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 124 ), ExtResource( 94 ), ExtResource( 112 ), ExtResource( 131 ), ExtResource( 95 ) ],
"loop": true,
"name": "move-speed-right-03",
"speed": 35.0
}, {
"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], "frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ],
"loop": true, "loop": true,
"name": "boost-speed-left-04", "name": "boost-speed-left-04",
@ -275,9 +254,29 @@ animations = [ {
"name": "idle-speed-left-01", "name": "idle-speed-left-01",
"speed": 25.0 "speed": 25.0
}, { }, {
"frames": [ ExtResource( 99 ), ExtResource( 83 ), ExtResource( 109 ), ExtResource( 111 ), ExtResource( 101 ), ExtResource( 96 ), ExtResource( 79 ), ExtResource( 132 ), ExtResource( 119 ), ExtResource( 80 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 106 ), ExtResource( 121 ), ExtResource( 129 ), ExtResource( 100 ), ExtResource( 108 ), ExtResource( 110 ), ExtResource( 120 ) ],
"loop": true,
"name": "idle-speed-right-04",
"speed": 25.0
}, {
"frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ], "frames": [ ExtResource( 162 ), ExtResource( 135 ), ExtResource( 146 ), ExtResource( 141 ), ExtResource( 143 ), ExtResource( 163 ), ExtResource( 149 ), ExtResource( 136 ), ExtResource( 154 ), ExtResource( 137 ), ExtResource( 165 ), ExtResource( 142 ), ExtResource( 139 ), ExtResource( 159 ), ExtResource( 140 ), ExtResource( 155 ), ExtResource( 144 ), ExtResource( 151 ), ExtResource( 153 ), ExtResource( 166 ) ],
"loop": true, "loop": true,
"name": "move-speed-left-04", "name": "idle-speed-left-04",
"speed": 25.0
}, {
"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ],
"loop": true,
"name": "idle-speed-right-02",
"speed": 25.0
}, {
"frames": [ ExtResource( 70 ), ExtResource( 49 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 28 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 55 ), ExtResource( 150 ), ExtResource( 156 ), ExtResource( 138 ), ExtResource( 161 ), ExtResource( 145 ), ExtResource( 148 ), ExtResource( 147 ), ExtResource( 133 ), ExtResource( 164 ), ExtResource( 134 ), ExtResource( 152 ), ExtResource( 160 ) ],
"loop": true,
"name": "boost-speed-left-03",
"speed": 50.0
}, {
"frames": [ ExtResource( 167 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 126 ), ExtResource( 90 ), ExtResource( 89 ), ExtResource( 97 ), ExtResource( 88 ), ExtResource( 98 ), ExtResource( 91 ), ExtResource( 125 ), ExtResource( 105 ), ExtResource( 82 ), ExtResource( 84 ), ExtResource( 92 ), ExtResource( 103 ), ExtResource( 122 ), ExtResource( 130 ), ExtResource( 104 ), ExtResource( 116 ) ],
"loop": true,
"name": "move-speed-right-02",
"speed": 35.0 "speed": 35.0
} ] } ]
@ -314,11 +313,6 @@ animations = [ {
"name": "03", "name": "03",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ ExtResource( 27 ) ],
"loop": true,
"name": "01",
"speed": 5.0
}, {
"frames": [ ExtResource( 170 ) ], "frames": [ ExtResource( 170 ) ],
"loop": true, "loop": true,
"name": "02", "name": "02",
@ -328,9 +322,17 @@ animations = [ {
"loop": true, "loop": true,
"name": "04", "name": "04",
"speed": 5.0 "speed": 5.0
}, {
"frames": [ ExtResource( 27 ) ],
"loop": true,
"name": "01",
"speed": 5.0
} ] } ]
[node name="player" type="KinematicBody2D" groups=["Net", "Player"]] [node name="player" type="KinematicBody2D" groups=[
"Net",
"Player",
]]
script = ExtResource( 11 ) script = ExtResource( 11 )
[node name="player_collider" type="CollisionShape2D" parent="."] [node name="player_collider" type="CollisionShape2D" parent="."]
@ -380,21 +382,20 @@ texture = ExtResource( 26 )
[node name="weaponHolder" type="CollisionShape2D" parent="."] [node name="weaponHolder" type="CollisionShape2D" parent="."]
shape = SubResource( 5 ) shape = SubResource( 5 )
[node name="Player-character-theme-gun-na3" type="Sprite" parent="weaponHolder"]
scale = Vector2( 0.3, 0.25 )
texture = ExtResource( 171 )
[node name="Player-character-theme-gun" type="AnimatedSprite" parent="weaponHolder"] [node name="Player-character-theme-gun" type="AnimatedSprite" parent="weaponHolder"]
scale = Vector2( 0.25, 0.25 ) scale = Vector2( 0.25, 0.25 )
frames = SubResource( 6 ) frames = SubResource( 6 )
animation = "04" animation = "04"
script = ExtResource( 16 )
[node name="Shooting_Point" type="Position2D" parent="weaponHolder/Player-character-theme-gun"] [node name="shoot_point" type="Position2D" parent="weaponHolder/Player-character-theme-gun"]
position = Vector2( -120, 0 ) position = Vector2( -120, 0 )
rotation = 3.14159 rotation = 3.14159
scale = Vector2( 4, 4 ) scale = Vector2( 4, 4 )
[node name="Player-character-theme-gun-na3" type="Sprite" parent="weaponHolder"]
scale = Vector2( 0.3, 0.25 )
texture = ExtResource( 171 )
[connection signal="timeout" from="network_tick_rate" to="." method="_on_network_tick_rate_timeout"] [connection signal="timeout" from="network_tick_rate" to="." method="_on_network_tick_rate_timeout"]
[connection signal="timeout" from="reload_timer" to="." method="_on_reload_timer_timeout"] [connection signal="timeout" from="reload_timer" to="." method="_on_reload_timer_timeout"]
[connection signal="timeout" from="hit_timer" to="." method="_on_hit_timer_timeout"] [connection signal="timeout" from="hit_timer" to="." method="_on_hit_timer_timeout"]

View File

@ -5,11 +5,15 @@
[sub_resource type="CapsuleShape2D" id=1] [sub_resource type="CapsuleShape2D" id=1]
[node name="playert_bullet" type="Sprite" groups=["Net"]] [node name="playert_bullet" type="Sprite" groups=[
"Net",
]]
texture = ExtResource( 1 ) texture = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]] [node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] [node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
rotation = 1.5708 rotation = 1.5708

View File

@ -5,11 +5,15 @@
[sub_resource type="CapsuleShape2D" id=1] [sub_resource type="CapsuleShape2D" id=1]
[node name="player_bullet" type="Sprite" groups=["Net"]] [node name="player_bullet" type="Sprite" groups=[
"Net",
]]
texture = ExtResource( 1 ) texture = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]] [node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] [node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
rotation = 1.5708 rotation = 1.5708

View File

@ -5,11 +5,15 @@
[sub_resource type="CapsuleShape2D" id=1] [sub_resource type="CapsuleShape2D" id=1]
[node name="player_bullet" type="Sprite" groups=["Net"]] [node name="player_bullet" type="Sprite" groups=[
"Net",
]]
texture = ExtResource( 1 ) texture = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]] [node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] [node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
rotation = 1.5708 rotation = 1.5708

View File

@ -5,11 +5,15 @@
[sub_resource type="CapsuleShape2D" id=1] [sub_resource type="CapsuleShape2D" id=1]
[node name="player_bullet" type="Sprite" groups=["Net"]] [node name="player_bullet" type="Sprite" groups=[
"Net",
]]
texture = ExtResource( 1 ) texture = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="hitbox" type="Area2D" parent="." groups=["Player_damager"]] [node name="hitbox" type="Area2D" parent="." groups=[
"Player_damager",
]]
[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] [node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"]
rotation = 1.5708 rotation = 1.5708

View File

@ -106,19 +106,19 @@ z_index = -3
[node name="spawn_locations" type="Node" parent="."] [node name="spawn_locations" type="Node" parent="."]
[node name="1" type="Position2D" parent="spawn_locations"] [node name="1" type="Position2D" parent="spawn_locations"]
position = Vector2( 260, 540 ) position = Vector2( 138.53, 694.841 )
z_index = 1 z_index = 1
[node name="2" type="Position2D" parent="spawn_locations"] [node name="2" type="Position2D" parent="spawn_locations"]
position = Vector2( 460, 540 ) position = Vector2( 677.446, 912.1 )
z_index = 1 z_index = 1
[node name="3" type="Position2D" parent="spawn_locations"] [node name="3" type="Position2D" parent="spawn_locations"]
position = Vector2( 1460, 540 ) position = Vector2( 1174.91, 949.813 )
z_index = 1 z_index = 1
[node name="4" type="Position2D" parent="spawn_locations"] [node name="4" type="Position2D" parent="spawn_locations"]
position = Vector2( 1640, 540 ) position = Vector2( 1645.35, 803.706 )
z_index = 1 z_index = 1
[node name="UI" type="CanvasLayer" parent="."] [node name="UI" type="CanvasLayer" parent="."]
@ -131,6 +131,7 @@ script = ExtResource( 6 )
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
__meta__ = { __meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
@ -142,15 +143,16 @@ margin_left = 2.37842
margin_top = -35.5 margin_top = -35.5
margin_right = 2.37842 margin_right = 2.37842
margin_bottom = 106.5 margin_bottom = 106.5
custom_fonts/font = SubResource( 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
custom_constants/shadow_offset_x = 6 custom_constants/shadow_offset_x = 6
custom_constants/shadow_offset_y = 6 custom_constants/shadow_offset_y = 6
custom_fonts/font = SubResource( 1 )
text = "You are the winner" text = "You are the winner"
align = 1 align = 1
valign = 1 valign = 1
script = ExtResource( 5 ) script = ExtResource( 5 )
__meta__ = { __meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }