Compare commits
2 Commits
870d715fc8
...
b2766cf43c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2766cf43c | ||
|
|
5c86928376 |
|
|
@ -9,7 +9,6 @@ func _ready() -> void:
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
scale = scale * (0.6 ** delta)
|
scale = scale * (0.6 ** delta)
|
||||||
print("scale: ", scale)
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _on_lifetime_timeout():
|
func _on_lifetime_timeout():
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ func deg_to_rad(degrees: float) -> float:
|
||||||
return degrees * PI / 180.0
|
return degrees * PI / 180.0
|
||||||
|
|
||||||
func take_damage(_damage : float):
|
func take_damage(_damage : float):
|
||||||
|
if is_queued_for_deletion():
|
||||||
|
return
|
||||||
var wrecked_boat = wrecked_boat_scene.instantiate()
|
var wrecked_boat = wrecked_boat_scene.instantiate()
|
||||||
wrecked_boat.position = position
|
wrecked_boat.position = position
|
||||||
wrecked_boat.rotation = rotation
|
wrecked_boat.rotation = rotation
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
extends Area2D
|
extends RigidBody2D
|
||||||
|
|
||||||
@export var speed = 400
|
@export var speed = 400
|
||||||
@export var score : int = 0
|
var score : int = 0
|
||||||
@export var bullet_scene: PackedScene
|
@export var bullet_scene: PackedScene
|
||||||
|
|
||||||
@export var life_max : float = 30
|
@export var life_max : float = 30
|
||||||
|
|
@ -16,7 +15,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
var velocity = Vector2.ZERO # The player's movement vector.
|
var velocity = Vector2.ZERO # The player's movement vector.
|
||||||
if Input.is_action_pressed("move_right"):
|
if Input.is_action_pressed("move_right"):
|
||||||
velocity.x += 1
|
velocity.x += 1
|
||||||
|
|
@ -29,8 +28,18 @@ func _process(delta: float) -> void:
|
||||||
if velocity.length() > 0:
|
if velocity.length() > 0:
|
||||||
velocity = velocity.normalized() * speed
|
velocity = velocity.normalized() * speed
|
||||||
rotation = velocity.angle() #velocity.angle() + PI/2
|
rotation = velocity.angle() #velocity.angle() + PI/2
|
||||||
position += velocity * delta
|
#position += velocity * delta
|
||||||
#position = position.clamp(Vector2.ZERO, screen_size)
|
apply_central_force(velocity)
|
||||||
|
|
||||||
|
var map_size = Vector2(1000, 1000)
|
||||||
|
var velocity2 = Vector2.ZERO
|
||||||
|
if position.x <= 0 or position.x >= map_size.x:
|
||||||
|
velocity2.x = -linear_velocity.x
|
||||||
|
if position.y <= 0 or position.y >= map_size.y:
|
||||||
|
velocity2.y = -linear_velocity.y
|
||||||
|
if velocity2.length():
|
||||||
|
linear_velocity = velocity2
|
||||||
|
|
||||||
|
|
||||||
func _on_shoot_timer_timeout():
|
func _on_shoot_timer_timeout():
|
||||||
_shoot(Vector2(0, 40))
|
_shoot(Vector2(0, 40))
|
||||||
|
|
@ -49,4 +58,7 @@ func take_damage(damage : float):
|
||||||
#get_tree().reload_current_scene()
|
#get_tree().reload_current_scene()
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
$GameOverScreen.show()
|
$GameOverScreen.show()
|
||||||
|
|
||||||
|
func add_score(score_to_add : int):
|
||||||
|
self.score += score_to_add
|
||||||
|
$SFXGetCoin.play()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
uid://doegfk88vnwo1
|
uid://4rbevg41pdbi
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,31 @@
|
||||||
[gd_scene load_steps=8 format=3 uid="uid://ifus76ia8xws"]
|
[gd_scene load_steps=8 format=3 uid="uid://d01b7h5474v44"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://83sv1yu3pkya" path="res://Characters/Ships/player_ship.png" id="1_5mj4t"]
|
[ext_resource type="Script" uid="uid://4rbevg41pdbi" path="res://Characters/player.gd" id="1_65n15"]
|
||||||
[ext_resource type="Script" uid="uid://doegfk88vnwo1" path="res://Characters/player.gd" id="1_eovys"]
|
[ext_resource type="Texture2D" uid="uid://83sv1yu3pkya" path="res://Characters/Ships/player_ship.png" id="1_vb825"]
|
||||||
[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="2_65n15"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c2pruida0t5o0" path="res://Player/hud.tscn" id="3_vb825"]
|
[ext_resource type="PackedScene" uid="uid://ngrscx1l0dn5" path="res://GPE/CannonBall/cannon_ball.tscn" id="2_l48on"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bu4cvy8wdnt54" path="res://Player/game_over_screen.tscn" id="5_l48on"]
|
[ext_resource type="PackedScene" uid="uid://bu4cvy8wdnt54" path="res://Player/game_over_screen.tscn" id="3_l48on"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://c30yhipl7sot4" path="res://GPE/Coin/handleCoins.ogg" id="6_4m0gv"]
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_eovys"]
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4m0gv"]
|
||||||
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
|
radius = 37.0
|
||||||
height = 118.0
|
height = 118.0
|
||||||
|
|
||||||
[node name="Player" type="Area2D" groups=["players"]]
|
[node name="Player" type="RigidBody2D" groups=["players"]]
|
||||||
script = ExtResource("1_eovys")
|
gravity_scale = 0.0
|
||||||
bullet_scene = ExtResource("2_65n15")
|
linear_damp = 1.0
|
||||||
metadata/_edit_group_ = true
|
script = ExtResource("1_65n15")
|
||||||
|
bullet_scene = ExtResource("2_l48on")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
rotation = -1.5707964
|
rotation = -1.5707964
|
||||||
sprite_frames = SubResource("SpriteFrames_eovys")
|
texture = ExtResource("1_vb825")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
rotation = -1.5707964
|
rotation = -1.5707964
|
||||||
shape = SubResource("CapsuleShape2D_vb825")
|
shape = SubResource("CapsuleShape2D_4m0gv")
|
||||||
|
|
||||||
[node name="HUD" parent="." instance=ExtResource("3_vb825")]
|
[node name="HUD" parent="." instance=ExtResource("2_65n15")]
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
drag_horizontal_enabled = true
|
drag_horizontal_enabled = true
|
||||||
|
|
@ -43,4 +34,9 @@ drag_vertical_enabled = true
|
||||||
[node name="ShootTimer" type="Timer" parent="."]
|
[node name="ShootTimer" type="Timer" parent="."]
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="GameOverScreen" parent="." instance=ExtResource("5_l48on")]
|
[node name="GameOverScreen" parent="." instance=ExtResource("3_l48on")]
|
||||||
|
|
||||||
|
[node name="AudioListener2D" type="AudioListener2D" parent="."]
|
||||||
|
|
||||||
|
[node name="SFXGetCoin" type="AudioStreamPlayer2D" parent="."]
|
||||||
|
stream = ExtResource("6_4m0gv")
|
||||||
|
|
|
||||||
52
Characters/player_old.gd
Normal file
52
Characters/player_old.gd
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
extends Area2D
|
||||||
|
|
||||||
|
@export var speed = 400
|
||||||
|
@export var score : int = 0
|
||||||
|
@export var bullet_scene: PackedScene
|
||||||
|
|
||||||
|
@export var life_max : float = 30
|
||||||
|
@onready var life : float = life_max
|
||||||
|
|
||||||
|
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, 40))
|
||||||
|
_shoot(Vector2(0, -40))
|
||||||
|
|
||||||
|
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)
|
||||||
|
bullet.instigator = self
|
||||||
|
get_parent().add_child(bullet)
|
||||||
|
|
||||||
|
func take_damage(damage : float):
|
||||||
|
life -= damage
|
||||||
|
if life <= 0:
|
||||||
|
#get_tree().reload_current_scene()
|
||||||
|
get_tree().paused = true
|
||||||
|
$GameOverScreen.show()
|
||||||
|
|
||||||
1
Characters/player_old.gd.uid
Normal file
1
Characters/player_old.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://doegfk88vnwo1
|
||||||
46
Characters/player_old.tscn
Normal file
46
Characters/player_old.tscn
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
[gd_scene load_steps=8 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_old.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"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bu4cvy8wdnt54" path="res://Player/game_over_screen.tscn" id="5_l48on"]
|
||||||
|
|
||||||
|
[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_old" 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="HUD" 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
|
||||||
|
|
||||||
|
[node name="GameOverScreen" parent="." instance=ExtResource("5_l48on")]
|
||||||
|
|
@ -2,8 +2,8 @@ extends Area2D
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Connecte le signal de collision
|
# Connecte le signal de collision
|
||||||
#connect("body_entered", _on_body_entered)
|
connect("body_entered", _on_body_entered)
|
||||||
connect("area_entered", _on_body_entered)
|
#connect("area_entered", _on_body_entered)
|
||||||
|
|
||||||
print("Coucou")
|
print("Coucou")
|
||||||
|
|
||||||
|
|
@ -12,5 +12,4 @@ func _on_body_entered(body):
|
||||||
if body.is_in_group("players"):
|
if body.is_in_group("players"):
|
||||||
# Détruit le coin
|
# Détruit le coin
|
||||||
queue_free()
|
queue_free()
|
||||||
|
body.add_score(100)
|
||||||
body.score += 100
|
|
||||||
|
|
|
||||||
BIN
GPE/Coin/handleCoins.ogg
Normal file
BIN
GPE/Coin/handleCoins.ogg
Normal file
Binary file not shown.
19
GPE/Coin/handleCoins.ogg.import
Normal file
19
GPE/Coin/handleCoins.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://c30yhipl7sot4"
|
||||||
|
path="res://.godot/imported/handleCoins.ogg-7da20377e3da98279e3bbfe865453091.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://GPE/Coin/handleCoins.ogg"
|
||||||
|
dest_files=["res://.godot/imported/handleCoins.ogg-7da20377e3da98279e3bbfe865453091.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
BIN
GPE/Coin/handleCoins2.ogg
Normal file
BIN
GPE/Coin/handleCoins2.ogg
Normal file
Binary file not shown.
19
GPE/Coin/handleCoins2.ogg.import
Normal file
19
GPE/Coin/handleCoins2.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://djwj5a8k5lqb4"
|
||||||
|
path="res://.godot/imported/handleCoins2.ogg-b921e1b83dacc555da15b679c2e2ce8f.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://GPE/Coin/handleCoins2.ogg"
|
||||||
|
dest_files=["res://.godot/imported/handleCoins2.ogg-b921e1b83dacc555da15b679c2e2ce8f.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
BIN
GPE/chop.ogg
Normal file
BIN
GPE/chop.ogg
Normal file
Binary file not shown.
19
GPE/chop.ogg.import
Normal file
19
GPE/chop.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://buqji60cs0r6t"
|
||||||
|
path="res://.godot/imported/chop.ogg-25043dd2c26872ee323305db5591422e.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://GPE/chop.ogg"
|
||||||
|
dest_files=["res://.godot/imported/chop.ogg-25043dd2c26872ee323305db5591422e.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=true
|
||||||
|
loop_offset=0.0
|
||||||
|
bpm=0.0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
|
|
@ -6,8 +6,11 @@
|
||||||
texture = ExtResource("1_hwl2e")
|
texture = ExtResource("1_hwl2e")
|
||||||
texture_region_size = Vector2i(64, 64)
|
texture_region_size = Vector2i(64, 64)
|
||||||
0:0/0 = 0
|
0:0/0 = 0
|
||||||
|
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-27.09475, -5.080265, 2.2578888, -25.9658, 32, -32, 32, 32, -32, 32)
|
||||||
1:0/0 = 0
|
1:0/0 = 0
|
||||||
|
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)
|
||||||
2:0/0 = 0
|
2:0/0 = 0
|
||||||
|
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 2.2578888, -25.9658, 19.756584, -2.2578964, 32, 32, -32, 32)
|
||||||
3:0/0 = 0
|
3:0/0 = 0
|
||||||
4:0/0 = 0
|
4:0/0 = 0
|
||||||
5:0/0 = 0
|
5:0/0 = 0
|
||||||
|
|
@ -38,8 +41,11 @@ texture_region_size = Vector2i(64, 64)
|
||||||
0:3/0 = 0
|
0:3/0 = 0
|
||||||
1:3/0 = 0
|
1:3/0 = 0
|
||||||
2:3/0 = 0
|
2:3/0 = 0
|
||||||
|
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 2.2578964, 32, 32, -6.7736893, 27.094742, -19.756592, 5.6447372)
|
||||||
3:3/0 = 0
|
3:3/0 = 0
|
||||||
|
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 2.2578964, 32, 32, -32, 32)
|
||||||
4:3/0 = 0
|
4:3/0 = 0
|
||||||
|
4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 2.2578964, 14.111847, 17.498688, -32, 32)
|
||||||
5:3/0 = 0
|
5:3/0 = 0
|
||||||
6:3/0 = 0
|
6:3/0 = 0
|
||||||
7:3/0 = 0
|
7:3/0 = 0
|
||||||
|
|
@ -108,4 +114,5 @@ texture_region_size = Vector2i(64, 64)
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
tile_size = Vector2i(64, 64)
|
tile_size = Vector2i(64, 64)
|
||||||
|
physics_layer_0/collision_layer = 1
|
||||||
sources/1 = SubResource("TileSetAtlasSource_8yysw")
|
sources/1 = SubResource("TileSetAtlasSource_8yysw")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ extends TileMapLayer
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
# Taille de la zone à couvrir (en tiles)
|
# Taille de la zone à couvrir (en tiles)
|
||||||
var zone_size = 20
|
var zone_size = 21
|
||||||
# Remplir une zone carrée autour du centre
|
# Remplir une zone carrée autour du centre
|
||||||
for x in range(-zone_size, zone_size):
|
for x in range(-zone_size, zone_size):
|
||||||
for y in range(-zone_size, zone_size):
|
for y in range(-zone_size, zone_size):
|
||||||
|
|
|
||||||
27
Maps/game_map.tscn
Normal file
27
Maps/game_map.tscn
Normal file
File diff suppressed because one or more lines are too long
3
Maps/gym_pirate_spawner.tscn
Normal file
3
Maps/gym_pirate_spawner.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[gd_scene format=3 uid="uid://br410dk87k14t"]
|
||||||
|
|
||||||
|
[node name="GymPirateSpawner" type="Node"]
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
[gd_scene load_steps=6 format=4 uid="uid://dpy36duig8jgh"]
|
[gd_scene load_steps=7 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://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://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"]
|
[ext_resource type="PackedScene" uid="uid://mh40qx1bhgs5" path="res://Characters/pirate.tscn" id="4_rwt5c"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dmpu56mdni0gp" path="res://Characters/Ships/wrecked_boat.tscn" id="5_6pf7f"]
|
[ext_resource type="PackedScene" uid="uid://dmpu56mdni0gp" path="res://Characters/Ships/wrecked_boat.tscn" id="5_6pf7f"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d01b7h5474v44" path="res://Characters/player.tscn" id="5_kf4xr"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://buqji60cs0r6t" path="res://GPE/chop.ogg" id="6_kf4xr"]
|
||||||
|
|
||||||
[node name="Node" type="Node"]
|
[node name="Node" type="Node"]
|
||||||
|
|
||||||
|
|
@ -13,25 +14,38 @@ tile_map_data = PackedByteArray("AAAEAAIAAQAAAAAAAAAFAAIAAQABAAAAAAAGAAMAAQAEAAM
|
||||||
|
|
||||||
[node name="Tiles2" parent="." instance=ExtResource("2_7b103")]
|
[node name="Tiles2" parent="." instance=ExtResource("2_7b103")]
|
||||||
tile_map_data = PackedByteArray("AAAEAAIAAQAAAAAAAAAFAAIAAQABAAAAAAAGAAMAAQAEAAMAAAAFAAMAAQADAAMAAAAEAAMAAQACAAMAAAAGAAIAAQACAAAAAAA=")
|
tile_map_data = PackedByteArray("AAAEAAIAAQAAAAAAAAAFAAIAAQABAAAAAAAGAAMAAQAEAAMAAAAFAAMAAQADAAMAAAAEAAMAAQACAAMAAAAGAAIAAQACAAAAAAA=")
|
||||||
|
collision_visibility_mode = 1
|
||||||
script = null
|
script = null
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("1_jlnlo")]
|
|
||||||
position = Vector2(124, 126)
|
|
||||||
|
|
||||||
[node name="Coin" parent="." instance=ExtResource("3_6hhq5")]
|
[node name="Coin" parent="." instance=ExtResource("3_6hhq5")]
|
||||||
position = Vector2(114, 242)
|
position = Vector2(114, 242)
|
||||||
|
|
||||||
|
[node name="Coin2" parent="." instance=ExtResource("3_6hhq5")]
|
||||||
|
position = Vector2(120, 304)
|
||||||
|
|
||||||
|
[node name="Coin3" parent="." instance=ExtResource("3_6hhq5")]
|
||||||
|
position = Vector2(113, 374)
|
||||||
|
|
||||||
|
[node name="Coin4" parent="." instance=ExtResource("3_6hhq5")]
|
||||||
|
position = Vector2(129, 449)
|
||||||
|
|
||||||
|
[node name="Coin5" parent="." instance=ExtResource("3_6hhq5")]
|
||||||
|
position = Vector2(130, 506)
|
||||||
|
|
||||||
[node name="Pirate" parent="." instance=ExtResource("4_rwt5c")]
|
[node name="Pirate" parent="." instance=ExtResource("4_rwt5c")]
|
||||||
position = Vector2(-5, 304)
|
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)
|
|
||||||
|
|
||||||
[node name="WreckedBoat" parent="." instance=ExtResource("5_6pf7f")]
|
[node name="WreckedBoat" parent="." instance=ExtResource("5_6pf7f")]
|
||||||
position = Vector2(357, 193)
|
position = Vector2(357, 193)
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("5_kf4xr")]
|
||||||
|
position = Vector2(102.92679, 107.742485)
|
||||||
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
|
||||||
|
position = Vector2(353, 190)
|
||||||
|
stream = ExtResource("6_kf4xr")
|
||||||
|
volume_db = -5.0
|
||||||
|
autoplay = true
|
||||||
|
max_distance = 1000.0
|
||||||
|
attenuation = 8.8765545
|
||||||
|
|
|
||||||
19
Maps/main_menu.gd
Normal file
19
Maps/main_menu.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
@export var game_map : PackedScene
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
$VBoxContainer/NewGameButton.pressed.connect(_on_new_game_pressed)
|
||||||
|
$VBoxContainer/QuitButton.pressed.connect(_on_quit_pressed)
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _on_new_game_pressed():
|
||||||
|
get_tree().change_scene_to_packed(game_map)
|
||||||
|
|
||||||
|
func _on_quit_pressed():
|
||||||
|
get_tree().quit()
|
||||||
1
Maps/main_menu.gd.uid
Normal file
1
Maps/main_menu.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dxbflnmlaou6i
|
||||||
55
Maps/main_menu.tscn
Normal file
55
Maps/main_menu.tscn
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
[gd_scene load_steps=5 format=3 uid="uid://6ohhuwf0h1vi"]
|
||||||
|
|
||||||
|
[ext_resource type="Theme" uid="uid://ctsajyu6uieal" path="res://Player/widgets/game_theme.tres" id="1_n38s1"]
|
||||||
|
[ext_resource type="Script" uid="uid://dxbflnmlaou6i" path="res://Maps/main_menu.gd" id="1_w6fv6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bmj5igs8dvepl" path="res://Maps/game_map.tscn" id="2_uoho6"]
|
||||||
|
|
||||||
|
[sub_resource type="LabelSettings" id="LabelSettings_w6fv6"]
|
||||||
|
font_size = 32
|
||||||
|
outline_size = 3
|
||||||
|
outline_color = Color(0.511324, 0.2294738, 0, 1)
|
||||||
|
shadow_size = 6
|
||||||
|
shadow_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="MainMenu" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_w6fv6")
|
||||||
|
game_map = ExtResource("2_uoho6")
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_left = -46.0
|
||||||
|
offset_top = -20.0
|
||||||
|
offset_right = 58.0
|
||||||
|
offset_bottom = 10.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "PIRATE SURVIVORS"
|
||||||
|
label_settings = SubResource("LabelSettings_w6fv6")
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="NewGameButton" type="Button" parent="VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme = ExtResource("1_n38s1")
|
||||||
|
text = "New Game"
|
||||||
|
|
||||||
|
[node name="QuitButton" type="Button" parent="VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme = ExtResource("1_n38s1")
|
||||||
|
text = "Quit
|
||||||
|
"
|
||||||
|
|
@ -11,7 +11,7 @@ config_version=5
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="PirateSurvivors"
|
config/name="PirateSurvivors"
|
||||||
run/main_scene="uid://dpy36duig8jgh"
|
run/main_scene="uid://6ohhuwf0h1vi"
|
||||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user