diff --git a/etc/bulletinV1.ttf.import b/etc/bulletinV1.ttf.import index 91756de..33f33d7 100644 --- a/etc/bulletinV1.ttf.import +++ b/etc/bulletinV1.ttf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/bulletinV1.ttf-012ce5be515230bcc15efcf69b5d91 [params] Rendering=null -antialiasing=1 +antialiasing=0 generate_mipmaps=false disable_embedded_bitmaps=true multichannel_signed_distance_field=false @@ -21,15 +21,20 @@ msdf_pixel_range=8 msdf_size=48 allow_system_fallback=true force_autohinter=false -hinting=1 -subpixel_positioning=4 -keep_rounding_remainders=true +hinting=0 +subpixel_positioning=0 +keep_rounding_remainders=false oversampling=0.0 Fallbacks=null fallbacks=[] Compress=null compress=true -preload=[] +preload=[{ +"chars": [], +"glyphs": [], +"name": "New Configuration", +"size": Vector2i(16, 0) +}] language_support={} script_support={} opentype_features={} diff --git a/etc/joystix monospace.otf.import b/etc/joystix monospace.otf.import index bccff2b..b20c373 100644 --- a/etc/joystix monospace.otf.import +++ b/etc/joystix monospace.otf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/joystix monospace.otf-b02854d0d16fd2029b5a896 [params] Rendering=null -antialiasing=1 +antialiasing=0 generate_mipmaps=false disable_embedded_bitmaps=true multichannel_signed_distance_field=false @@ -21,15 +21,20 @@ msdf_pixel_range=8 msdf_size=48 allow_system_fallback=true force_autohinter=false -hinting=1 -subpixel_positioning=4 -keep_rounding_remainders=true +hinting=0 +subpixel_positioning=0 +keep_rounding_remainders=false oversampling=0.0 Fallbacks=null fallbacks=[] Compress=null compress=true -preload=[] +preload=[{ +"chars": [], +"glyphs": [], +"name": "New Configuration", +"size": Vector2i(16, 0) +}] language_support={} script_support={} opentype_features={} diff --git a/etc/pixelated.ttf.import b/etc/pixelated.ttf.import index d3848f5..b071946 100644 --- a/etc/pixelated.ttf.import +++ b/etc/pixelated.ttf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/pixelated.ttf-8108ecaf469dcb17762df1698b1a31d [params] Rendering=null -antialiasing=1 +antialiasing=0 generate_mipmaps=false disable_embedded_bitmaps=true multichannel_signed_distance_field=false @@ -21,15 +21,20 @@ msdf_pixel_range=8 msdf_size=48 allow_system_fallback=true force_autohinter=false -hinting=1 -subpixel_positioning=4 -keep_rounding_remainders=true +hinting=0 +subpixel_positioning=0 +keep_rounding_remainders=false oversampling=0.0 Fallbacks=null fallbacks=[] Compress=null compress=true -preload=[] +preload=[{ +"chars": [], +"glyphs": [], +"name": "New Configuration", +"size": Vector2i(16, 0) +}] language_support={} script_support={} opentype_features={} diff --git a/globals.gd b/globals.gd new file mode 100644 index 0000000..ffe0a7e --- /dev/null +++ b/globals.gd @@ -0,0 +1,7 @@ +extends Node + +enum Direction {UP,RIGHT,DOWN,LEFT} + +var mouse_dragging = false + +var score = 0 diff --git a/globals.gd.uid b/globals.gd.uid new file mode 100644 index 0000000..3738a23 --- /dev/null +++ b/globals.gd.uid @@ -0,0 +1 @@ +uid://wv6h57d03ecn diff --git a/project.godot b/project.godot index a4164ea..0f16e84 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,10 @@ run/main_scene="uid://dinanmpmnja1" config/features=PackedStringArray("4.4", "GL Compatibility") config/icon="res://icon.svg" +[autoload] + +Globals="*res://globals.gd" + [display] window/size/viewport_width=384 @@ -24,6 +28,10 @@ window/stretch/mode="viewport" [global_group] damageable="" +terrain="" +player="" +enemy="" +upgrades="" [input] @@ -51,10 +59,14 @@ down={ , 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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +reload={ +"deadzone": 0.2, +"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":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null) +] +} [rendering] textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" -environment/defaults/default_clear_color=Color(0.639216, 0.635294, 0.603922, 1) diff --git a/scenes/bullet/bullet.gd b/scenes/bullet/bullet.gd index 75592f0..3c4cc2d 100644 --- a/scenes/bullet/bullet.gd +++ b/scenes/bullet/bullet.gd @@ -9,6 +9,10 @@ var hostile = false @onready var polygon = $Polygon2D +func _ready() -> void: + if hostile: + polygon.color = Color(0.772,0.412,0.506,1) + func _physics_process(delta: float) -> void: position += speed*delta*base_speed*direction @@ -17,7 +21,13 @@ func _physics_process(delta: float) -> void: func _on_body_entered(body: Node2D) -> void: - if body.is_in_group("damageable"): + if body.is_in_group("player") and hostile: + body.health -= damage + body.inventory.update_stats() + queue_free() + elif body.is_in_group("enemy") and not hostile: damage = body.damage(damage) if damage <= 0: queue_free() + elif body.is_in_group("terrain"): + queue_free() diff --git a/scenes/enemies/enemy.gd b/scenes/enemies/enemy.gd index 64a249d..26d8c07 100644 --- a/scenes/enemies/enemy.gd +++ b/scenes/enemies/enemy.gd @@ -1,28 +1,53 @@ -extends Node2D +extends CharacterBody2D -var speed = 10 +class_name Enemy -var health = 30 -var total_health = 30 +@export var speed = 1000 -var dead = false +@export var value = 10 + +var health = 0 +@export var total_health := 30 + + + +@export var difficulty := 1 @export var player : CharacterBody2D @onready var navigation : NavigationAgent2D = $NavigationAgent2D @onready var health_bar : ProgressBar = $HealthBar +@onready var particles : CPUParticles2D = $CPUParticles2D + +func _init(): + health = total_health + func _physics_process(delta: float) -> void: + health_bar.value = (float(health)/total_health)*100 navigation.target_position = player.position - position = position.move_toward(navigation.get_next_path_position(), delta*speed) - if dead: + if not navigation.is_navigation_finished(): + navigation.velocity = ((navigation.get_next_path_position()-position).normalized()*speed*delta) + else: + navigation.velocity = Vector2(0,0) + + if health <= 0: + player.score += difficulty + player.money += int(value*100*(float(1)/(player.tax+100))) + player.inventory.update_stats() queue_free() + move_and_slide() func damage(damage : int): + particles.emitting = true health -= damage if health <= 0: - dead = true return -health return 0 + + +func _on_navigation_agent_2d_velocity_computed(safe_velocity: Vector2) -> void: + velocity = safe_velocity + diff --git a/scenes/enemies/grunt/attack.gd b/scenes/enemies/grunt/attack.gd new file mode 100644 index 0000000..f100846 --- /dev/null +++ b/scenes/enemies/grunt/attack.gd @@ -0,0 +1,14 @@ +extends Area2D + +@export var attack_cooldown : float = 1 +var attack_timer = 0 + + +func _process(delta): + attack_timer -= delta + var bodies = get_overlapping_bodies() + for body in bodies: + if body is Player and attack_timer < 0: + attack_timer = attack_cooldown + get_parent().damage(body.incoming_damage) + body.inflict_damage() diff --git a/scenes/enemies/grunt/attack.gd.uid b/scenes/enemies/grunt/attack.gd.uid new file mode 100644 index 0000000..55607a9 --- /dev/null +++ b/scenes/enemies/grunt/attack.gd.uid @@ -0,0 +1 @@ +uid://bdfcm448qt5uh diff --git a/scenes/enemies/grunt/grunt.png b/scenes/enemies/grunt/grunt.png index a88f2ab..6f41028 100644 Binary files a/scenes/enemies/grunt/grunt.png and b/scenes/enemies/grunt/grunt.png differ diff --git a/scenes/enemies/grunt/grunt.tscn b/scenes/enemies/grunt/grunt.tscn index 5cd6e4e..5513b6b 100644 --- a/scenes/enemies/grunt/grunt.tscn +++ b/scenes/enemies/grunt/grunt.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=7 format=3 uid="uid://bnufqnypubedj"] +[gd_scene load_steps=9 format=3 uid="uid://bnufqnypubedj"] [ext_resource type="Script" uid="uid://do2o6v238umse" path="res://scenes/enemies/enemy.gd" id="1_y73h6"] [ext_resource type="Texture2D" uid="uid://nj5tjjv0a6v8" path="res://scenes/enemies/grunt/grunt.png" id="2_668pk"] +[ext_resource type="Script" uid="uid://bdfcm448qt5uh" path="res://scenes/enemies/grunt/attack.gd" id="3_668pk"] [sub_resource type="CircleShape2D" id="CircleShape2D_cahuy"] +radius = 7.07107 [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y73h6"] +bg_color = Color(0.639216, 0.635294, 0.603922, 0) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_668pk"] bg_color = Color(0.772549, 0.411765, 0.505882, 1) @@ -14,12 +17,17 @@ bg_color = Color(0.772549, 0.411765, 0.505882, 1) ProgressBar/styles/background = SubResource("StyleBoxFlat_y73h6") ProgressBar/styles/fill = SubResource("StyleBoxFlat_668pk") -[node name="Grunt" type="AnimatableBody2D" groups=["damageable"]] +[sub_resource type="CircleShape2D" id="CircleShape2D_y73h6"] +radius = 12.0 + +[node name="Grunt" type="CharacterBody2D" groups=["damageable", "enemy"]] +motion_mode = 1 script = ExtResource("1_y73h6") [node name="NavigationAgent2D" type="NavigationAgent2D" parent="."] +path_postprocessing = 1 avoidance_enabled = true -max_speed = 50.0 +max_speed = 20.0 [node name="Grunt" type="Sprite2D" parent="."] texture = ExtResource("2_668pk") @@ -27,10 +35,6 @@ texture = ExtResource("2_668pk") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("CircleShape2D_cahuy") -[node name="NavigationObstacle2D" type="NavigationObstacle2D" parent="."] -radius = 10.0 -avoidance_enabled = false - [node name="HealthBar" type="ProgressBar" parent="."] offset_left = -10.0 offset_top = -17.0 @@ -39,3 +43,28 @@ offset_bottom = -15.0 theme = SubResource("Theme_cahuy") value = 100.0 show_percentage = false + +[node name="NavigationObstacle2D" type="NavigationObstacle2D" parent="."] +vertices = PackedVector2Array(0, -7, 5, -5, 7, 0, 5, 5, 0, 7, -5, 5, -7, 0, -5, -5) +avoidance_enabled = false + +[node name="Attack" type="Area2D" parent="."] +script = ExtResource("3_668pk") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Attack"] +shape = SubResource("CircleShape2D_y73h6") + +[node name="CPUParticles2D" type="CPUParticles2D" parent="."] +emitting = false +lifetime = 0.16 +one_shot = true +explosiveness = 1.0 +spread = 180.0 +gravity = Vector2(0, 0) +initial_velocity_min = 104.4 +initial_velocity_max = 104.4 +damping_min = 100.0 +damping_max = 100.0 +color = Color(0.772549, 0.411765, 0.505882, 1) + +[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"] diff --git a/scenes/enemies/shooter/gun.gd b/scenes/enemies/shooter/gun.gd new file mode 100644 index 0000000..50b681e --- /dev/null +++ b/scenes/enemies/shooter/gun.gd @@ -0,0 +1,20 @@ +extends RayCast2D + +@onready var carrier = get_parent() +@export var attack_cooldown : float = 1 +@export var bullet_scene : PackedScene +var attack_timer = 0 + +func _process(delta: float) -> void: + attack_timer -= delta + target_position = carrier.player.global_position-global_position + if not is_colliding() and attack_timer < 0: + var new_bullet = bullet_scene.instantiate() + new_bullet.hostile = true + new_bullet.direction = global_position.direction_to(carrier.player.global_position) + new_bullet.global_position = global_position + new_bullet.damage = carrier.player.incoming_damage + new_bullet.speed = 5 + get_tree().root.add_child(new_bullet) + attack_timer = attack_cooldown + diff --git a/scenes/enemies/shooter/gun.gd.uid b/scenes/enemies/shooter/gun.gd.uid new file mode 100644 index 0000000..0e9a3d9 --- /dev/null +++ b/scenes/enemies/shooter/gun.gd.uid @@ -0,0 +1 @@ +uid://cwasbbull03i8 diff --git a/scenes/enemies/shooter/shooter.png b/scenes/enemies/shooter/shooter.png new file mode 100644 index 0000000..014a4cd Binary files /dev/null and b/scenes/enemies/shooter/shooter.png differ diff --git a/scenes/enemies/shooter/shooter.png.import b/scenes/enemies/shooter/shooter.png.import new file mode 100644 index 0000000..f025bfc --- /dev/null +++ b/scenes/enemies/shooter/shooter.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c7fka8ygr5xfq" +path="res://.godot/imported/shooter.png-6d734d2019013d45497c35334fed4769.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/enemies/shooter/shooter.png" +dest_files=["res://.godot/imported/shooter.png-6d734d2019013d45497c35334fed4769.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/enemies/shooter/shooter.tscn b/scenes/enemies/shooter/shooter.tscn new file mode 100644 index 0000000..2382aee --- /dev/null +++ b/scenes/enemies/shooter/shooter.tscn @@ -0,0 +1,72 @@ +[gd_scene load_steps=9 format=3 uid="uid://b6lmouoh2607b"] + +[ext_resource type="Script" uid="uid://do2o6v238umse" path="res://scenes/enemies/enemy.gd" id="1_3kmpx"] +[ext_resource type="Texture2D" uid="uid://c7fka8ygr5xfq" path="res://scenes/enemies/shooter/shooter.png" id="2_d8kji"] +[ext_resource type="Script" uid="uid://cwasbbull03i8" path="res://scenes/enemies/shooter/gun.gd" id="3_d8kji"] +[ext_resource type="PackedScene" uid="uid://dpdt7rbma7ugn" path="res://scenes/bullet/bullet.tscn" id="4_0as4b"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_cahuy"] +radius = 7.07107 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y73h6"] +bg_color = Color(0.639216, 0.635294, 0.603922, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_668pk"] +bg_color = Color(0.772549, 0.411765, 0.505882, 1) + +[sub_resource type="Theme" id="Theme_cahuy"] +ProgressBar/styles/background = SubResource("StyleBoxFlat_y73h6") +ProgressBar/styles/fill = SubResource("StyleBoxFlat_668pk") + +[node name="Shooter" type="CharacterBody2D" groups=["damageable", "enemy"]] +motion_mode = 1 +script = ExtResource("1_3kmpx") +speed = 800 +value = 15 +total_health = 20 +difficulty = 5 + +[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."] +target_desired_distance = 60.0 +path_postprocessing = 1 +avoidance_enabled = true +max_speed = 20.0 + +[node name="Grunt" type="Sprite2D" parent="."] +texture = ExtResource("2_d8kji") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_cahuy") + +[node name="HealthBar" type="ProgressBar" parent="."] +offset_left = -10.0 +offset_top = -17.0 +offset_right = 11.0 +offset_bottom = -15.0 +theme = SubResource("Theme_cahuy") +value = 100.0 +show_percentage = false + +[node name="NavigationObstacle2D" type="NavigationObstacle2D" parent="."] +vertices = PackedVector2Array(0, -7, 5, -5, 7, 0, 5, 5, 0, 7, -5, 5, -7, 0, -5, -5) +avoidance_enabled = false + +[node name="CPUParticles2D" type="CPUParticles2D" parent="."] +emitting = false +lifetime = 0.16 +one_shot = true +explosiveness = 1.0 +spread = 180.0 +gravity = Vector2(0, 0) +initial_velocity_min = 104.4 +initial_velocity_max = 104.4 +damping_min = 100.0 +damping_max = 100.0 +color = Color(0.329412, 0.360784, 0.494118, 1) + +[node name="Gun" type="RayCast2D" parent="."] +collision_mask = 4 +script = ExtResource("3_d8kji") +bullet_scene = ExtResource("4_0as4b") + +[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"] diff --git a/scenes/game_over.gd b/scenes/game_over.gd new file mode 100644 index 0000000..ab69ffd --- /dev/null +++ b/scenes/game_over.gd @@ -0,0 +1,9 @@ +extends Node2D + +var go_to_scene = "res://scenes/world/world.tscn" + +func _ready(): + $Score.text = "Score: " + str(Globals.score) + +func _on_button_pressed() -> void: + get_tree().change_scene_to_file(go_to_scene) diff --git a/scenes/game_over.gd.uid b/scenes/game_over.gd.uid new file mode 100644 index 0000000..ef02fe2 --- /dev/null +++ b/scenes/game_over.gd.uid @@ -0,0 +1 @@ +uid://ctox3n7f4j8wu diff --git a/scenes/game_over.tscn b/scenes/game_over.tscn new file mode 100644 index 0000000..6f62575 --- /dev/null +++ b/scenes/game_over.tscn @@ -0,0 +1,85 @@ +[gd_scene load_steps=10 format=4 uid="uid://kx6lu3rdhsjv"] + +[ext_resource type="Script" uid="uid://ctox3n7f4j8wu" path="res://scenes/game_over.gd" id="1_racf3"] +[ext_resource type="TileSet" uid="uid://bawet85hqjpku" path="res://scenes/world/tilemap/tile_map.tres" id="1_tbwuq"] +[ext_resource type="FontFile" uid="uid://dxcsr8pfoj3c" path="res://etc/bulletinV1.ttf" id="2_racf3"] +[ext_resource type="FontFile" uid="uid://dj1hgg8vhug8j" path="res://etc/slkscr.ttf" id="3_7m3ot"] + +[sub_resource type="LabelSettings" id="LabelSettings_v3hpu"] +font = ExtResource("2_racf3") +font_size = 19 +font_color = Color(0.156863, 0.137255, 0.156863, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_efxst"] +bg_color = Color(0.156863, 0.137255, 0.156863, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.156863, 0.137255, 0.156863, 1) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l6cit"] +bg_color = Color(0.639216, 0.635294, 0.603922, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.156863, 0.137255, 0.156863, 1) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g1nyl"] +bg_color = Color(0.639216, 0.635294, 0.603922, 1) + +[sub_resource type="Theme" id="Theme_irg28"] +default_font = ExtResource("3_7m3ot") +Button/colors/font_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/colors/font_hover_color = Color(0.639216, 0.635294, 0.603922, 1) +Button/colors/font_hover_pressed_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/colors/font_pressed_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/font_sizes/font_size = 8 +Button/styles/hover = SubResource("StyleBoxFlat_efxst") +Button/styles/normal = SubResource("StyleBoxFlat_l6cit") +Button/styles/pressed = SubResource("StyleBoxFlat_g1nyl") + +[node name="Game Over" type="Node2D"] +script = ExtResource("1_racf3") + +[node name="TileMapLayer" type="TileMapLayer" parent="."] +tile_map_data = PackedByteArray("AAAAAAAAAgAEAAAAAAAAAAEAAgAEAAAAAAAAAAIAAgAEAAAAAAAAAAMAAgAEAAAAAAAAAAQAAgAEAAAAAAAAAAUAAgAEAAAAAAAAAAYAAgAEAAAAAAAAAAcAAgAEAAAAAAAAAAgAAgAEAAAAAAAAAAkAAgAEAAAAAAAAAAoAAgAEAAAAAAAAAAsAAgAEAAAAAAAAAAwAAgAEAAAAAAAAAA0AAgAEAAAAAAAAAA4AAgAEAAAAAAAAAA8AAgAEAAAAAAABAA8AAgAEAAAAAAACAA8AAgAEAAAAAAADAA8AAgAEAAAAAAAEAA8AAgAEAAAAAAAFAA8AAgAEAAAAAAAGAA8AAgAEAAAAAAAHAA8AAgAEAAAAAAAIAA8AAgAEAAAAAAAJAA8AAgAEAAAAAAAKAA8AAgAEAAAAAAALAA8AAgAEAAAAAAAMAA8AAgAEAAAAAAANAA8AAgAEAAAAAAAOAA8AAgAEAAAAAAAPAA8AAgAEAAAAAAAQAA8AAgAEAAAAAAARAA8AAgAEAAAAAAASAA8AAgAEAAAAAAATAA8AAgAEAAAAAAAUAA8AAgAEAAAAAAAVAA8AAgAEAAAAAAAWAA8AAgAEAAAAAAAXAA8AAgAEAAAAAAAXAA4AAgAEAAAAAAAXAA0AAgAEAAAAAAAXAAwAAgAEAAAAAAAXAAsAAgAEAAAAAAAXAAoAAgAEAAAAAAAXAAkAAgAEAAAAAAAXAAgAAgAEAAAAAAAXAAcAAgAEAAAAAAAXAAYAAgAEAAAAAAAXAAUAAgAEAAAAAAAXAAQAAgAEAAAAAAAXAAMAAgAEAAAAAAAXAAIAAgAEAAAAAAAXAAEAAgAEAAAAAA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AEAAAAAAAWAAwAAgAEAAAAAAAWAA0AAgAEAAAAAAAWAA4AAgAEAAAAAAA=") +tile_set = ExtResource("1_tbwuq") + +[node name="Label" type="Label" parent="."] +offset_left = 130.0 +offset_top = 78.0 +offset_right = 262.0 +offset_bottom = 133.0 +text = "Game Over +Play again?" +label_settings = SubResource("LabelSettings_v3hpu") + +[node name="Score" type="Label" parent="."] +offset_left = 116.0 +offset_top = 163.0 +offset_right = 248.0 +offset_bottom = 218.0 +text = "Score:" +label_settings = SubResource("LabelSettings_v3hpu") + +[node name="Button" type="Button" parent="."] +offset_left = 150.0 +offset_top = 153.0 +offset_right = 225.0 +offset_bottom = 164.0 +theme = SubResource("Theme_irg28") +text = "Play" + +[connection signal="pressed" from="Button" to="." method="_on_button_pressed"] diff --git a/scenes/inventory/inventory.gd b/scenes/inventory/inventory.gd index e1e7274..f63f2e8 100644 --- a/scenes/inventory/inventory.gd +++ b/scenes/inventory/inventory.gd @@ -10,13 +10,21 @@ var items : Array[Array] @onready var money = $Money @onready var score = $Score +@export var levels : Node2D + +var x_swaps = 0 + var item_offset : int = 26 +var in_shop = false + @export var bonus_scene : PackedScene @export var item_scene : PackedScene @export var items_start : Node2D +@onready var lock : Sprite2D = $Lock + @export var player : CharacterBody2D func _ready(): @@ -90,6 +98,7 @@ func update_calculations(): 3: player.tax = total negative_modifiers[x].text = '=' + str(total) + func update_stats(): remaining_ammunition.text = '- ' + str(player.remaining_bullets) health.text = '- ' + str(player.health) @@ -118,14 +127,19 @@ func global_to_inventory_coords(position : Vector2): func _process(delta: float) -> void: - pass + if in_shop: + lock.frame = 1 + else: + lock.frame = 0 func _input(event): if event is InputEventMouseButton: var layer = 0 - if (event.button_index == MOUSE_BUTTON_LEFT or event.button_index == MOUSE_BUTTON_RIGHT) and event.pressed: + if (event.button_index == MOUSE_BUTTON_LEFT or event.button_index == MOUSE_BUTTON_RIGHT) and event.pressed and in_shop: if(event.button_index == MOUSE_BUTTON_RIGHT): layer = 1 + if x_swaps <= 0: + return var inventory_position = global_to_inventory_coords(event.position) if inventory_position != null and items[layer][inventory_position.y][inventory_position.x] != null: items[layer][inventory_position.y][inventory_position.x].dragging = true diff --git a/scenes/inventory/inventory.tscn b/scenes/inventory/inventory.tscn index 8cee76e..c728c90 100644 --- a/scenes/inventory/inventory.tscn +++ b/scenes/inventory/inventory.tscn @@ -1,10 +1,14 @@ -[gd_scene load_steps=12 format=3 uid="uid://o6e5ybx262ig"] +[gd_scene load_steps=21 format=3 uid="uid://o6e5ybx262ig"] [ext_resource type="Script" uid="uid://466pugqribug" path="res://scenes/inventory/inventory.gd" id="1_el5y6"] [ext_resource type="PackedScene" uid="uid://csdmile32lfyy" path="res://scenes/inventory/number/number.tscn" id="2_4axmw"] [ext_resource type="Texture2D" uid="uid://wygld7k1t3ad" path="res://scenes/inventory/WindowPane.png" id="4_bxceu"] [ext_resource type="FontFile" uid="uid://cukc34hue3c0h" path="res://etc/pixelated.ttf" id="4_tvok8"] [ext_resource type="PackedScene" uid="uid://2o4sa1c2rd1a" path="res://scenes/inventory/bonus/bonus.tscn" id="5_bxceu"] +[ext_resource type="Texture2D" uid="uid://c8ptw6uydekn8" path="res://scenes/inventory/lock.png" id="6_v8e04"] +[ext_resource type="FontFile" uid="uid://dj1hgg8vhug8j" path="res://etc/slkscr.ttf" id="7_kl7fi"] +[ext_resource type="PackedScene" uid="uid://bsedu348niu4n" path="res://scenes/inventory/tooltip/tooltip.tscn" id="7_l6cit"] +[ext_resource type="Script" uid="uid://ca6rno5o2qeus" path="res://scenes/inventory/tutorial_text.gd" id="8_x4j3l"] [sub_resource type="LabelSettings" id="LabelSettings_bxceu"] font = ExtResource("4_tvok8") @@ -36,6 +40,51 @@ font = ExtResource("4_tvok8") font_size = 8 font_color = Color(0.329412, 0.360784, 0.494118, 1) +[sub_resource type="LabelSettings" id="LabelSettings_g1nyl"] +font = ExtResource("7_kl7fi") +font_size = 9 +font_color = Color(0.156863, 0.137255, 0.156863, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_efxst"] +bg_color = Color(0.156863, 0.137255, 0.156863, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.156863, 0.137255, 0.156863, 1) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l6cit"] +bg_color = Color(0.639216, 0.635294, 0.603922, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.156863, 0.137255, 0.156863, 1) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g1nyl"] +bg_color = Color(0.639216, 0.635294, 0.603922, 1) + +[sub_resource type="Theme" id="Theme_efxst"] +default_font = ExtResource("7_kl7fi") +Button/colors/font_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/colors/font_hover_color = Color(0.639216, 0.635294, 0.603922, 1) +Button/colors/font_hover_pressed_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/colors/font_pressed_color = Color(0.156863, 0.137255, 0.156863, 1) +Button/font_sizes/font_size = 8 +Button/styles/hover = SubResource("StyleBoxFlat_efxst") +Button/styles/normal = SubResource("StyleBoxFlat_l6cit") +Button/styles/pressed = SubResource("StyleBoxFlat_g1nyl") + [node name="Inventory" type="Control" node_paths=PackedStringArray("items_start")] layout_mode = 3 anchors_preset = 6 @@ -57,6 +106,11 @@ position = Vector2(-64, 0) texture = ExtResource("4_bxceu") region_rect = Rect2(0, 0, 134, 256) +[node name="Lock" type="Sprite2D" parent="."] +position = Vector2(-12, -8) +texture = ExtResource("6_v8e04") +hframes = 2 + [node name="InventoryStart" type="Marker2D" parent="."] position = Vector2(-110, -111) @@ -68,6 +122,10 @@ offset_bottom = -99.0 text = "=10" label_settings = SubResource("LabelSettings_bxceu") +[node name="Tooltip" parent="Speed" instance=ExtResource("7_l6cit")] +position = Vector2(8, 12) +tooltip_text = "Speed" + [node name="RemainingAmmunition" type="Label" parent="."] layout_mode = 0 offset_left = -105.0 @@ -92,7 +150,7 @@ offset_left = -105.0 offset_top = 48.0 offset_right = -85.0 offset_bottom = 71.0 -text = "- 0" +text = "- 100" label_settings = SubResource("LabelSettings_l6cit") [node name="Score" type="Label" parent="."] @@ -113,6 +171,10 @@ offset_bottom = -87.0 text = "=10" label_settings = SubResource("LabelSettings_bxceu") +[node name="Tooltip3" parent="BulletSpeed" instance=ExtResource("7_l6cit")] +position = Vector2(8, 13) +tooltip_text = "Bullet Speed" + [node name="Ammunition" type="Label" parent="."] layout_mode = 0 offset_left = -20.0 @@ -121,6 +183,10 @@ offset_bottom = -47.0 text = "=10" label_settings = SubResource("LabelSettings_bxceu") +[node name="Tooltip2" parent="Ammunition" instance=ExtResource("7_l6cit")] +position = Vector2(8, 13) +tooltip_text = "Magazine Size" + [node name="Damage" type="Label" parent="."] layout_mode = 0 offset_left = -20.0 @@ -129,6 +195,10 @@ offset_bottom = -21.0 text = "=10" label_settings = SubResource("LabelSettings_bxceu") +[node name="Tooltip3" parent="Damage" instance=ExtResource("7_l6cit")] +position = Vector2(8, 13) +tooltip_text = "Damage To Enemies" + [node name="Size" type="Label" parent="."] layout_mode = 0 offset_left = -71.0 @@ -139,6 +209,10 @@ text = "=10" label_settings = SubResource("LabelSettings_v8e04") horizontal_alignment = 1 +[node name="Tooltip7" parent="Size" instance=ExtResource("7_l6cit")] +position = Vector2(11, 21) +tooltip_text = "Size (Your hitbox is bigger)" + [node name="TaxRate" type="Label" parent="."] layout_mode = 0 offset_left = -46.0 @@ -149,6 +223,10 @@ text = "=10" label_settings = SubResource("LabelSettings_v8e04") horizontal_alignment = 1 +[node name="Tooltip5" parent="TaxRate" instance=ExtResource("7_l6cit")] +position = Vector2(12, 21) +tooltip_text = "Tax (Money Reduction From Enemies)" + [node name="FiringDelay" type="Label" parent="."] layout_mode = 0 offset_left = -98.0 @@ -159,6 +237,10 @@ text = "=10" label_settings = SubResource("LabelSettings_v8e04") horizontal_alignment = 1 +[node name="Tooltip6" parent="FiringDelay" instance=ExtResource("7_l6cit")] +position = Vector2(12, 21) +tooltip_text = "Delay Between Shots" + [node name="IncomingDamage" type="Label" parent="."] layout_mode = 0 offset_left = -124.0 @@ -168,3 +250,49 @@ offset_bottom = 6.0 text = "=10" label_settings = SubResource("LabelSettings_v8e04") horizontal_alignment = 1 + +[node name="Tooltip4" parent="IncomingDamage" instance=ExtResource("7_l6cit")] +position = Vector2(12, 21) +tooltip_text = "Damage From Enemies" + +[node name="TUTORIAL" type="Label" parent="."] +layout_mode = 0 +offset_left = -47.0 +offset_top = 33.0 +offset_right = 25.0 +offset_bottom = 141.0 +text = "TUTORIAL +↓ ↓ ↓ ↓" +label_settings = SubResource("LabelSettings_efxst") + +[node name="TutorialText" type="Label" parent="."] +layout_mode = 0 +offset_left = -127.0 +offset_top = 56.0 +offset_right = 3.0 +offset_bottom = 113.0 +label_settings = SubResource("LabelSettings_g1nyl") +script = ExtResource("8_x4j3l") + +[node name="Next" type="Button" parent="TutorialText"] +layout_mode = 0 +offset_left = 99.0 +offset_top = 58.0 +offset_right = 125.0 +offset_bottom = 69.0 +focus_mode = 0 +theme = SubResource("Theme_efxst") +text = "Next" + +[node name="Previous" type="Button" parent="TutorialText"] +layout_mode = 0 +offset_left = 71.0 +offset_top = 58.0 +offset_right = 97.0 +offset_bottom = 69.0 +focus_mode = 0 +theme = SubResource("Theme_efxst") +text = "Prev" + +[connection signal="pressed" from="TutorialText/Next" to="TutorialText" method="_on_next_pressed"] +[connection signal="pressed" from="TutorialText/Previous" to="TutorialText" method="_on_previous_pressed"] diff --git a/scenes/inventory/lock.png b/scenes/inventory/lock.png new file mode 100644 index 0000000..f04b821 Binary files /dev/null and b/scenes/inventory/lock.png differ diff --git a/scenes/inventory/lock.png.import b/scenes/inventory/lock.png.import new file mode 100644 index 0000000..01cf4b0 --- /dev/null +++ b/scenes/inventory/lock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8ptw6uydekn8" +path="res://.godot/imported/lock.png-740d6b4da3e23cd5b4cc36ef9cd0e2df.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/inventory/lock.png" +dest_files=["res://.godot/imported/lock.png-740d6b4da3e23cd5b4cc36ef9cd0e2df.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/inventory/tooltip/tooltip.gd b/scenes/inventory/tooltip/tooltip.gd new file mode 100644 index 0000000..3d0dd1a --- /dev/null +++ b/scenes/inventory/tooltip/tooltip.gd @@ -0,0 +1,32 @@ +extends Area2D + +var mouse_hovering = false + +@export var tooltip_text : String + +@onready var panel = $PanelContainer + +func _ready(): + $PanelContainer/Label.text = tooltip_text + +func _process(delta): + if mouse_hovering: + panel.show() + if panel.global_position.x + panel.size.x > 384: + panel.global_position.x = 384-panel.size.x + if panel.global_position.x < 0: + panel.global_position.x = 0 + + if panel.global_position.y + panel.size.y > 256: + panel.global_position.y = 256-panel.size.y + if panel.global_position.y < 0: + panel.global_position.y = 0 + else: + panel.hide() + +func _on_mouse_entered() -> void: + mouse_hovering = true + + +func _on_mouse_exited() -> void: + mouse_hovering = false diff --git a/scenes/inventory/tooltip/tooltip.gd.uid b/scenes/inventory/tooltip/tooltip.gd.uid new file mode 100644 index 0000000..af02fad --- /dev/null +++ b/scenes/inventory/tooltip/tooltip.gd.uid @@ -0,0 +1 @@ +uid://csb4bby01d4ph diff --git a/scenes/inventory/tooltip/tooltip.tscn b/scenes/inventory/tooltip/tooltip.tscn new file mode 100644 index 0000000..51e6013 --- /dev/null +++ b/scenes/inventory/tooltip/tooltip.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=7 format=3 uid="uid://bsedu348niu4n"] + +[ext_resource type="Script" uid="uid://csb4bby01d4ph" path="res://scenes/inventory/tooltip/tooltip.gd" id="1_kaqjd"] +[ext_resource type="FontFile" uid="uid://dj1hgg8vhug8j" path="res://etc/slkscr.ttf" id="1_tthyn"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_0y2k0"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yl77q"] +bg_color = Color(0.639216, 0.635294, 0.603922, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.156863, 0.137255, 0.156863, 1) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +anti_aliasing = false + +[sub_resource type="Theme" id="Theme_xjhe7"] +PanelContainer/styles/panel = SubResource("StyleBoxFlat_yl77q") + +[sub_resource type="LabelSettings" id="LabelSettings_kaqjd"] +font = ExtResource("1_tthyn") +font_size = 9 +font_color = Color(0.156863, 0.137255, 0.156863, 1) + +[node name="Tooltip" type="Area2D"] +script = ExtResource("1_kaqjd") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_0y2k0") + +[node name="PanelContainer" type="PanelContainer" parent="."] +z_index = 10 +offset_right = 1.0 +offset_bottom = 10.0 +mouse_filter = 2 +theme = SubResource("Theme_xjhe7") + +[node name="Label" type="Label" parent="PanelContainer"] +layout_mode = 2 +text = "Testing Tooltip" +label_settings = SubResource("LabelSettings_kaqjd") + +[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] +[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] diff --git a/scenes/inventory/tutorial_text.gd b/scenes/inventory/tutorial_text.gd new file mode 100644 index 0000000..a87fe32 --- /dev/null +++ b/scenes/inventory/tutorial_text.gd @@ -0,0 +1,63 @@ +extends Label + +var tutorials = \ +["Welcome to Su-no-ku, +because it's not Sudoku. +Kill EVERYONE, ill tell +you more in a second.", +"You see those areas, +the ones that the +enemies came out of? +go there.", +"Top right are your +stats, hover over +each one to find +out what it does.", +"Your stats are +calculated by adding +all of the numbers in +the row or column...", +"Not counting the +number with the X on it, +that is a multiplier, +it's added at the end", +"Try messing around +with the values, you +can only do so in the +shop", +"You can also buy +upgrades in the shop, +try dragging one over +to your inventory", +"Your goal is to +survive as long as +possible, have fun!"] + +var tutorial_number = 0 + +@onready var inventory = get_parent() +@onready var next = $Next +@onready var previous = $Previous + +func _ready() -> void: + text = tutorials[0] + +func _process(delta: float) -> void: + text = tutorials[tutorial_number] + if tutorial_number <= 0: + previous.hide() + else: + previous.show() + + if tutorial_number >= len(tutorials)-1: + next.hide() + else: + next.show() + + +func _on_next_pressed() -> void: + tutorial_number += 1 + + +func _on_previous_pressed() -> void: + tutorial_number -= 1 diff --git a/scenes/inventory/tutorial_text.gd.uid b/scenes/inventory/tutorial_text.gd.uid new file mode 100644 index 0000000..95b7063 --- /dev/null +++ b/scenes/inventory/tutorial_text.gd.uid @@ -0,0 +1 @@ +uid://ca6rno5o2qeus diff --git a/scenes/inventory/upgrades/upgrade.tscn b/scenes/inventory/upgrades/upgrade.tscn new file mode 100644 index 0000000..2abcd64 --- /dev/null +++ b/scenes/inventory/upgrades/upgrade.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=6 format=3 uid="uid://dsgvdus6pyld1"] + +[ext_resource type="Script" uid="uid://cratbhruo2vb" path="res://upgrade.gd" id="1_5bg6l"] +[ext_resource type="Texture2D" uid="uid://t7ilejqp6k1b" path="res://scenes/inventory/upgrades/upgrades.png" id="2_tfji8"] +[ext_resource type="FontFile" uid="uid://cukc34hue3c0h" path="res://etc/pixelated.ttf" id="3_pduvh"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_tfji8"] + +[sub_resource type="LabelSettings" id="LabelSettings_ax071"] +font = ExtResource("3_pduvh") +font_size = 8 +font_color = Color(0.156863, 0.137255, 0.156863, 1) + +[node name="upgrade" type="Area2D" groups=["upgrades"]] +script = ExtResource("1_5bg6l") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_tfji8") + +[node name="CanvasLayer" type="CanvasLayer" parent="."] +layer = 2 + +[node name="Sprite2D" type="Sprite2D" parent="CanvasLayer"] +texture = ExtResource("2_tfji8") +hframes = 2 +vframes = 2 + +[node name="Label" type="Label" parent="."] +offset_left = -15.0 +offset_top = 10.0 +offset_right = 15.0 +offset_bottom = 24.0 +text = "$100" +label_settings = SubResource("LabelSettings_ax071") +horizontal_alignment = 1 + +[connection signal="input_event" from="." to="." method="_on_input_event"] diff --git a/scenes/inventory/upgrades/upgrades.png b/scenes/inventory/upgrades/upgrades.png new file mode 100644 index 0000000..5ff4b5b Binary files /dev/null and b/scenes/inventory/upgrades/upgrades.png differ diff --git a/scenes/inventory/upgrades/upgrades.png.import b/scenes/inventory/upgrades/upgrades.png.import new file mode 100644 index 0000000..795e83b --- /dev/null +++ b/scenes/inventory/upgrades/upgrades.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://t7ilejqp6k1b" +path="res://.godot/imported/upgrades.png-496415d7d1d0c7507c0d2ba4cda9f87f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/inventory/upgrades/upgrades.png" +dest_files=["res://.godot/imported/upgrades.png-496415d7d1d0c7507c0d2ba4cda9f87f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/inventory/upgrades/upgrades.pxo b/scenes/inventory/upgrades/upgrades.pxo new file mode 100644 index 0000000..8d46fae Binary files /dev/null and b/scenes/inventory/upgrades/upgrades.pxo differ diff --git a/scenes/player/player.gd b/scenes/player/player.gd index 61da654..18930fc 100644 --- a/scenes/player/player.gd +++ b/scenes/player/player.gd @@ -1,7 +1,11 @@ extends CharacterBody2D +class_name Player + var base_speed = 100 +var death_scene = "res://scenes/game_over.tscn" + var speed var bullet_speed var ammunition @@ -18,7 +22,7 @@ var remaining_bullets = 7 var health = 100 -var money = 0 +var money = 100 var score = 0 @@ -34,6 +38,9 @@ var bullet_timer = 0 @export var bullet_scene : PackedScene func _physics_process(delta): + if health < 0: + Globals.score = score + get_tree().change_scene_to_file(death_scene) bullet_timer -= delta velocity = Vector2(0,0) if Input.is_action_pressed("left"): @@ -44,8 +51,11 @@ func _physics_process(delta): velocity.y += -1 if Input.is_action_pressed("down"): velocity.y += 1 + + if Input.is_action_just_pressed("reload"): + reload() - if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT): + if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) and get_global_mouse_position().x < 256 and Globals.mouse_dragging == false: spawn_bullet() velocity = velocity.normalized() * speed*base_speed*delta @@ -56,7 +66,8 @@ func _physics_process(delta): collision.scale = Vector2(0.3,0.3)*(pow(size,0.2)) if bullet_timer < 0 and reloading: - remaining_bullets += 1 + if remaining_bullets < ammunition: + remaining_bullets += 1 bullet_timer = reload_speed if remaining_bullets >= ammunition: reloading = false @@ -66,6 +77,9 @@ func _physics_process(delta): func reload(): reloading = true +func inflict_damage(): + health -= incoming_damage + inventory.update_stats() func spawn_bullet(): if bullet_timer > 0 or reloading: return diff --git a/scenes/player/player.tscn b/scenes/player/player.tscn index 5ba5753..84801ca 100644 --- a/scenes/player/player.tscn +++ b/scenes/player/player.tscn @@ -7,7 +7,9 @@ [sub_resource type="CircleShape2D" id="CircleShape2D_dovo2"] radius = 13.0 -[node name="Player" type="CharacterBody2D"] +[node name="Player" type="CharacterBody2D" groups=["damageable", "player"]] +collision_layer = 3 +collision_mask = 3 motion_mode = 1 script = ExtResource("1_dovo2") bullet_scene = ExtResource("2_gmlin") diff --git a/scenes/world/blocked.png b/scenes/world/blocked.png new file mode 100644 index 0000000..7b3a30b Binary files /dev/null and b/scenes/world/blocked.png differ diff --git a/scenes/world/blocked.png.import b/scenes/world/blocked.png.import new file mode 100644 index 0000000..f2e83fe --- /dev/null +++ b/scenes/world/blocked.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bobe81o0a80s1" +path="res://.godot/imported/blocked.png-651eb5de53223053b640e89f3d952ae3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/world/blocked.png" +dest_files=["res://.godot/imported/blocked.png-651eb5de53223053b640e89f3d952ae3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/world/level.gd b/scenes/world/level.gd new file mode 100644 index 0000000..b6069a2 --- /dev/null +++ b/scenes/world/level.gd @@ -0,0 +1,146 @@ +extends Node2D + +class_name Level + +class Spawn: + var delay : float + var enemy : Enemy + func _init(delay : float, enemy : Enemy): + self.delay = delay + self.enemy = enemy + +@export var spawn_points : Array[Marker2D] +@export var levels : Array[TileMapLayer] +@export var enemies : Array[PackedScene] + +@onready var areas = [$Top,$Right,$Bottom,$Left] + +@onready var borders = [$"World Border/Top",$"World Border/Right",$"World Border/Bottom",$"World Border/Left"] + +@export var player : CharacterBody2D + +@onready var shop = $Shop + +var difficulty = 4 + +var levels_until_shop = 1 + +var last_direction = null + +var enemies_alive = true + +func _ready() -> void: + for level in levels: + level.enabled = false + level.navigation_enabled = false + + var level = levels.pick_random() + level.enabled = true + level.navigation_enabled = true + + make_spawns() + +func _process(delta: float) -> void: + if Engine.get_process_frames() % 10 == 0: + if get_tree().get_nodes_in_group("enemy") != []: + enemies_alive = true + else: + var currently_alive = false + for spawn in spawn_points: + if spawn.spawns != []: + currently_alive = true + break + enemies_alive = currently_alive + + for i in range(4): + if not enemies_alive and last_direction != i: + borders[i].set_deferred("disabled",true) + else: + borders[i].set_deferred("disabled",false) + if last_direction == i: + areas[i].show() + else: + areas[i].hide() + +func make_spawns(): + for spawn_point in spawn_points: + spawn_point.spawns.clear() + + var difficulty_left = difficulty + while difficulty_left > 0: + var direction = randi_range(0,3) + while direction == last_direction: + direction = randi_range(0,3) + var enemy = enemies.pick_random().instantiate() + var delay = 100*(1/(difficulty+100)) + enemy.speed *= 1 + (difficulty/100) + enemy.health *= 1 + (difficulty/100) + spawn_points[direction].add_spawn(Spawn.new(delay,enemy)) + difficulty_left -= enemy.difficulty + +func change_level(): + if player.inventory.in_shop: + shop.stop() + player.inventory.in_shop = false + player.score += 20 + player.inventory.update_stats() + difficulty += 2 + for level in levels: + level.enabled = false + level.navigation_enabled = false + + levels_until_shop -= 1 + if levels_until_shop <= 0: + shop.start() + player.inventory.in_shop = true + levels_until_shop = 3 + return + + var level = levels.pick_random() + level.enabled = true + level.navigation_enabled = true + + make_spawns() + + + +func _on_top_body_entered(body: Node2D) -> void: + if not body is Player: + return + last_direction = 2 + print("top") + change_level() + player.position = Vector2(128,256-player.scale.x*32) + + + + +func _on_bottom_body_entered(body: Node2D) -> void: + if not body is Player: + return + last_direction = 0 + change_level() + print("bottom") + player.position = Vector2(128,0+player.scale.x*32) + + + +func _on_left_body_entered(body: Node2D) -> void: + if not body is Player: + return + last_direction = 1 + change_level() + print("left") + player.position = Vector2(256-player.scale.x*32,128) + + + + +func _on_right_body_entered(body: Node2D) -> void: + if not body is Player: + return + last_direction = 3 + change_level() + print("right") + player.position = Vector2(0+player.scale.x*32,128) + diff --git a/scenes/world/level.gd.uid b/scenes/world/level.gd.uid new file mode 100644 index 0000000..bf3e3a3 --- /dev/null +++ b/scenes/world/level.gd.uid @@ -0,0 +1 @@ +uid://c75kdxk3eemei diff --git a/scenes/world/shop.gd b/scenes/world/shop.gd new file mode 100644 index 0000000..1a79e17 --- /dev/null +++ b/scenes/world/shop.gd @@ -0,0 +1,38 @@ +extends TileMapLayer + +@export var upgrade : PackedScene + +@export var inventory : Control + +var upgrades : Array[Upgrade] + +@export var spawn_points : Array[Marker2D] + +var working = false + +func _process(delta): + if working: + if len(upgrades) < len(spawn_points): + add_upgrade() + +func start(): + working = true + enabled = true + +func stop(): + for upgrade in get_tree().get_nodes_in_group("upgrades"): + upgrade.queue_free() + upgrades.clear() + enabled = false + + working = false + +func add_upgrade(): + var new_upgrade = upgrade.instantiate() + var random_spawn_point : Marker2D = spawn_points.pick_random() + while random_spawn_point.get_children() != []: + random_spawn_point = spawn_points.pick_random() + #new_upgrade.global_position = random_spawn_point.global_position + new_upgrade.inventory = inventory + random_spawn_point.add_child(new_upgrade) + upgrades.append(new_upgrade) diff --git a/scenes/world/shop.gd.uid b/scenes/world/shop.gd.uid new file mode 100644 index 0000000..67d5a12 --- /dev/null +++ b/scenes/world/shop.gd.uid @@ -0,0 +1 @@ +uid://dl3s53elpx43k diff --git a/scenes/world/shop.tscn b/scenes/world/shop.tscn new file mode 100644 index 0000000..3fd6146 --- /dev/null +++ b/scenes/world/shop.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=4 format=4 uid="uid://ck3pogpwo5gtx"] + +[ext_resource type="TileSet" uid="uid://bawet85hqjpku" path="res://scenes/world/tilemap/tile_map.tres" id="1_ndatx"] +[ext_resource type="Script" uid="uid://dl3s53elpx43k" path="res://scenes/world/shop.gd" id="2_vue3k"] +[ext_resource type="PackedScene" uid="uid://dsgvdus6pyld1" path="res://scenes/inventory/upgrades/upgrade.tscn" id="3_vue3k"] + +[node name="Shop" type="TileMapLayer" node_paths=PackedStringArray("spawn_points") groups=["terrain"]] +tile_map_data = PackedByteArray("AAAAAAAAAgAEAAAAAAABAAAAAgAEAAAAAAACAAAAAgAEAAAAAAACAAEAAgAEAAAAAAADAAEAAgAEAAAAAAAEAAEAAgAEAAAAAAAFAAEAAgAEAAAAAAAHAAEAAgAEAAAAAAAIAAEAAgAEAAAAAAAKAAEAAgAEAAAAAAALAAEAAgAEAAAAAAAMAAEAAgAEAAAAAAANAAEAAgAEAAAAAAANAAAAAgAEAAAAAAAOAAAAAgAEAAAAAAAPAAAAAgAEAAAAAAAAAAEAAgAEAAAAAAAAAAIAAgAEAAAAAAAAAAMAAgAEAAAAAAAAAAQAAgAEAAAAAAAAAAUAAgAEAAAAAAAAAAYAAgADAAIAAAAAAAcAAgAEAAAAAAAAAAgAAgAEAAAAAAAAAAkAAgADAAIAAAAAAAoAAgAEAAAAAAAAAAsAAgAEAAAAAAAAAAwAAgAEAAAAAAAAAA0AAgAEAAAAAAAAAA4AAgAEAAAAAAAAAA8AAgAEAAAAAAABAAEAAgAEAAAAAAABAAIAAgAEAAAAAAABAAMAAgAEAAAAAAABAAQAAgAEAAAAAAABAAUAAgAEAAAAAAABAAcAAgAEAAAAAAABAAgAAgAEAAAAAAABAAoAAgAEAAAAAAABAAsAAgAEAAAAAAABAAwAAgAEAAAAAAABAA0AAgAEAAAAAAABAA4AAgAEAAAAAAABAA8AAgAEAAAAAAACAAQAAgAEAAAAAAACAAUAAgAEAAAAAAACAAcAAgAEAAAAAAACAAgAAgAEAAAAAAACAAoAAgAEAAAAAAACAAsAAgAEAAAAAAACAA4AAgAEAAAAAAACAA8AAgAEAAAAAAADAAAAAgAEAAAAAAADAAUAAgAEAAAAAAADAAcAAgAEAAAAAAADAAgAAgAEAAAAAAADAAoAAgAEAAAAAAADAA4AAgAEAAAAAAADAA8AAgAEAAAAAAAEAA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APAAcAAgAEAAAAAAAPAAgAAgAEAAAAAAAPAAkAAgADAAAAAAAPAAoAAgAEAAAAAAAPAAsAAgAEAAAAAAAPAAwAAgAEAAAAAAAPAA0AAgAEAAAAAAAPAA4AAgAEAAAAAAAPAA8AAgAEAAAAAAD/////AgAAAAAAAAD//wAAAgACAAEAAAD//wEAAgACAAEAAAD//wIAAgACAAEAAAD//wMAAgACAAEAAAD//wQAAgACAAEAAAD//wUAAgACAAEAAAD//wYAAgAAAAEAAAD//wkAAgAAAAAAAAD//woAAgACAAEAAAD//wsAAgACAAEAAAD//wwAAgACAAEAAAD//w0AAgACAAEAAAD//w4AAgACAAEAAAD//w8AAgACAAEAAAD//xAAAgAAAAEAAAAAABAAAgADAAEAAAABABAAAgADAAEAAAACABAAAgADAAEAAAADABAAAgADAAEAAAAEABAAAgADAAEAAAAFABAAAgADAAEAAAAGABAAAgABAAEAAAAJABAAAgAAAAEAAAAKABAAAgADAAEAAAALABAAAgADAAEAAAAMABAAAgADAAEAAAANABAAAgADAAEAAAAOABAAAgADAAEAAAAPABAAAgADAAEAAAAQABAAAgABAAEAAAAQAA8AAgACAAEAAAAQAA4AAgACAAEAAAAQAA0AAgACAAEAAAAQAAwAAgACAAEAAAAQAAsAAgACAAEAAAAQAAoAAgACAAEAAAAQAAkAAgABAAAAAAAQAAYAAgABAAEAAAAQAAUAAgACAAEAAAAQAAQAAgACAAEAAAAQAAMAAgACAAEAAAAQAAIAAgACAAEAAAAQAAEAAgACAAEAAAAQAAAAAgACAAEAAAAQAP//AgABAAAAAAAPAP//AgADAAEAAAAOAP//AgADAAEAAAANAP//AgADAAEAAAAMAP//AgADAAEAAAALAP//AgADAAEAAAAKAP//AgADAAEAAAAJAP//AgAAAAAAAAAGAP//AgABAAAAAAAFAP//AgADAAEAAAAEAP//AgADAAEAAAADAP//AgADAAEAAAACAP//AgADAAEAAAABAP//AgADAAEAAAAAAP//AgADAAEAAAAGAA8AAgACAAAAAAAHAA8AAgAEAAAAAAAIA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AAwAAgAEAAAAAAAMAAwAAgAEAAAAAAAMAAsAAgAEAAAAAAAMAA0AAgAEAAAAAAAJAAkAAgAEAAAAAAAMAAQAAgAEAAAAAAA=") +tile_set = ExtResource("1_ndatx") +script = ExtResource("2_vue3k") +upgrade = ExtResource("3_vue3k") +spawn_points = [NodePath("Marker2D"), NodePath("Marker2D2"), NodePath("Marker2D3")] + +[node name="Marker2D" type="Marker2D" parent="."] +position = Vector2(92, 132) + +[node name="Marker2D2" type="Marker2D" parent="."] +position = Vector2(126, 132) + +[node name="Marker2D3" type="Marker2D" parent="."] +position = Vector2(159, 132) diff --git a/scenes/world/spawner.gd b/scenes/world/spawner.gd new file mode 100644 index 0000000..228126d --- /dev/null +++ b/scenes/world/spawner.gd @@ -0,0 +1,37 @@ +extends Marker2D + +var spawns : Array[Level.Spawn] + + +var next_spawn : Level.Spawn + +var timer = 2 + +var spawning = false + +func _process(delta): + + if spawns == []: + spawning = false + + if spawning: + timer -= delta + if timer < 0: + spawn(next_spawn.enemy) + timer = next_spawn.delay + spawns.erase(next_spawn) + timer = 2 + if spawns != []: + next_spawn = spawns.pick_random() + +func spawn(enemy : CharacterBody2D): + enemy.player = get_tree().get_nodes_in_group("player")[0] + + enemy.global_position = global_position + get_parent().add_child(enemy) + +func add_spawn(spawn : Level.Spawn): + spawns.append(spawn) + next_spawn = spawn + spawning = true + diff --git a/scenes/world/spawner.gd.uid b/scenes/world/spawner.gd.uid new file mode 100644 index 0000000..dbff0f9 --- /dev/null +++ b/scenes/world/spawner.gd.uid @@ -0,0 +1 @@ +uid://c2lpqem5ubn4r diff --git a/scenes/world/tilemap/tile_map.tres b/scenes/world/tilemap/tile_map.tres new file mode 100644 index 0000000..e27143f --- /dev/null +++ b/scenes/world/tilemap/tile_map.tres @@ -0,0 +1,119 @@ +[gd_resource type="TileSet" load_steps=4 format=3 uid="uid://bawet85hqjpku"] + +[ext_resource type="Texture2D" uid="uid://fi7000wjcmkt" path="res://scenes/world/tilemap/tilemap.png" id="1_d21gp"] + +[sub_resource type="NavigationPolygon" id="NavigationPolygon_l616b"] +vertices = PackedVector2Array(8, 8, -8, 8, -8, -8, 8, -8) +polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) +outlines = Array[PackedVector2Array]([PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)]) +agent_radius = 0.0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_l616b"] +texture = ExtResource("1_d21gp") +0:0/0 = 0 +0:0/0/terrain_set = 0 +0:0/0/terrain = 0 +0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -4, -4, -8, 8, -8, 8, 8, -8, 8) +0:0/0/terrains_peering_bit/right_side = 0 +0:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0 = 0 +1:0/0/terrain_set = 0 +1:0/0/terrain = 0 +1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 4, -8, 8, -4, 8, 8, -8, 8) +1:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0/terrains_peering_bit/left_side = 0 +2:0/0 = 0 +2:0/0/terrain_set = 0 +2:0/0/terrain = 0 +2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -8, 4, -8, 8, -4, 8, 8, -8, 8, -8, -4) +2:0/0/terrains_peering_bit/bottom_side = 0 +3:0/0 = 0 +3:0/0/terrain_set = 0 +3:0/0/terrain = 0 +3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -4, -4, -8, 8, -8, 8, 8, -4, 8, -8, 4) +3:0/0/terrains_peering_bit/right_side = 0 +1:1/0 = 0 +1:1/0/terrain_set = 0 +1:1/0/terrain = 0 +1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 4, 4, 8, -8, 8) +1:1/0/terrains_peering_bit/left_side = 0 +1:1/0/terrains_peering_bit/top_side = 0 +2:1/0 = 0 +2:1/0/terrain_set = 0 +2:1/0/terrain = 0 +2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:1/0/terrains_peering_bit/bottom_side = 0 +2:1/0/terrains_peering_bit/top_side = 0 +3:1/0 = 0 +3:1/0/terrain_set = 0 +3:1/0/terrain = 0 +3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:1/0/terrains_peering_bit/right_side = 0 +3:1/0/terrains_peering_bit/left_side = 0 +0:2/0 = 0 +0:2/0/terrain_set = 0 +0:2/0/terrain = 0 +0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +0:2/0/terrains_peering_bit/right_side = 0 +0:2/0/terrains_peering_bit/bottom_side = 0 +0:2/0/terrains_peering_bit/left_side = 0 +0:2/0/terrains_peering_bit/top_side = 0 +1:2/0 = 0 +1:2/0/terrain_set = 0 +1:2/0/terrain = 0 +1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -8, 4, -8, 8, -4, 8, 4, 4, 8, -4, 8, -8, 4, -8, -4) +2:2/0 = 0 +2:2/0/terrain_set = 0 +2:2/0/terrain = 0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 4, 4, 8, -4, 8, -8, 4) +2:2/0/terrains_peering_bit/top_side = 0 +3:2/0 = 0 +3:2/0/terrain_set = 0 +3:2/0/terrain = 0 +3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 4, -8, 8, -4, 8, 4, 4, 8, -8, 8) +3:2/0/terrains_peering_bit/left_side = 0 +0:3/0 = 0 +0:3/0/terrain_set = 0 +0:3/0/terrain = 0 +0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +0:3/0/terrains_peering_bit/right_side = 0 +0:3/0/terrains_peering_bit/bottom_side = 0 +0:3/0/terrains_peering_bit/left_side = 0 +1:3/0 = 0 +1:3/0/terrain_set = 0 +1:3/0/terrain = 0 +1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +1:3/0/terrains_peering_bit/right_side = 0 +1:3/0/terrains_peering_bit/bottom_side = 0 +1:3/0/terrains_peering_bit/top_side = 0 +2:3/0 = 0 +2:3/0/terrain_set = 0 +2:3/0/terrain = 0 +2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:3/0/terrains_peering_bit/right_side = 0 +2:3/0/terrains_peering_bit/left_side = 0 +2:3/0/terrains_peering_bit/top_side = 0 +3:3/0 = 0 +3:3/0/terrain_set = 0 +3:3/0/terrain = 0 +3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:3/0/terrains_peering_bit/bottom_side = 0 +3:3/0/terrains_peering_bit/left_side = 0 +3:3/0/terrains_peering_bit/top_side = 0 +4:0/0 = 0 +4:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_l616b") +0:1/0 = 0 +0:1/0/terrain_set = 0 +0:1/0/terrain = 0 +0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -4, 8, -8, 4) +0:1/0/terrains_peering_bit/right_side = 0 +0:1/0/terrains_peering_bit/top_side = 0 + +[resource] +physics_layer_0/collision_layer = 5 +physics_layer_0/collision_mask = 5 +terrain_set_0/mode = 2 +terrain_set_0/terrain_0/name = "Wall" +terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1) +navigation_layer_0/layers = 1 +sources/2 = SubResource("TileSetAtlasSource_l616b") diff --git a/scenes/world/tilemap/tilemap.png b/scenes/world/tilemap/tilemap.png new file mode 100644 index 0000000..82b6be3 Binary files /dev/null and b/scenes/world/tilemap/tilemap.png differ diff --git a/scenes/world/tilemap/tilemap.png.import b/scenes/world/tilemap/tilemap.png.import new file mode 100644 index 0000000..fc8a770 --- /dev/null +++ b/scenes/world/tilemap/tilemap.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fi7000wjcmkt" +path="res://.godot/imported/tilemap.png-92e6ed1179a7af7b48568bdbdb705400.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/world/tilemap/tilemap.png" +dest_files=["res://.godot/imported/tilemap.png-92e6ed1179a7af7b48568bdbdb705400.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/world/tilemap/tilemap.pxo b/scenes/world/tilemap/tilemap.pxo new file mode 100644 index 0000000..c4beb99 Binary files /dev/null and b/scenes/world/tilemap/tilemap.pxo differ diff --git a/scenes/world/tilemap/tilemapcornerless.pxo b/scenes/world/tilemap/tilemapcornerless.pxo new file mode 100644 index 0000000..41e423e Binary files /dev/null and b/scenes/world/tilemap/tilemapcornerless.pxo differ diff --git a/scenes/world/world.tscn b/scenes/world/world.tscn index fd6e79b..8896e18 100644 --- a/scenes/world/world.tscn +++ b/scenes/world/world.tscn @@ -1,28 +1,151 @@ -[gd_scene load_steps=5 format=3 uid="uid://dinanmpmnja1"] +[gd_scene load_steps=16 format=4 uid="uid://dinanmpmnja1"] [ext_resource type="PackedScene" uid="uid://o6e5ybx262ig" path="res://scenes/inventory/inventory.tscn" id="1_dphjl"] [ext_resource type="PackedScene" uid="uid://citwevx7xvypn" path="res://scenes/player/player.tscn" id="2_sl2e5"] [ext_resource type="PackedScene" uid="uid://bnufqnypubedj" path="res://scenes/enemies/grunt/grunt.tscn" id="3_1fp7r"] +[ext_resource type="TileSet" uid="uid://bawet85hqjpku" path="res://scenes/world/tilemap/tile_map.tres" id="4_6m72w"] +[ext_resource type="PackedScene" uid="uid://b6lmouoh2607b" path="res://scenes/enemies/shooter/shooter.tscn" id="5_1yooq"] +[ext_resource type="Script" uid="uid://c2lpqem5ubn4r" path="res://scenes/world/spawner.gd" id="6_bq33v"] +[ext_resource type="PackedScene" uid="uid://ck3pogpwo5gtx" path="res://scenes/world/shop.tscn" id="6_j2gmx"] +[ext_resource type="Script" uid="uid://c75kdxk3eemei" path="res://scenes/world/level.gd" id="6_t5ptc"] +[ext_resource type="Texture2D" uid="uid://bobe81o0a80s1" path="res://scenes/world/blocked.png" id="7_bq33v"] -[sub_resource type="NavigationPolygon" id="NavigationPolygon_6m72w"] -vertices = PackedVector2Array(248, 10.9219, 248, 246.031, 8.07031, 246.961, 9.92188, 9.07031) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)]) -outlines = Array[PackedVector2Array]([PackedVector2Array(258, 1, 258, 256, -2, 257, 0, -1)]) +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_t5ptc"] +normal = Vector2(0, 1) +distance = -1.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_bq33v"] +normal = Vector2(1, 0) +distance = -1.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_j2gmx"] +normal = Vector2(-1, 0) +distance = -256.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1yooq"] +distance = -256.0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_t5ptc"] +size = Vector2(30, 15) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_bq33v"] +size = Vector2(15, 30) [node name="World" type="Node2D"] [node name="UI" type="CanvasLayer" parent="."] -[node name="Inventory" parent="UI" node_paths=PackedStringArray("player") instance=ExtResource("1_dphjl")] +[node name="Inventory" parent="UI" node_paths=PackedStringArray("levels", "player") instance=ExtResource("1_dphjl")] +levels = NodePath("../../Levels") player = NodePath("../../Player") [node name="Player" parent="." node_paths=PackedStringArray("inventory") instance=ExtResource("2_sl2e5")] -position = Vector2(131, 131) +position = Vector2(128, 128) inventory = NodePath("../UI/Inventory") -[node name="Grunt" parent="." node_paths=PackedStringArray("player") instance=ExtResource("3_1fp7r")] -position = Vector2(42, 47) +[node name="Levels" type="Node2D" parent="." node_paths=PackedStringArray("spawn_points", "levels", "player")] +z_index = -1 +script = ExtResource("6_t5ptc") +spawn_points = [NodePath("Spawn"), NodePath("Spawn2"), NodePath("Spawn3"), NodePath("Spawn4")] +levels = [NodePath("1"), NodePath("2")] +enemies = Array[PackedScene]([ExtResource("3_1fp7r"), ExtResource("5_1yooq")]) player = NodePath("../Player") -[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] -navigation_polygon = SubResource("NavigationPolygon_6m72w") +[node name="1" type="TileMapLayer" parent="Levels" groups=["terrain"]] +tile_map_data = PackedByteArray("AAAAAAAAAgAEAAAAAAABAAAAAgAEAAAAAAACAAAAAgAEAAAAAAACAAEAAgAEAAAAAAADAAEAAgAEAAAAAAAEAAEAAgAEAAAAAAAFAAEAAgAEAAAAAAAHAAEAAgAEAAAAAAAIAAEAAgAEAAAAAAAKAAEAAgAEAAAAAAALAAEAAgAEAAAAAAAMAAEAAgAEAAAAAAANAAEAAgAEAAAAAAANAAAAAgAEAAAAAAAOAAAAAgAEAAAAAAAPAAAAAgAEAAAAAAAAAAEAAgAEAAAAAAAAAAIAAgAEAAAAAAAAAAMAAgAEAAAAAAAAAAQAAgAEAAAAAAAAAAUAAgAEAAAAAAAAAAYAAgADAAIAAAAAAAcAAgAEAAAAAAAAAAgAAgAEAAAAAAAAAAkAAgADAAIAAAAAAAoAAgAEAAAAAAAAAAsAAgAEAAAAAAAAAAwAAgAEAAAAAAAAAA0AAgAEAAAAAAAAAA4AAgAEAAAAAAAAAA8AAgAEAAAAAAABAAEAAgAEAAAAAAABAAIAAgAEAAAAAAABAAMAAgAEAAAAAAABAAQAAgAEAAAAAAABAAUAAgAEAAAAAAABAAcAAgAEAA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FAAcAAgAEAAAAAAAFAAgAAgAEAAAAAAAFAAkAAgAEAAAAAAAEAAkAAgAEAAAAAAAFAAoAAgAEAAAAAAAGAAoAAgAEAAAAAAAGAAsAAgAEAAAAAAAHAAkAAgAEAAAAAAAIAAkAAgAEAAAAAAACAAIAAgAEAAAAAAACAAMAAgAEAAAAAAALAAIAAgAEAAAAAAALAAMAAgAEAAAAAAALAAQAAgAEAAAAAAALAAUAAgAEAAAAAAALAAkAAgAEAAAAAAAMAAcAAgAEAAAAAAAMAAYAAgAEAAAAAAAMAAUAAgAEAAAAAAANAAUAAgAEAAAAAAANAAYAAgAEAAAAAAANAAQAAgAEAAAAAAANAAMAAgAEAAAAAAANAAIAAgAEAAAAAAAOAAIAAgAEAAAAAAAOAAMAAgAEAAAAAAAPAAMAAgAEAAAAAAANAAcAAgAEAAAAAAA=") +tile_set = ExtResource("4_6m72w") + +[node name="Shop" parent="Levels" node_paths=PackedStringArray("inventory") instance=ExtResource("6_j2gmx")] +enabled = false +inventory = NodePath("../../UI/Inventory") + +[node name="Spawn" type="Marker2D" parent="Levels"] +position = Vector2(128, -17) +script = ExtResource("6_bq33v") + +[node name="Spawn2" type="Marker2D" parent="Levels"] +position = Vector2(268, 128) +script = ExtResource("6_bq33v") + +[node name="Spawn3" type="Marker2D" parent="Levels"] +position = Vector2(127, 276) +script = ExtResource("6_bq33v") + +[node name="Spawn4" type="Marker2D" parent="Levels"] +position = Vector2(-28, 129) +script = ExtResource("6_bq33v") + +[node name="World Border" type="StaticBody2D" parent="Levels"] +collision_layer = 2 +collision_mask = 2 + +[node name="Top" type="CollisionShape2D" parent="Levels/World Border"] +shape = SubResource("WorldBoundaryShape2D_t5ptc") + +[node name="Left" type="CollisionShape2D" parent="Levels/World Border"] +shape = SubResource("WorldBoundaryShape2D_bq33v") + +[node name="Right" type="CollisionShape2D" parent="Levels/World Border"] +shape = SubResource("WorldBoundaryShape2D_j2gmx") + +[node name="Bottom" type="CollisionShape2D" parent="Levels/World Border"] +shape = SubResource("WorldBoundaryShape2D_1yooq") + +[node name="Top" type="Area2D" parent="Levels"] +position = Vector2(128, -10) +collision_layer = 2 +collision_mask = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Levels/Top"] +shape = SubResource("RectangleShape2D_t5ptc") + +[node name="Blocked" type="Sprite2D" parent="Levels/Top"] +position = Vector2(0, 18) +texture = ExtResource("7_bq33v") + +[node name="Bottom" type="Area2D" parent="Levels"] +position = Vector2(128, 266) +collision_layer = 2 +collision_mask = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Levels/Bottom"] +shape = SubResource("RectangleShape2D_t5ptc") + +[node name="Blocked2" type="Sprite2D" parent="Levels/Bottom"] +position = Vector2(0, -18) +texture = ExtResource("7_bq33v") + +[node name="Left" type="Area2D" parent="Levels"] +position = Vector2(-10, 128) +collision_layer = 2 +collision_mask = 2 + +[node name="Blocked3" type="Sprite2D" parent="Levels/Left"] +position = Vector2(18, 0) +rotation = 1.5708 +texture = ExtResource("7_bq33v") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Levels/Left"] +shape = SubResource("RectangleShape2D_bq33v") + +[node name="Right" type="Area2D" parent="Levels"] +position = Vector2(266, 128) +collision_layer = 2 +collision_mask = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Levels/Right"] +shape = SubResource("RectangleShape2D_bq33v") + +[node name="Blocked4" type="Sprite2D" parent="Levels/Right"] +position = Vector2(-18, 0) +rotation = 1.5708 +texture = ExtResource("7_bq33v") + +[connection signal="body_entered" from="Levels/Top" to="Levels" method="_on_top_body_entered"] +[connection signal="body_entered" from="Levels/Bottom" to="Levels" method="_on_bottom_body_entered"] +[connection signal="body_entered" from="Levels/Left" to="Levels" method="_on_left_body_entered"] +[connection signal="body_entered" from="Levels/Right" to="Levels" method="_on_right_body_entered"] diff --git a/upgrade.gd b/upgrade.gd new file mode 100644 index 0000000..3289510 --- /dev/null +++ b/upgrade.gd @@ -0,0 +1,57 @@ +extends Area2D + +class_name Upgrade + +@export var inventory : Control + +@onready var sprite = $CanvasLayer/Sprite2D + +var dragging = false + +var last_position + +var layer = 0 + +var cost = 100 + +enum UpgradeTypes{PLUS,MINUS} +var upgrade : UpgradeTypes = UpgradeTypes.PLUS + +func _ready(): + + sprite.global_position = global_position + last_position = sprite.position + +func _process(delta): + if not dragging: return + sprite.global_position = get_global_mouse_position() + + +func _input(event): + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT and not event.pressed: + inventory.call_deferred("update_calculations") + dragging = false + Globals.mouse_dragging = false + var inventory_position = inventory.global_to_inventory_coords(sprite.global_position) + if inventory_position != null: + inventory.player.money -= cost + match upgrade: + UpgradeTypes.PLUS: + add_value(inventory_position) + + inventory.update_stats() + queue_free() + else: + sprite.position = last_position + + +func add_value(inventory_position : Vector2i): + inventory.items[0][inventory_position.y][inventory_position.x].set_value(inventory.items[0][inventory_position.y][inventory_position.x]._value+1) + + +func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void: + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT and event.pressed and inventory.player.money >= cost: + dragging = true + Globals.mouse_dragging = true diff --git a/upgrade.gd.uid b/upgrade.gd.uid new file mode 100644 index 0000000..43cb6e7 --- /dev/null +++ b/upgrade.gd.uid @@ -0,0 +1 @@ +uid://cratbhruo2vb