diff --git a/project.godot b/project.godot index d4bb446..2205cee 100644 --- a/project.godot +++ b/project.godot @@ -41,42 +41,42 @@ fps=false input_right={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_left={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_up={ "deadzone": 0.49, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_down={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_debug={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_enter={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_shift={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } input_shoot={ @@ -86,32 +86,32 @@ input_shoot={ } esc={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } rotation_increase={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } rotation_decrease={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } line={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } sine={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } hyper={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } parab={ diff --git a/source/assets/scripts/player_handlers/player_body_handler.gd b/source/assets/scripts/player_handlers/player_body_handler.gd index 676176c..51ad3d7 100644 --- a/source/assets/scripts/player_handlers/player_body_handler.gd +++ b/source/assets/scripts/player_handlers/player_body_handler.gd @@ -2,15 +2,13 @@ extends KinematicBody2D export var debugMode = false -var trajectory:String = 'line' -var trajectory_line = 'line' +var hp = 100 setget set_hp -var bullet -var player_bullet = load("res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn") +var player_bullet = load("res://source/entities/bullet/player_bullet.tscn") var username_text = load("res://source/scenes/OVERLAY/elements/username_text.tscn") var username setget username_set var username_text_instance = null -var hp = 100 setget set_hp + var can_shoot = true var is_reloading = false @@ -24,30 +22,15 @@ puppet var puppet_weapon_angle = 0 puppet var puppet_direction = "left" puppet var puppet_theme = "01" puppet var puppet_character_states = {} -puppet var puppet_bullet_position = Vector2() setget puppet_bullet_position_set + onready var tween = $Tween onready var sprite = $player_sprite onready var reload_timer = $reload_timer -onready var shoot_point = $"weaponHolder/Player-character-theme-gun/shoot_point" +onready var shoot_point = $shoot_point 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 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() @@ -97,6 +80,7 @@ func _ready(): if get_tree().has_network_peer(): if is_network_master(): Global.player_master = self + # Allow update process override. set_process(true) $player_animated_sprite.play("idle") @@ -243,17 +227,16 @@ func _physics_process(delta) -> void: velocityVDIR.y -= deccelerationSpeed velocityVDIR = Vector2(clamp(velocityVDIR.x, -maxMovementSpeed.x, maxMovementSpeed.x), clamp(velocityVDIR.y, -maxMovementSpeed.y, maxMovementSpeed.y)) move_and_slide(velocityVDIR.rotated(rotationalHolder)) - 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: + + + #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() + else: rotation = lerp_angle(rotation, puppet_rotation, delta * 8) #rotation = puppet_rotation $"weaponHolder/Player-character-theme-gun".position = puppet_weapon_position @@ -268,43 +251,18 @@ func _physics_process(delta) -> void: else: $player_animated_sprite.play("idle-speed-"+direction+"-"+theme) $Particles2D.set_emitting(false) - rotate_weapon() + rotate_weapon() if not tween.is_active(): pass + + + if hp <= 0: if get_tree().is_network_server(): 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(): if debugMode: @@ -316,6 +274,15 @@ func _draw(): draw_line(VDIR[v_t][v]["start"] - user_state["global_position"],(VDIR[v_t][v]["ray"]["position"] - user_state["global_position"]).rotated(-rotation),Color(255,255,255,1),1) +func lerp_angle(from, to, weight): + return from + short_angle_dist(from, to) * weight + + +func short_angle_dist(from, to): + var max_angle = PI * 2 + var difference = fmod(to - from, max_angle) + return fmod(2 * difference, max_angle) - difference + func puppet_position_set(new_value) -> void: puppet_position = new_value @@ -323,11 +290,6 @@ func puppet_position_set(new_value) -> void: 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): hp = new_value if get_tree().has_network_peer(): @@ -368,7 +330,15 @@ func _on_network_tick_rate_timeout(): rset_unreliable("puppet_weapon_angle", weaponAngle) rset_unreliable("puppet_direction", direction) #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): @@ -390,7 +360,7 @@ func _on_hit_timer_timeout(): func _on_hitbox_area_entered(area): if get_tree().is_network_server(): - if area.is_in_group("Player_damager"): + if area.is_in_group("Player_damager") and area.get_parent().player_owner != int(name): rpc("hit_by_damager", area.get_parent().damage) area.get_parent().rpc("destroy") @@ -409,7 +379,6 @@ sync func enable() -> void: visible = true $player_collider.disabled = false $hitbox/CollisionShape2D.disabled = false - $weaponHolder.disabled = false if get_tree().has_network_peer(): if is_network_master(): @@ -424,7 +393,6 @@ sync func destroy() -> void: visible = false $player_collider.disabled = true $hitbox/CollisionShape2D.disabled = true - $weaponHolder.disabled = true Global.alive_players.erase(self) if get_tree().has_network_peer(): @@ -460,6 +428,3 @@ func rotate_weapon(): $"weaponHolder/Player-character-theme-gun".position = weaponPosition $"weaponHolder/Player-character-theme-gun".rotation_degrees = weaponAngle pass - - - diff --git a/source/assets/scripts/shooting/Gun_.gd b/source/assets/scripts/shooting/Gun_.gd new file mode 100644 index 0000000..5466602 --- /dev/null +++ b/source/assets/scripts/shooting/Gun_.gd @@ -0,0 +1,59 @@ +extends AnimatedSprite + +var trajectory:String = 'line' +var trajectory_line = 'line' + +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") +} + +func choose_trajectory(): + trajectory + trajectory_line + 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' + + +func shoot(trajectory:String): + var bullet = bullet_env[trajectory].instance() + get_parent().get_parent().get_parent().add_child(bullet) + bullet.global_position = $Shooting_Point.global_position + bullet.global_rotation = $Shooting_Point.global_rotation + pass + + +func enable_trajectory_line(trajectory_line:String): + var x = bullet_trajectory[trajectory_line].instance() + get_parent().get_parent().get_parent().add_child(x) + x.global_position = $Shooting_Point.global_position + x.global_rotation = $Shooting_Point.global_rotation + + + +func _process(delta): + choose_trajectory() + enable_trajectory_line(trajectory_line) + if Input.is_action_just_pressed("input_shoot"): + pass + elif Input.is_action_just_released("input_shoot"): + shoot(trajectory) diff --git a/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd index 6f77fdf..a645cb8 100644 --- a/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd +++ b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd @@ -1,6 +1,5 @@ extends Sprite -export(int) var damage = 25 var velocity = Vector2() var speed_hyper = 100 var time = 0.05 diff --git a/source/assets/scripts/shooting/Line/Line_Bullet.gd b/source/assets/scripts/shooting/Line/Line_Bullet.gd index 6d0a906..1eda890 100644 --- a/source/assets/scripts/shooting/Line/Line_Bullet.gd +++ b/source/assets/scripts/shooting/Line/Line_Bullet.gd @@ -1,6 +1,5 @@ extends Sprite -export(int) var damage = 25 export var speed_line = 1000 var velocity = Vector2() @@ -13,6 +12,7 @@ func follow_line_trajectory(): velocity.y = time*a_parameter + func _process(delta): follow_line_trajectory() time += delta diff --git a/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd index 29c5a44..190e7c7 100644 --- a/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd +++ b/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd @@ -1,7 +1,6 @@ extends Sprite -export(int) var damage = 25 -export(int) var speed_parab = 100 +export var speed_parab = 100 var velocity = Vector2() var time = 0 diff --git a/source/assets/scripts/shooting/Sine/Sine_Bullet.gd b/source/assets/scripts/shooting/Sine/Sine_Bullet.gd index 77368f7..c35522e 100644 --- a/source/assets/scripts/shooting/Sine/Sine_Bullet.gd +++ b/source/assets/scripts/shooting/Sine/Sine_Bullet.gd @@ -1,7 +1,6 @@ extends Sprite -export(int) var damage = 25 -export(int) var speed = 100 +export var speed = 100 var velocity = Vector2() var time = 0 diff --git a/source/assets/scripts/ui_element_handlers/game_UI.gd b/source/assets/scripts/ui_element_handlers/game_UI.gd index f2e07d4..279f5a9 100644 --- a/source/assets/scripts/ui_element_handlers/game_UI.gd +++ b/source/assets/scripts/ui_element_handlers/game_UI.gd @@ -1,7 +1,7 @@ extends CanvasLayer # if 0, then singleplayer will work, if 1, then multiplayer only -var winner_amount = 1 +var winner_amount = 0 onready var win_timer = $Control/winner/win_timer onready var winner = $Control/winner diff --git a/source/entities/player/player_node.tscn b/source/entities/player/player_node.tscn index a090827..84826d6 100644 --- a/source/entities/player/player_node.tscn +++ b/source/entities/player/player_node.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=175 format=2] +[gd_scene load_steps=177 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/scripts/player_handlers/player_collider_handler.gd" type="Script" id=2] @@ -15,6 +15,7 @@ [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 – 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/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] @@ -165,6 +166,7 @@ [ext_resource path="res://source/assets/sprites/character/player/theme/04/animation/left_r/Player-character-theme-01_anim-idle – 89.png" type="Texture" id=165] [ext_resource path="res://source/assets/sprites/character/player/theme/04/animation/left_r/Player-character-theme-04_anim-idle – 1.png" type="Texture" id=166] [ext_resource path="res://source/assets/sprites/character/player/theme/02/animation/right_r/Player-character-theme-01_anim-idle – 98.png" type="Texture" id=167] +[ext_resource path="res://source/assets/sprites/character/player/theme/03/na/Player-character-theme-gun-03.png" type="Texture" id=168] [ext_resource path="res://source/assets/sprites/character/player/theme/04/na/Player-character-theme-gun-04.png" type="Texture" id=169] [ext_resource path="res://source/assets/sprites/character/player/theme/02/na/Player-character-theme-gun-02.png" type="Texture" id=170] [ext_resource path="res://source/assets/sprites/character/player/theme/Player-character-theme-gun-05.png" type="Texture" id=171] @@ -195,7 +197,7 @@ animations = [ { }, { "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-left-01", +"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 ) ], @@ -213,10 +215,10 @@ animations = [ { "name": "boost-speed-right-02", "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( 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-left-04", -"speed": 50.0 +"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, @@ -230,6 +232,7 @@ animations = [ { }, { "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, +<<<<<<< HEAD "name": "idle-speed-left-04", "speed": 25.0 }, { @@ -244,6 +247,14 @@ animations = [ { "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": "move-speed-left-03", +======= +"name": "move-speed-right-01", +"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": "move-speed-left-01", +>>>>>>> parent of 64808b0 (Merge branch 'master' of https://github.com/KristofersSolo/Godot) "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 ) ], @@ -286,11 +297,6 @@ animations = [ { "loop": true, "name": "move-speed-left-04", "speed": 35.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 } ] [sub_resource type="RectangleShape2D" id=3] @@ -331,9 +337,9 @@ animations = [ { "name": "02", "speed": 5.0 }, { -"frames": [ ExtResource( 170 ) ], +"frames": [ ExtResource( 27 ) ], "loop": true, -"name": "02", +"name": "01", "speed": 5.0 }, { "frames": [ ExtResource( 169 ) ], @@ -342,10 +348,7 @@ animations = [ { "speed": 5.0 } ] -[node name="player" type="KinematicBody2D" groups=[ -"Net", -"Player", -]] +[node name="player" type="KinematicBody2D" groups=["Net", "Player"]] script = ExtResource( 11 ) [node name="player_collider" type="CollisionShape2D" parent="."] @@ -395,20 +398,21 @@ texture = ExtResource( 26 ) [node name="weaponHolder" type="CollisionShape2D" parent="."] 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"] scale = Vector2( 0.25, 0.25 ) frames = SubResource( 6 ) animation = "04" +script = ExtResource( 16 ) -[node name="shoot_point" type="Position2D" parent="weaponHolder/Player-character-theme-gun"] +[node name="Shooting_Point" type="Position2D" parent="weaponHolder/Player-character-theme-gun"] position = Vector2( -120, 0 ) rotation = 3.14159 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="reload_timer" to="." method="_on_reload_timer_timeout"] [connection signal="timeout" from="hit_timer" to="." method="_on_hit_timer_timeout"] diff --git a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn index 9a0d2f8..200bc31 100644 --- a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn +++ b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn @@ -5,15 +5,11 @@ [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 ) 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"] rotation = 1.5708 diff --git a/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn b/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn index 4cdb733..2f5ea2b 100644 --- a/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn +++ b/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn @@ -5,15 +5,11 @@ [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 ) 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"] rotation = 1.5708 diff --git a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn index 391d84f..9157426 100644 --- a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn +++ b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn @@ -5,15 +5,11 @@ [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 ) 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"] rotation = 1.5708 diff --git a/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn b/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn index 536bf28..3acf27f 100644 --- a/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn +++ b/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn @@ -5,15 +5,11 @@ [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 ) 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"] rotation = 1.5708 diff --git a/source/levels/trinity_site/trinity_site_level.tscn b/source/levels/trinity_site/trinity_site_level.tscn index 1867346..f9d472b 100644 --- a/source/levels/trinity_site/trinity_site_level.tscn +++ b/source/levels/trinity_site/trinity_site_level.tscn @@ -106,19 +106,19 @@ z_index = -3 [node name="spawn_locations" type="Node" parent="."] [node name="1" type="Position2D" parent="spawn_locations"] -position = Vector2( 138.53, 694.841 ) +position = Vector2( 260, 540 ) z_index = 1 [node name="2" type="Position2D" parent="spawn_locations"] -position = Vector2( 677.446, 912.1 ) +position = Vector2( 460, 540 ) z_index = 1 [node name="3" type="Position2D" parent="spawn_locations"] -position = Vector2( 1174.91, 949.813 ) +position = Vector2( 1460, 540 ) z_index = 1 [node name="4" type="Position2D" parent="spawn_locations"] -position = Vector2( 1645.35, 803.706 ) +position = Vector2( 1640, 540 ) z_index = 1 [node name="UI" type="CanvasLayer" parent="."] @@ -131,7 +131,6 @@ script = ExtResource( 6 ) anchor_right = 1.0 anchor_bottom = 1.0 __meta__ = { -"_edit_lock_": true, "_edit_use_anchors_": false } @@ -143,16 +142,15 @@ margin_left = 2.37842 margin_top = -35.5 margin_right = 2.37842 margin_bottom = 106.5 -custom_fonts/font = SubResource( 1 ) custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) custom_constants/shadow_offset_x = 6 custom_constants/shadow_offset_y = 6 +custom_fonts/font = SubResource( 1 ) text = "You are the winner" align = 1 valign = 1 script = ExtResource( 5 ) __meta__ = { -"_edit_lock_": true, "_edit_use_anchors_": false } diff --git a/source/scenes/GUI/main_menu.tscn b/source/scenes/GUI/main_menu.tscn index 175e14c..c5aa6bf 100644 --- a/source/scenes/GUI/main_menu.tscn +++ b/source/scenes/GUI/main_menu.tscn @@ -51,8 +51,8 @@ margin_left = -150.0 margin_top = -36.0 margin_right = 150.0 margin_bottom = 36.0 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "PLAY" align = 1 valign = 1 @@ -76,8 +76,8 @@ margin_left = -98.8223 margin_top = -36.0 margin_right = 134.178 margin_bottom = 36.0 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "LAN Party" align = 1 valign = 1 @@ -108,8 +108,8 @@ margin_left = -150.0 margin_top = -36.0 margin_right = 150.0 margin_bottom = 36.0 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "EXIT" align = 1 valign = 1 @@ -123,8 +123,8 @@ margin_left = 1798.91 margin_top = 989.536 margin_right = 1889.91 margin_bottom = 1061.54 -custom_fonts/font = ExtResource( 8 ) custom_colors/font_color_disabled = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 8 ) __meta__ = { "_edit_use_anchors_": false }