commit 9028ec47cc3aea9524c13a80d1bec6624e566725 Author: Florian GOLESTIN Date: Sat Jan 17 14:36:11 2026 +0100 initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..804aa1a --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Godot 4+ specific ignores +.godot/ +/android/ + +# Godot-specific ignores +.import/ +export.cfg +export_credentials.cfg +*.tmp + +# Imported translations (automatically generated from CSV files) +*.translation + +# Mono-specific ignores +.mono/ +data_*/ +mono_crash.*.json \ No newline at end of file diff --git a/Characters/Ships/cannon.png b/Characters/Ships/cannon.png new file mode 100644 index 0000000..aa4633d Binary files /dev/null and b/Characters/Ships/cannon.png differ diff --git a/Characters/Ships/cannon.png.import b/Characters/Ships/cannon.png.import new file mode 100644 index 0000000..fbd4d03 --- /dev/null +++ b/Characters/Ships/cannon.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bfasty7u5jibk" +path="res://.godot/imported/cannon.png-dc15436d4132d6e7a169752927a26cbd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Characters/Ships/cannon.png" +dest_files=["res://.godot/imported/cannon.png-dc15436d4132d6e7a169752927a26cbd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Characters/Ships/cannonLoose.png b/Characters/Ships/cannonLoose.png new file mode 100644 index 0000000..a943b1f Binary files /dev/null and b/Characters/Ships/cannonLoose.png differ diff --git a/Characters/Ships/cannonLoose.png.import b/Characters/Ships/cannonLoose.png.import new file mode 100644 index 0000000..147289d --- /dev/null +++ b/Characters/Ships/cannonLoose.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu2uf2i2gaybu" +path="res://.godot/imported/cannonLoose.png-fcbe3c8c5f0142c69c1c5b26eefaad6d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Characters/Ships/cannonLoose.png" +dest_files=["res://.godot/imported/cannonLoose.png-fcbe3c8c5f0142c69c1c5b26eefaad6d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Characters/Ships/pirate_ships.png b/Characters/Ships/pirate_ships.png new file mode 100644 index 0000000..69607e0 Binary files /dev/null and b/Characters/Ships/pirate_ships.png differ diff --git a/Characters/Ships/pirate_ships.png.import b/Characters/Ships/pirate_ships.png.import new file mode 100644 index 0000000..8901f25 --- /dev/null +++ b/Characters/Ships/pirate_ships.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dani7ta4kpqva" +path="res://.godot/imported/pirate_ships.png-251b8d05dece67264077136b4d18990d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Characters/Ships/pirate_ships.png" +dest_files=["res://.godot/imported/pirate_ships.png-251b8d05dece67264077136b4d18990d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Characters/Ships/player_ship.png b/Characters/Ships/player_ship.png new file mode 100644 index 0000000..1926ed1 Binary files /dev/null and b/Characters/Ships/player_ship.png differ diff --git a/Characters/Ships/player_ship.png.import b/Characters/Ships/player_ship.png.import new file mode 100644 index 0000000..25ba779 --- /dev/null +++ b/Characters/Ships/player_ship.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://83sv1yu3pkya" +path="res://.godot/imported/player_ship.png-e3cdd6a26359a0a84ebf04a818419ad8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Characters/Ships/player_ship.png" +dest_files=["res://.godot/imported/player_ship.png-e3cdd6a26359a0a84ebf04a818419ad8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Characters/pirate.gd b/Characters/pirate.gd new file mode 100644 index 0000000..4d18802 --- /dev/null +++ b/Characters/pirate.gd @@ -0,0 +1,54 @@ +extends RigidBody2D + +# Paramètres ajustables +@export var speed: float = 150.0 +@export var shoot_range: float = 300.0 # Distance minimale pour tirer +@export var shoot_cooldown: float = 1.5 # Délai entre les tirs +@export var bullet_scene: PackedScene # Scène de la balle (à assigner dans l'inspecteur) +@export var shoot_angle_variation: float = 15.0 # Variation en degrés + +@onready var shoot_timer = $ShootTimer +@onready var player = null # Référence au joueur, à assigner via code ou groupe + +func _ready(): + # Trouve le joueur (suppose qu'il est dans le groupe "players") + var players = get_tree().get_nodes_in_group("players") + if players.size() > 0: + player = players[0] + shoot_timer.timeout.connect(_on_shoot_timer_timeout) + +func _physics_process(_delta: float): + if player: + if position.distance_to(player.position) < shoot_range: + look_at(player.position) # Oriente le bateau vers le joueur + if shoot_timer.is_stopped(): + shoot_timer.start(shoot_cooldown) + else: + # Direction vers le joueur + var direction = (player.position - position).normalized() + # Applique une force pour se déplacer + apply_central_force(direction * speed) + + +func _on_shoot_timer_timeout(): + if player: + _shoot() + +func _shoot(): + # Crée une balle + var bullet = bullet_scene.instantiate() + # Position devant le bateau + bullet.position = position + global_transform.x * 100.0 # 50 pixels devant + # Rotation avec variation aléatoire + var angle_rad = deg_to_rad(randf_range(-shoot_angle_variation, shoot_angle_variation)) + #bullet.rotation = rotation + angle_rad + bullet.rotation = self.rotation + angle_rad + # Ajoute la balle à la scène + get_parent().add_child(bullet) + +# Fonction pour convertir les degrés en radians +func deg_to_rad(degrees: float) -> float: + return degrees * PI / 180.0 + +func take_damage(_damage : float): + queue_free() diff --git a/Characters/pirate.gd.uid b/Characters/pirate.gd.uid new file mode 100644 index 0000000..a9eaf3d --- /dev/null +++ b/Characters/pirate.gd.uid @@ -0,0 +1 @@ +uid://dtxvik61iarsj diff --git a/Characters/pirate.tscn b/Characters/pirate.tscn new file mode 100644 index 0000000..f617bfe --- /dev/null +++ b/Characters/pirate.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=6 format=3 uid="uid://mh40qx1bhgs5"] + +[ext_resource type="Script" uid="uid://dtxvik61iarsj" path="res://Characters/pirate.gd" id="1_afkof"] +[ext_resource type="Texture2D" uid="uid://dani7ta4kpqva" path="res://Characters/Ships/pirate_ships.png" id="1_u2x3i"] +[ext_resource type="PackedScene" uid="uid://ngrscx1l0dn5" path="res://GPE/CannonBall/cannon_ball.tscn" id="2_gsuw1"] +[ext_resource type="Texture2D" uid="uid://bu2uf2i2gaybu" path="res://Characters/Ships/cannonLoose.png" id="2_h5orw"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_h5orw"] +radius = 39.0 +height = 136.0 + +[node name="Pirate" type="RigidBody2D"] +gravity_scale = 0.0 +linear_damp = 0.5 +script = ExtResource("1_afkof") +bullet_scene = ExtResource("2_gsuw1") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +rotation = -1.5707964 +shape = SubResource("CapsuleShape2D_h5orw") + +[node name="Sprite2D" type="Sprite2D" parent="."] +rotation = -1.5707964 +texture = ExtResource("1_u2x3i") + +[node name="Sprite2D2" type="Sprite2D" parent="Sprite2D"] +position = Vector2(0, 35) +rotation = 1.5707964 +texture = ExtResource("2_h5orw") + +[node name="ShootTimer" type="Timer" parent="."] diff --git a/Characters/player.gd b/Characters/player.gd new file mode 100644 index 0000000..64d3aa7 --- /dev/null +++ b/Characters/player.gd @@ -0,0 +1,41 @@ +extends Area2D + +@export var speed = 400 +@export var score : int = 0 +@export var bullet_scene: PackedScene + +var screen_size + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + screen_size = get_viewport_rect().size + $ShootTimer.timeout.connect(_on_shoot_timer_timeout) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + var velocity = Vector2.ZERO # The player's movement vector. + if Input.is_action_pressed("move_right"): + velocity.x += 1 + if Input.is_action_pressed("move_left"): + velocity.x -= 1 + if Input.is_action_pressed("move_down"): + velocity.y += 1 + if Input.is_action_pressed("move_up"): + velocity.y -= 1 + if velocity.length() > 0: + velocity = velocity.normalized() * speed + rotation = velocity.angle() #velocity.angle() + PI/2 + position += velocity * delta + #position = position.clamp(Vector2.ZERO, screen_size) + +func _on_shoot_timer_timeout(): + _shoot(Vector2(0, 80)) + _shoot(Vector2(0, -80)) + +func _shoot(socket : Vector2): + var bullet = bullet_scene.instantiate() + bullet.position = position + socket.rotated(self.rotation) + bullet.rotation = self.rotation + PI/2 * sign(socket.y) + get_parent().add_child(bullet) + diff --git a/Characters/player.gd.uid b/Characters/player.gd.uid new file mode 100644 index 0000000..03cd69d --- /dev/null +++ b/Characters/player.gd.uid @@ -0,0 +1 @@ +uid://doegfk88vnwo1 diff --git a/Characters/player.tscn b/Characters/player.tscn new file mode 100644 index 0000000..76c6158 --- /dev/null +++ b/Characters/player.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=7 format=3 uid="uid://ifus76ia8xws"] + +[ext_resource type="Texture2D" uid="uid://83sv1yu3pkya" path="res://Characters/Ships/player_ship.png" id="1_5mj4t"] +[ext_resource type="Script" uid="uid://doegfk88vnwo1" path="res://Characters/player.gd" id="1_eovys"] +[ext_resource type="PackedScene" uid="uid://ngrscx1l0dn5" path="res://GPE/CannonBall/cannon_ball.tscn" id="2_65n15"] +[ext_resource type="PackedScene" uid="uid://c2pruida0t5o0" path="res://Player/hud.tscn" id="3_vb825"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_eovys"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_5mj4t") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_vb825"] +radius = 37.0 +height = 118.0 + +[node name="Player" type="Area2D" groups=["players"]] +script = ExtResource("1_eovys") +bullet_scene = ExtResource("2_65n15") +metadata/_edit_group_ = true + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +rotation = -1.5707964 +sprite_frames = SubResource("SpriteFrames_eovys") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +rotation = -1.5707964 +shape = SubResource("CapsuleShape2D_vb825") + +[node name="CanvasLayer" parent="." instance=ExtResource("3_vb825")] + +[node name="Camera2D" type="Camera2D" parent="."] +drag_horizontal_enabled = true +drag_vertical_enabled = true + +[node name="ShootTimer" type="Timer" parent="."] +autostart = true diff --git a/GPE/CannonBall/cannonBall.png b/GPE/CannonBall/cannonBall.png new file mode 100644 index 0000000..2ea9d8d Binary files /dev/null and b/GPE/CannonBall/cannonBall.png differ diff --git a/GPE/CannonBall/cannonBall.png.import b/GPE/CannonBall/cannonBall.png.import new file mode 100644 index 0000000..ac45d8b --- /dev/null +++ b/GPE/CannonBall/cannonBall.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6hx4g1df1di4" +path="res://.godot/imported/cannonBall.png-20ae8c138ccee3b0dfc31c48c762291f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://GPE/CannonBall/cannonBall.png" +dest_files=["res://.godot/imported/cannonBall.png-20ae8c138ccee3b0dfc31c48c762291f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/GPE/CannonBall/cannon_ball.gd b/GPE/CannonBall/cannon_ball.gd new file mode 100644 index 0000000..a4d0a87 --- /dev/null +++ b/GPE/CannonBall/cannon_ball.gd @@ -0,0 +1,19 @@ +extends Area2D + + + +@export var speed: float = 200.0 +@export var damage: int = 10 + +func _ready(): + # Déplace la balle dans la direction de sa rotation + #var velocity = Vector2(speed, 0).rotated(rotation) + connect("body_entered", _on_body_entered) + +func _physics_process(delta: float): + position += Vector2(speed, 0).rotated(rotation) * delta + +func _on_body_entered(body): + if body.has_method("take_damage"): + body.take_damage(damage) + queue_free() diff --git a/GPE/CannonBall/cannon_ball.gd.uid b/GPE/CannonBall/cannon_ball.gd.uid new file mode 100644 index 0000000..7136b22 --- /dev/null +++ b/GPE/CannonBall/cannon_ball.gd.uid @@ -0,0 +1 @@ +uid://bp7a1qram84x3 diff --git a/GPE/CannonBall/cannon_ball.tscn b/GPE/CannonBall/cannon_ball.tscn new file mode 100644 index 0000000..e20d8f9 --- /dev/null +++ b/GPE/CannonBall/cannon_ball.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=4 format=3 uid="uid://ngrscx1l0dn5"] + +[ext_resource type="Texture2D" uid="uid://6hx4g1df1di4" path="res://GPE/CannonBall/cannonBall.png" id="1_f08vj"] +[ext_resource type="Script" uid="uid://bp7a1qram84x3" path="res://GPE/CannonBall/cannon_ball.gd" id="1_u2lho"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_u2lho"] +radius = 5.0 + +[node name="CannonBall" type="Area2D"] +script = ExtResource("1_u2lho") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_u2lho") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_f08vj") diff --git a/GPE/CannonBall/cannon_balll_old.tscn b/GPE/CannonBall/cannon_balll_old.tscn new file mode 100644 index 0000000..18913d8 --- /dev/null +++ b/GPE/CannonBall/cannon_balll_old.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=4 format=3 uid="uid://drpe7vgdqqyh4"] + +[ext_resource type="Texture2D" uid="uid://6hx4g1df1di4" path="res://GPE/CannonBall/cannonBall.png" id="2_so0x5"] + +[sub_resource type="GDScript" id="GDScript_3iblm"] +script/source = "extends RigidBody2D + +@export var speed: float = 150.0 + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + +func _physics_process(delta: float): + apply_central_force(Vector2(speed, 0).rotated(rotation)) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass +" + +[sub_resource type="CircleShape2D" id="CircleShape2D_orehy"] +radius = 5.0 + +[node name="RigidBody2D" type="RigidBody2D"] +gravity_scale = 0.0 +script = SubResource("GDScript_3iblm") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_orehy") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_so0x5") + +[node name="Sprite2D2" type="Sprite2D" parent="Sprite2D"] +position = Vector2(9, 0) +texture = ExtResource("2_so0x5") diff --git a/GPE/Coin/coin-64x64.png b/GPE/Coin/coin-64x64.png new file mode 100644 index 0000000..8065fb2 Binary files /dev/null and b/GPE/Coin/coin-64x64.png differ diff --git a/GPE/Coin/coin-64x64.png.import b/GPE/Coin/coin-64x64.png.import new file mode 100644 index 0000000..8a52853 --- /dev/null +++ b/GPE/Coin/coin-64x64.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cy1umt0i3b0jq" +path="res://.godot/imported/coin-64x64.png-5e5122687a858ab07d0280d93d0d9532.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://GPE/Coin/coin-64x64.png" +dest_files=["res://.godot/imported/coin-64x64.png-5e5122687a858ab07d0280d93d0d9532.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/GPE/Coin/coin.gd b/GPE/Coin/coin.gd new file mode 100644 index 0000000..eedf776 --- /dev/null +++ b/GPE/Coin/coin.gd @@ -0,0 +1,16 @@ +extends Area2D + +func _ready(): + # Connecte le signal de collision + #connect("body_entered", _on_body_entered) + connect("area_entered", _on_body_entered) + + print("Coucou") + +func _on_body_entered(body): + # Vérifie si le corps entrant est le joueur (ajuste selon ton nœud joueur) + if body.is_in_group("players"): + # Détruit le coin + queue_free() + + body.score += 100 diff --git a/GPE/Coin/coin.gd.uid b/GPE/Coin/coin.gd.uid new file mode 100644 index 0000000..5cd3bfe --- /dev/null +++ b/GPE/Coin/coin.gd.uid @@ -0,0 +1 @@ +uid://jhf8u5r4vbvm diff --git a/GPE/Coin/coin.tscn b/GPE/Coin/coin.tscn new file mode 100644 index 0000000..30198ab --- /dev/null +++ b/GPE/Coin/coin.tscn @@ -0,0 +1,201 @@ +[gd_scene load_steps=30 format=3 uid="uid://c8ek4me3t12pp"] + +[ext_resource type="Texture2D" uid="uid://cy1umt0i3b0jq" path="res://GPE/Coin/coin-64x64.png" id="1_1tl7t"] +[ext_resource type="Script" uid="uid://jhf8u5r4vbvm" path="res://GPE/Coin/coin.gd" id="1_h6kye"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_1tl7t"] +radius = 53.15073 + +[sub_resource type="AtlasTexture" id="AtlasTexture_h6kye"] +atlas = ExtResource("1_1tl7t") +region = Rect2(0, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tono4"] +atlas = ExtResource("1_1tl7t") +region = Rect2(64, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_008ja"] +atlas = ExtResource("1_1tl7t") +region = Rect2(128, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lwisg"] +atlas = ExtResource("1_1tl7t") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ewiup"] +atlas = ExtResource("1_1tl7t") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pyjji"] +atlas = ExtResource("1_1tl7t") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_le2pd"] +atlas = ExtResource("1_1tl7t") +region = Rect2(384, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uskek"] +atlas = ExtResource("1_1tl7t") +region = Rect2(448, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_utsp0"] +atlas = ExtResource("1_1tl7t") +region = Rect2(512, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w0rjv"] +atlas = ExtResource("1_1tl7t") +region = Rect2(576, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_earre"] +atlas = ExtResource("1_1tl7t") +region = Rect2(640, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i501j"] +atlas = ExtResource("1_1tl7t") +region = Rect2(704, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ewsff"] +atlas = ExtResource("1_1tl7t") +region = Rect2(768, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ldxko"] +atlas = ExtResource("1_1tl7t") +region = Rect2(832, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t6oc7"] +atlas = ExtResource("1_1tl7t") +region = Rect2(896, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_uye42"] +atlas = ExtResource("1_1tl7t") +region = Rect2(960, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s34pf"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1024, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o5m71"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1088, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1fm44"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1152, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w4y87"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1216, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pu1iv"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1280, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3t3ee"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1344, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ecfmc"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1408, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bb53q"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1472, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4lxdy"] +atlas = ExtResource("1_1tl7t") +region = Rect2(1536, 0, 64, 64) + +[sub_resource type="SpriteFrames" id="SpriteFrames_1tl7t"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_h6kye") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tono4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_008ja") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lwisg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ewiup") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pyjji") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_le2pd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uskek") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_utsp0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w0rjv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_earre") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i501j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ewsff") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ldxko") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t6oc7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_uye42") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_s34pf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o5m71") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1fm44") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w4y87") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pu1iv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3t3ee") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ecfmc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bb53q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4lxdy") +}], +"loop": true, +"name": &"default", +"speed": 24.0 +}] + +[node name="Coin" type="Area2D"] +scale = Vector2(0.5, 0.5) +script = ExtResource("1_h6kye") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_1tl7t") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_1tl7t") +autoplay = "default" diff --git a/Maps/Tiles/Tiles.tscn b/Maps/Tiles/Tiles.tscn new file mode 100644 index 0000000..b61546d --- /dev/null +++ b/Maps/Tiles/Tiles.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=3 format=4 uid="uid://c6rnvbhbn7ida"] + +[ext_resource type="TileSet" uid="uid://cy866rju3ffv3" path="res://Maps/Tiles/terrain_tileset.tres" id="1_ok65l"] +[ext_resource type="Script" uid="uid://cphm4sxgpf8nk" path="res://Maps/Tiles/tiles.gd" id="2_8cu1q"] + +[node name="Tiles" type="TileMapLayer"] +tile_map_data = PackedByteArray("AAACAAEAAQAAAAAAAAADAAEAAQABAAAAAAAEAAEAAQACAAcAAAAFAAEAAQACAAcAAAAFAAAAAQACAAcAAAAEAAAAAQACAAcAAAAEAAIAAQACAAcAAAAFAAIAAQACAAcAAAADAAIAAQAHAAYAAAADAAMAAQAHAAYAAAA=") +tile_set = ExtResource("1_ok65l") +script = ExtResource("2_8cu1q") diff --git a/Maps/Tiles/terrain_tileset.tres b/Maps/Tiles/terrain_tileset.tres new file mode 100644 index 0000000..88e5e7c --- /dev/null +++ b/Maps/Tiles/terrain_tileset.tres @@ -0,0 +1,111 @@ +[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://cy866rju3ffv3"] + +[ext_resource type="Texture2D" uid="uid://ctagdxk8n72nq" path="res://Maps/Tiles/test.png" id="1_hwl2e"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_8yysw"] +texture = ExtResource("1_hwl2e") +texture_region_size = Vector2i(64, 64) +0:0/0 = 0 +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 +4:0/0 = 0 +5:0/0 = 0 +6:0/0 = 0 +7:0/0 = 0 +8:0/0 = 0 +9:0/0 = 0 +0:1/0 = 0 +1:1/0 = 0 +2:1/0 = 0 +3:1/0 = 0 +4:1/0 = 0 +5:1/0 = 0 +6:1/0 = 0 +7:1/0 = 0 +8:1/0 = 0 +9:1/0 = 0 +0:2/0 = 0 +1:2/0 = 0 +2:2/0 = 0 +3:2/0 = 0 +4:2/0 = 0 +5:2/0 = 0 +6:2/0 = 0 +7:2/0 = 0 +8:2/0 = 0 +9:2/0 = 0 +0:3/0 = 0 +1:3/0 = 0 +2:3/0 = 0 +3:3/0 = 0 +4:3/0 = 0 +5:3/0 = 0 +6:3/0 = 0 +7:3/0 = 0 +8:3/0 = 0 +9:3/0 = 0 +0:4/0 = 0 +1:4/0 = 0 +2:4/0 = 0 +3:4/0 = 0 +4:4/0 = 0 +5:4/0 = 0 +6:4/0 = 0 +7:4/0 = 0 +8:4/0 = 0 +9:4/0 = 0 +0:5/0 = 0 +1:5/0 = 0 +2:5/0 = 0 +3:5/0 = 0 +4:5/0 = 0 +5:5/0 = 0 +6:5/0 = 0 +7:5/0 = 0 +8:5/0 = 0 +9:5/0 = 0 +0:6/0 = 0 +1:6/0 = 0 +2:6/0 = 0 +3:6/0 = 0 +4:6/0 = 0 +5:6/0 = 0 +6:6/0 = 0 +7:6/0 = 0 +8:6/0 = 0 +9:6/0 = 0 +0:7/0 = 0 +1:7/0 = 0 +2:7/0 = 0 +3:7/0 = 0 +4:7/0 = 0 +5:7/0 = 0 +6:7/0 = 0 +7:7/0 = 0 +8:7/0 = 0 +9:7/0 = 0 +0:8/0 = 0 +1:8/0 = 0 +2:8/0 = 0 +3:8/0 = 0 +4:8/0 = 0 +5:8/0 = 0 +6:8/0 = 0 +7:8/0 = 0 +8:8/0 = 0 +9:8/0 = 0 +0:9/0 = 0 +1:9/0 = 0 +2:9/0 = 0 +3:9/0 = 0 +4:9/0 = 0 +5:9/0 = 0 +6:9/0 = 0 +7:9/0 = 0 +8:9/0 = 0 +9:9/0 = 0 + +[resource] +tile_size = Vector2i(64, 64) +sources/1 = SubResource("TileSetAtlasSource_8yysw") diff --git a/Maps/Tiles/test.png b/Maps/Tiles/test.png new file mode 100644 index 0000000..9d0d2d3 Binary files /dev/null and b/Maps/Tiles/test.png differ diff --git a/Maps/Tiles/test.png.import b/Maps/Tiles/test.png.import new file mode 100644 index 0000000..cfdfb08 --- /dev/null +++ b/Maps/Tiles/test.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ctagdxk8n72nq" +path="res://.godot/imported/test.png-5c12bd3f9ab31232a7d349c3b50efeac.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Maps/Tiles/test.png" +dest_files=["res://.godot/imported/test.png-5c12bd3f9ab31232a7d349c3b50efeac.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Maps/Tiles/tile_sand_corner_SW.png b/Maps/Tiles/tile_sand_corner_SW.png new file mode 100644 index 0000000..914e0cf Binary files /dev/null and b/Maps/Tiles/tile_sand_corner_SW.png differ diff --git a/Maps/Tiles/tile_sand_corner_SW.png.import b/Maps/Tiles/tile_sand_corner_SW.png.import new file mode 100644 index 0000000..b5593a9 --- /dev/null +++ b/Maps/Tiles/tile_sand_corner_SW.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dph64lwy2kcn2" +path="res://.godot/imported/tile_sand_corner_SW.png-0698ad97c39f130e4cfe18045d371854.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Maps/Tiles/tile_sand_corner_SW.png" +dest_files=["res://.godot/imported/tile_sand_corner_SW.png-0698ad97c39f130e4cfe18045d371854.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Maps/Tiles/tile_water.png b/Maps/Tiles/tile_water.png new file mode 100644 index 0000000..f5fd701 Binary files /dev/null and b/Maps/Tiles/tile_water.png differ diff --git a/Maps/Tiles/tile_water.png.import b/Maps/Tiles/tile_water.png.import new file mode 100644 index 0000000..fb469da --- /dev/null +++ b/Maps/Tiles/tile_water.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjtlwshdtfu20" +path="res://.godot/imported/tile_water.png-9b9ad34e9c63fad6f5939ca2a9114f92.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Maps/Tiles/tile_water.png" +dest_files=["res://.godot/imported/tile_water.png-9b9ad34e9c63fad6f5939ca2a9114f92.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/Maps/Tiles/tiles.gd b/Maps/Tiles/tiles.gd new file mode 100644 index 0000000..63336d0 --- /dev/null +++ b/Maps/Tiles/tiles.gd @@ -0,0 +1,16 @@ +extends TileMapLayer + + +# Called when the node enters the scene tree for the first time. +func _ready(): + # Taille de la zone à couvrir (en tiles) + var zone_size = 20 + # Remplir une zone carrée autour du centre + for x in range(-zone_size, zone_size): + for y in range(-zone_size, zone_size): + set_cell(Vector2i(x, y), 1, Vector2i(2, 7)) # 0 = ID de la tile, Vector2i(0,0) = source + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta: float) -> void: + pass diff --git a/Maps/Tiles/tiles.gd.uid b/Maps/Tiles/tiles.gd.uid new file mode 100644 index 0000000..3ae4879 --- /dev/null +++ b/Maps/Tiles/tiles.gd.uid @@ -0,0 +1 @@ +uid://cphm4sxgpf8nk diff --git a/Maps/Tiles/tiles_vector.svg b/Maps/Tiles/tiles_vector.svg new file mode 100644 index 0000000..06c5f7b --- /dev/null +++ b/Maps/Tiles/tiles_vector.svg @@ -0,0 +1,7692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Maps/Tiles/tiles_vector.svg.import b/Maps/Tiles/tiles_vector.svg.import new file mode 100644 index 0000000..5c84897 --- /dev/null +++ b/Maps/Tiles/tiles_vector.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ct3tpcy3m5opa" +path="res://.godot/imported/tiles_vector.svg-1982104786fae27b3b4671063bf2b952.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Maps/Tiles/tiles_vector.svg" +dest_files=["res://.godot/imported/tiles_vector.svg-1982104786fae27b3b4671063bf2b952.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Maps/gym_player.tscn b/Maps/gym_player.tscn new file mode 100644 index 0000000..487c070 --- /dev/null +++ b/Maps/gym_player.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=5 format=4 uid="uid://dpy36duig8jgh"] + +[ext_resource type="PackedScene" uid="uid://ifus76ia8xws" path="res://Characters/player.tscn" id="1_jlnlo"] +[ext_resource type="PackedScene" uid="uid://c6rnvbhbn7ida" path="res://Maps/Tiles/Tiles.tscn" id="2_7b103"] +[ext_resource type="PackedScene" uid="uid://c8ek4me3t12pp" path="res://GPE/Coin/coin.tscn" id="3_6hhq5"] +[ext_resource type="PackedScene" uid="uid://mh40qx1bhgs5" path="res://Characters/pirate.tscn" id="4_rwt5c"] + +[node name="Node" type="Node"] + +[node name="Tiles" parent="." instance=ExtResource("2_7b103")] +tile_map_data = PackedByteArray("AAAEAAIAAQAAAAAAAAAFAAIAAQABAAAAAAAGAAMAAQAEAAMAAAAFAAMAAQADAAMAAAAEAAMAAQACAAMAAAAGAAIAAQACAAAAAAA=") + +[node name="Tiles2" parent="." instance=ExtResource("2_7b103")] +tile_map_data = PackedByteArray("AAAEAAIAAQAAAAAAAAAFAAIAAQABAAAAAAAGAAMAAQAEAAMAAAAFAAMAAQADAAMAAAAEAAMAAQACAAMAAAAGAAIAAQACAAAAAAA=") +script = null + +[node name="Player" parent="." instance=ExtResource("1_jlnlo")] +position = Vector2(124, 126) + +[node name="Coin" parent="." instance=ExtResource("3_6hhq5")] +position = Vector2(114, 242) + +[node name="Pirate" parent="." instance=ExtResource("4_rwt5c")] +position = Vector2(-5, 304) + +[node name="Pirate2" parent="." instance=ExtResource("4_rwt5c")] +position = Vector2(312, 315) + +[node name="Pirate3" parent="." instance=ExtResource("4_rwt5c")] +position = Vector2(331, 39) + +[node name="Pirate4" parent="." instance=ExtResource("4_rwt5c")] +position = Vector2(-153, -73) diff --git a/Player/hud.gd b/Player/hud.gd new file mode 100644 index 0000000..39ab606 --- /dev/null +++ b/Player/hud.gd @@ -0,0 +1,18 @@ +extends CanvasLayer + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta: float) -> void: + #var player = get_parent().get_node("player") + var player = get_parent() + update_score(player.score) + + + +func update_score(score: int) -> void: + $ScoreLabel.text = "Score: " + str(score) diff --git a/Player/hud.gd.uid b/Player/hud.gd.uid new file mode 100644 index 0000000..fe06112 --- /dev/null +++ b/Player/hud.gd.uid @@ -0,0 +1 @@ +uid://cmkaxwj67x6o4 diff --git a/Player/hud.tscn b/Player/hud.tscn new file mode 100644 index 0000000..1935863 --- /dev/null +++ b/Player/hud.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=3 uid="uid://c2pruida0t5o0"] + +[ext_resource type="Script" uid="uid://cmkaxwj67x6o4" path="res://Player/hud.gd" id="1_ns4kc"] + +[node name="CanvasLayer" type="CanvasLayer"] +script = ExtResource("1_ns4kc") + +[node name="ScoreLabel" type="Label" parent="."] +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 23.0 +grow_horizontal = 2 +text = "Score:" diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..8c4ca99 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dja28yqp1k4nv" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..911ef73 --- /dev/null +++ b/project.godot @@ -0,0 +1,45 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="PirateSurvivors" +run/main_scene="uid://dpy36duig8jgh" +config/features=PackedStringArray("4.5", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=960 +window/size/viewport_height=540 +window/stretch/mode="canvas_items" + +[input] + +move_right={ +"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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +] +} +move_left={ +"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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +] +} +move_up={ +"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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +] +} +move_down={ +"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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +] +}