fix some bug and new export

This commit is contained in:
2025-09-09 23:52:08 +02:00
parent c0bf7b0fb8
commit 09c0dfe072
24 changed files with 261 additions and 49 deletions

BIN
audio/424911-impactshort78.wav LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://mlm2gi1vqj4b"
path="res://.godot/imported/424911-impactshort78.wav-257263c1fac0ad6fb84544e982ae2c50.sample"
[deps]
source_file="res://audio/424911-impactshort78.wav"
dest_files=["res://.godot/imported/424911-impactshort78.wav-257263c1fac0ad6fb84544e982ae2c50.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

BIN
audio/exodus.ogg LFS Normal file

Binary file not shown.

19
audio/exodus.ogg.import Normal file
View File

@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://cl51j74n0rubn"
path="res://.godot/imported/exodus.ogg-80a0e79c790a2d8dd2090aca2e7a5833.oggvorbisstr"
[deps]
source_file="res://audio/exodus.ogg"
dest_files=["res://.godot/imported/exodus.ogg-80a0e79c790a2d8dd2090aca2e7a5833.oggvorbisstr"]
[params]
loop=false
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://tmrih6eoxo2a"
path="res://.godot/imported/flopp med underleppa (flanger9).wav-8cf59f0b02fb1805837b6934c23caee6.sample"
[deps]
source_file="res://audio/flopp med underleppa (flanger9).wav"
dest_files=["res://.godot/imported/flopp med underleppa (flanger9).wav-8cf59f0b02fb1805837b6934c23caee6.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

BIN
audio/lose sound 2 - 1_0.wav LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://c85io0gs75sb8"
path="res://.godot/imported/lose sound 2 - 1_0.wav-94acd714b6b6175adeda25f4779a07f6.sample"
[deps]
source_file="res://audio/lose sound 2 - 1_0.wav"
dest_files=["res://.godot/imported/lose sound 2 - 1_0.wav-94acd714b6b6175adeda25f4779a07f6.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

BIN
export_files/banner.png LFS Normal file

Binary file not shown.

9
export_files/game.conf Normal file
View File

@@ -0,0 +1,9 @@
[PixelArcadePackage]
name = "Azzteroid"
platform = linux
exec = "asteroid.x86_64"
desciption = "Un jeu où tu fais pioupiou sur des astéroïdes !"
categories = ["ZZ", "2PLAYER", "ARCADE", "PC"]
controls = ["JOYSTICK_P1", "P1_1", "JOYSTICK_P2", "P1_2"]
editor = "Dukantic Aubin Dorival"
year = "2025"

BIN
export_files/hero.png LFS Normal file

Binary file not shown.

BIN
export_files/icon.png LFS Normal file

Binary file not shown.

BIN
export_files/theme.ogg LFS Normal file

Binary file not shown.

View File

@@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../Export/asteroid.x86_64" export_path="../../export/Azzteroid.x86_64"
patches=PackedStringArray() patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""

View File

@@ -11,7 +11,22 @@ var is_multiplayer := false
var actual_score := 0 var actual_score := 0
var score :Score var score :Score
var delay_btw_input = 0.2
var current_ui = ""
var delay_input := 0.0
var music = AudioStreamPlayer.new()
func _music_finished():
music.play()
func _ready() -> void: func _ready() -> void:
music.volume_db = -10
music.autoplay = true
music.play()
music.stream = load("res://audio/exodus.ogg")
music.connect("finished", _music_finished)
add_child(music)
connect("start_game_one_player",start_one_player) connect("start_game_one_player",start_one_player)
connect("start_game_two_player",start_two_player) connect("start_game_two_player",start_two_player)
connect("go_to_score_saver", start_score_saver) connect("go_to_score_saver", start_score_saver)
@@ -24,6 +39,31 @@ func _ready() -> void:
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event.is_action_pressed("quit"): if event.is_action_pressed("quit"):
get_tree().quit() get_tree().quit()
elif event is InputEventJoypadMotion:
var array_ui = ["right", "left", "up", "down"]
var max := 0.0
var max_ui := ""
for ui in array_ui:
if max < Input.get_action_strength(ui):
max = Input.get_action_strength(ui)
max_ui = ui
if max < 0.5 :
delay_input = delay_btw_input
current_ui = ""
else:
current_ui = max_ui
func _process(delta: float) -> void:
if current_ui != "":
if delay_input < delay_btw_input:
delay_input += delta
else:
var uiEvent = InputEventAction.new()
uiEvent.action = "ui_" + current_ui
uiEvent.pressed = true
Input.parse_input_event(uiEvent)
delay_input = 0.0
func start_one_player()->void: func start_one_player()->void:
get_tree().change_scene_to_file("res://scene/main_game.tscn") get_tree().change_scene_to_file("res://scene/main_game.tscn")
@@ -50,3 +90,35 @@ func start_menu(user_name : String)->void:
func start_score_saver(score: int)->void: func start_score_saver(score: int)->void:
actual_score = score actual_score = score
get_tree().call_deferred("change_scene_to_file", "res://scene/score_saver.tscn") get_tree().call_deferred("change_scene_to_file", "res://scene/score_saver.tscn")
func get_scoreboard_singleplayer() -> String:
return " 1 Player" + _get_scoreboard(score.score_singleplayer)
func get_scoreboard_multiplayer() -> String:
return " 2 Player" + _get_scoreboard(score.score_multiplayer)
func _get_scoreboard(dict: Dictionary) -> String:
var text = ""
var tableau_paires = []
for key in dict:
tableau_paires.append({"key": key, "value": dict[key]})
tableau_paires.sort_custom(func(a, b): return a["value"] > b["value"])
for i in range(clamp(5, 0, tableau_paires.size())):
text += "\n" + str(i+1) + ". " + tableau_paires[i]["key"] + " : " + display_score(tableau_paires[i]["value"])
if tableau_paires.size() < 5:
for i in range(5 - tableau_paires.size()):
text += "\n" + str(tableau_paires.size()+ i+1) + ". " + "---- : ----"
return text
func display_score(score: int) -> String:
var number_str = str(score)
var result = ""
var counter = 0
for i in range(number_str.length() - 1, -1, -1):
result = number_str[i] + result
counter += 1
if counter % 3 == 0 and i != 0:
result = "_" + result
return result

View File

@@ -15,7 +15,7 @@ run/main_scene="uid://jx8hrj6k1ju8"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "Forward Plus")
boot_splash/bg_color=Color(0, 0, 0, 1) boot_splash/bg_color=Color(0, 0, 0, 1)
boot_splash/use_filter=false boot_splash/use_filter=false
boot_splash/image="uid://bectm2xcneqpx" boot_splash/image="uid://bby053xsfn3cp"
config/icon="res://icon.svg" config/icon="res://icon.svg"
[autoload] [autoload]
@@ -26,7 +26,6 @@ GameController="*res://game_controller.gd"
window/size/viewport_width=640 window/size/viewport_width=640
window/size/viewport_height=640 window/size/viewport_height=640
window/size/mode=3
window/stretch/mode="viewport" window/stretch/mode="viewport"
window/stretch/scale_mode="integer" window/stretch/scale_mode="integer"
window/vsync/vsync_mode=0 window/vsync/vsync_mode=0
@@ -42,30 +41,22 @@ ui_accept={
} }
ui_left={ ui_left={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
] ]
} }
ui_right={ ui_right={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
] ]
} }
ui_up={ ui_up={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
] ]
} }
ui_down={ ui_down={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
] ]
} }
up_player_2={ up_player_2={
@@ -101,6 +92,31 @@ accept_player_2={
quit={ quit={
"deadzone": 0.2, "deadzone": 0.2,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":8,"pressure":0.0,"pressed":false,"script":null) "events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":8,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
up={
"deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
down={
"deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}
left={
"deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
]
}
right={
"deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
] ]
} }

View File

@@ -36,37 +36,15 @@ func _on_pressed() -> void:
[sub_resource type="GDScript" id="GDScript_dogtj"] [sub_resource type="GDScript" id="GDScript_dogtj"]
script/source = "extends Label script/source = "extends Label
func _ready() -> void:
var tableau_paires = []
for key in GameController.score.score_singleplayer:
tableau_paires.append({\"key\": key, \"value\": GameController.score.score_singleplayer[key]})
# Trier par ordre alphabétique func _ready() -> void:
tableau_paires.sort_custom(func(a, b): return a[\"value\"] > b[\"value\"]) text = GameController.get_scoreboard_singleplayer()
text += \" 1 Player\"
for i in range(clamp(5, 0, tableau_paires.size())):
text += \"\\n\" + str(i+1) + \". \" + tableau_paires[i][\"key\"] + \" : \" + str(tableau_paires[i][\"value\"])
if tableau_paires.size() < 5:
for i in range(5 - tableau_paires.size()):
text += \"\\n\" + str(tableau_paires.size()+ i+1) + \". \" + \"---- : ----\"
" "
[sub_resource type="GDScript" id="GDScript_u3kfb"] [sub_resource type="GDScript" id="GDScript_u3kfb"]
script/source = "extends Label script/source = "extends Label
func _ready() -> void: func _ready() -> void:
var tableau_paires = [] text = GameController.get_scoreboard_multiplayer()
for key in GameController.score.score_multiplayer:
tableau_paires.append({\"key\": key, \"value\": GameController.score.score_multiplayer[key]})
# Trier par ordre alphabétique
tableau_paires.sort_custom(func(a, b): return a[\"value\"] > b[\"value\"])
text += \" 2 Players\"
for i in range(clamp(5, 0, tableau_paires.size())):
text += \"\\n\" + str(i+1) + \". \" + tableau_paires[i][\"key\"] + \" : \" + str(tableau_paires[i][\"value\"])
if tableau_paires.size() < 5:
for i in range(5 - tableau_paires.size()):
text += \"\\n\" + str(tableau_paires.size()+ i+1) + \". \" + \"---- : ----\"
" "
[node name="load_screen" type="Node2D"] [node name="load_screen" type="Node2D"]

View File

@@ -1,8 +1,10 @@
[gd_scene load_steps=7 format=3 uid="uid://36q833dx6dmq"] [gd_scene load_steps=9 format=3 uid="uid://36q833dx6dmq"]
[ext_resource type="Script" uid="uid://c3i2bhlectmoo" path="res://script/ship.gd" id="1_4cq66"] [ext_resource type="Script" uid="uid://c3i2bhlectmoo" path="res://script/ship.gd" id="1_4cq66"]
[ext_resource type="Texture2D" uid="uid://b037piy3tkefs" path="res://assets/ship.png" id="1_l3rv8"] [ext_resource type="Texture2D" uid="uid://b037piy3tkefs" path="res://assets/ship.png" id="1_l3rv8"]
[ext_resource type="PackedScene" uid="uid://b1jtii12cqye1" path="res://scene/shoot.tscn" id="2_v4325"] [ext_resource type="PackedScene" uid="uid://b1jtii12cqye1" path="res://scene/shoot.tscn" id="2_v4325"]
[ext_resource type="AudioStream" uid="uid://tmrih6eoxo2a" path="res://audio/flopp med underleppa (flanger9).wav" id="4_fbih1"]
[ext_resource type="AudioStream" uid="uid://c85io0gs75sb8" path="res://audio/lose sound 2 - 1_0.wav" id="5_l7n8u"]
[sub_resource type="Animation" id="Animation_fbih1"] [sub_resource type="Animation" id="Animation_fbih1"]
length = 0.001 length = 0.001
@@ -65,3 +67,11 @@ polygon = PackedVector2Array(14, 0, -12, -10, -12, 9)
[node name="Node2D" type="Node2D" parent="."] [node name="Node2D" type="Node2D" parent="."]
position = Vector2(15, 0) position = Vector2(15, 0)
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_fbih1")
volume_db = -10.0
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_l7n8u")
volume_db = -5.0

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://c6dtnhntsit8m"] [gd_scene load_steps=5 format=3 uid="uid://c6dtnhntsit8m"]
[ext_resource type="Script" uid="uid://b0oww62n1rvul" path="res://script/ui.gd" id="1_kee8w"] [ext_resource type="Script" uid="uid://b0oww62n1rvul" path="res://script/ui.gd" id="1_kee8w"]
[ext_resource type="Texture2D" uid="uid://b037piy3tkefs" path="res://assets/ship.png" id="1_onfsl"] [ext_resource type="Texture2D" uid="uid://b037piy3tkefs" path="res://assets/ship.png" id="1_onfsl"]
[ext_resource type="Theme" uid="uid://b46gto6k33wqr" path="res://theme.tres" id="1_s2f8l"] [ext_resource type="Theme" uid="uid://b46gto6k33wqr" path="res://theme.tres" id="1_s2f8l"]
[ext_resource type="AudioStream" uid="uid://mlm2gi1vqj4b" path="res://audio/424911-impactshort78.wav" id="4_xh8xk"]
[node name="UI" type="CanvasLayer" node_paths=PackedStringArray("box_player1", "label_score")] [node name="UI" type="CanvasLayer" node_paths=PackedStringArray("box_player1", "label_score")]
script = ExtResource("1_kee8w") script = ExtResource("1_kee8w")
@@ -71,3 +72,7 @@ theme = ExtResource("1_s2f8l")
text = "0" text = "0"
horizontal_alignment = 2 horizontal_alignment = 2
vertical_alignment = 1 vertical_alignment = 1
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_xh8xk")
volume_db = -12.0

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://d1ugwu6dqomtg"] [gd_scene load_steps=5 format=3 uid="uid://d1ugwu6dqomtg"]
[ext_resource type="Script" uid="uid://b6422kdu30lo4" path="res://script/wall.gd" id="1_xxgf6"] [ext_resource type="Script" uid="uid://b6422kdu30lo4" path="res://script/wall.gd" id="1_5west"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oh6kn"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_oh6kn"]
size = Vector2(40, 680) size = Vector2(40, 680)
@@ -12,7 +12,7 @@ size = Vector2(680, 40)
size = Vector2(630, 630) size = Vector2(630, 630)
[node name="wall" type="Node2D"] [node name="wall" type="Node2D"]
script = ExtResource("1_xxgf6") script = ExtResource("1_5west")
[node name="ColorRect" type="ColorRect" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
offset_left = -320.0 offset_left = -320.0

View File

@@ -5,7 +5,9 @@ var player_name := ""
@export var label_name := Label @export var label_name := Label
func _ready() -> void: func _ready() -> void:
label_name.text = "Score:" + str(GameController.actual_score) + "\n" label_name.text = "Score:" + str(GameController.actual_score) + "\n"
if GameController.is_multiplayer: if GameController.is_multiplayer:
label_name.text += "Team Name 0/8:" label_name.text += "Team Name 0/8:"
@@ -13,6 +15,8 @@ func _ready() -> void:
label_name.text += "Player Name 0/8:" label_name.text += "Player Name 0/8:"
func _on_item_list_item_activated(index: int) -> void: func _on_item_list_item_activated(index: int) -> void:
var temp = $Control/ItemList.get_item_text(index) var temp = $Control/ItemList.get_item_text(index)
var nbr = player_name.length() var nbr = player_name.length()

View File

@@ -35,8 +35,8 @@ func _physics_process(delta: float) -> void:
else: else:
animation.play("RESET") animation.play("RESET")
if ! player_2: if ! player_2:
horizontal = Input.get_axis("ui_up", "ui_down") horizontal = Input.get_axis("up", "down")
vertical = Input.get_axis("ui_left", "ui_right") vertical = Input.get_axis("left", "right")
else: else:
horizontal = Input.get_axis("up_player_2", "down_player_2") horizontal = Input.get_axis("up_player_2", "down_player_2")
vertical = Input.get_axis("left_player_2", "right_player_2") vertical = Input.get_axis("left_player_2", "right_player_2")
@@ -65,6 +65,7 @@ func _physics_process(delta: float) -> void:
func shoot()->void: func shoot()->void:
$AudioStreamPlayer.play()
var new = SHOOT_NODE.instantiate() var new = SHOOT_NODE.instantiate()
new.direction = (target.global_position - global_position).normalized() new.direction = (target.global_position - global_position).normalized()
new.position = target.global_position new.position = target.global_position
@@ -76,4 +77,5 @@ func is_inv() -> bool:
func start_inv(type : bool)->void: func start_inv(type : bool)->void:
if type == player_2 : if type == player_2 :
$AudioStreamPlayer2.play()
delay_inv = 0.0 delay_inv = 0.0

View File

@@ -68,7 +68,7 @@ func spawn():
var new_global_position = Vector2(distance,0).rotated(randf_range(0.0, 360)) var new_global_position = Vector2(distance,0).rotated(randf_range(0.0, 360))
new.global_position = new_global_position new.global_position = new_global_position
new.direction = (player.global_position - new_global_position).normalized() new.direction = (player.global_position - new_global_position).normalized()
new.SPEED = randf() * 50 + 50 * ( 1 + (global_time / 200)) new.SPEED = (randf() * 50 + 50) * ( 1 + (global_time / 200))
add_child(new) add_child(new)

View File

@@ -15,10 +15,11 @@ func _process(delta: float) -> void:
time += delta time += delta
func update_score(add : int, ast_pos: Vector2)->void: func update_score(add : int, ast_pos: Vector2)->void:
var temp = 1.5 ** (5-add) * (1 + (time / 100)) $AudioStreamPlayer.play()
var temp = 1.5 ** (5-add) * (7 + (time / 100))
spawn_score(temp,ast_pos) spawn_score(temp,ast_pos)
score += temp score += temp
label_score.text = str(score) label_score.text = GameController.display_score(score)
func update_player(_type:bool) -> void: func update_player(_type:bool) -> void:
player_life -= 1 player_life -= 1