Compare commits

..

No commits in common. "af4f5062b78146898cdad94f7e4657d7b4a12d09" and "52436feb3da315725377c4c4d4c634e24d49d205" have entirely different histories.

20 changed files with 12 additions and 541 deletions

View File

@ -1,39 +0,0 @@
extends Node
var this = null
var state_name = 'Jump'
var m_ratio = 0.0
var m_jump_state = null
var m_speed = 0.7
func _ready():
pass
func _state_process(delta):
if m_jump_state != null:
m_jump_state.call(delta)
else:
m_ratio = 0.25
m_jump_state = self.go_up
func go_up(delta):
var sprite = this.get_node('Sprite2D')
m_ratio += m_speed * delta
sprite.scale.x = m_ratio
sprite.scale.y = m_ratio
if m_ratio >= 0.38:
m_jump_state = self.go_down
func go_down(delta):
var sprite = this.get_node('Sprite2D')
m_ratio -= m_speed * delta
sprite.scale.x = m_ratio
sprite.scale.y = m_ratio
if m_ratio <= 0.25:
this.to_normal()
queue_free()

View File

@ -31,10 +31,3 @@ func is_dead():
func to_dead():
m_state = preload("res://Actor/Dead.gd").new()
m_state.this = self
func is_jump():
return m_state.state_name == 'Jump'
func to_jump():
m_state = preload("res://Actor/Jump.gd").new()
m_state.this = self

View File

@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://blr8qcmuqs5vl" path="res://icon.svg" id="2_itibm"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e2sef"]
radius = 3.16228
radius = 6.0
[node name="Actor" type="CharacterBody2D" groups=["actors"]]
script = ExtResource("1_0612w")

View File

@ -1,16 +0,0 @@
extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
func _on_body_entered(body):
if body in get_tree().get_nodes_in_group('player'):
CheckPoint.add_checkpoint(name, body.global_position)

View File

@ -1,16 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://ba7detpptxamr"]
[ext_resource type="Script" path="res://CheckPointArea/check_point_area.gd" id="1_6wlyr"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7yleu"]
radius = 51.4781
[node name="CheckPointArea" type="Area2D"]
script = ExtResource("1_6wlyr")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(2, 2)
shape = SubResource("CircleShape2D_7yleu")
debug_color = Color(0.972549, 0, 0.443137, 0.419608)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -1,37 +0,0 @@
extends Node
class CheckPointData:
var checkpoint_name
var player_position
var strikes: bool = false
func _init(myname, ppos):
checkpoint_name = myname
player_position = ppos
var m_checkpoints = []
func _ready():
pass
func _process(delta):
pass
func reset():
m_checkpoints.clear()
func add_checkpoint(name, pos):
for cp in m_checkpoints:
if cp.checkpoint_name == name:
return
var strikes = false
if m_checkpoints.is_empty() == false:
strikes = m_checkpoints.back().strikes
m_checkpoints.push_back(CheckPointData.new(name, pos))
m_checkpoints.back().strikes = strikes
func has_checkpoint():
return m_checkpoints.is_empty() == false
func get_checkpoint():
return m_checkpoints.back()

File diff suppressed because one or more lines are too long

View File

@ -1,29 +0,0 @@
extends Node2D
func _ready():
if CheckPoint.has_checkpoint():
var cp = CheckPoint.get_checkpoint()
$Sandbox/Player/Actor.global_position = cp.player_position
$Sandbox.strike_enabled = cp.strikes
var msg = preload("res://MsgBox/msg_box.tscn").instantiate()
$Sandbox/Canvas.add_child(msg)
msg.enable('Hello prisoner', '
Hello prisoner,
Our spaceship is under attack, but don\'t worry,
you will be executed at time, as soon as we escape.
Good luck !
')
func _start():
pass
func _process(delta):
pass
func _on_area_2d_body_entered(body):
$Sandbox.strike_enabled = true
if CheckPoint.has_checkpoint():
CheckPoint.get_checkpoint().strikes = true

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_pressed():
CheckPoint.reset()
get_tree().change_scene_to_file("res://Levels/level_intro.tscn")
func _on_checkpoint_pressed():
get_tree().change_scene_to_file("res://Levels/level_intro.tscn")

View File

@ -1,6 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://ch3n607i8yqy8"]
[ext_resource type="Script" path="res://LoseMenu/lose_menu.gd" id="1_0ixcu"]
[gd_scene format=3 uid="uid://ch3n607i8yqy8"]
[node name="LoseMenu" type="Control"]
layout_mode = 3
@ -9,7 +7,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_0ixcu")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
@ -27,22 +24,3 @@ offset_top = 54.0
offset_right = 551.0
offset_bottom = 77.0
text = "YOU LOSE"
[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_left = 499.0
offset_top = 192.0
offset_right = 555.0
offset_bottom = 223.0
text = "RETRY"
[node name="Checkpoint" type="Button" parent="."]
layout_mode = 0
offset_left = 468.0
offset_top = 131.0
offset_right = 598.0
offset_bottom = 162.0
text = "Last checkpoint"
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
[connection signal="pressed" from="Checkpoint" to="." method="_on_checkpoint_pressed"]

View File

@ -1,13 +1,15 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
func _on_button_pressed():
get_tree().change_scene_to_file("res://Levels/level_intro.tscn")
get_tree().change_scene_to_file("res://Levels/level_0.tscn")

View File

@ -1,20 +0,0 @@
extends Area2D
@export var title: String = ''
@export var text: String = ''
var m_bodies = []
func _ready():
pass
func _process(delta):
pass
func _on_body_entered(body):
if body in m_bodies:
return
var msg = preload("res://MsgBox/msg_box.tscn").instantiate()
$CanvasLayer.add_child(msg)
msg.enable(title, text)
m_bodies.push_back(body)

View File

@ -1,16 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://bp8sjj34r7jyj"]
[ext_resource type="Script" path="res://MsgArea/msg_area.gd" id="1_fqh47"]
[sub_resource type="CircleShape2D" id="CircleShape2D_co7u0"]
radius = 41.1947
[node name="MsgArea" type="Area2D"]
script = ExtResource("1_fqh47")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_co7u0")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -1,40 +0,0 @@
extends Control
class Page:
var title: String
var text: String
func _init(mytitle, mytext):
self.title = mytitle
self.text = mytext
var m_pages = []
func _ready():
pass
func _process(delta):
if Input.is_action_just_pressed("ui_accept"):
self._on_button_pressed()
func enable(title, text):
$Panel/VBoxContainer/Label.text = title
$Panel/VBoxContainer/RichTextLabel.text = text
get_tree().paused = true
return self
func then(title, text):
m_pages.push_back(Page.new(title, text))
return self
func _on_button_pressed():
if m_pages.size() > 0:
var page = m_pages.pop_front()
$Panel/VBoxContainer/Label.text = page.title
$Panel/VBoxContainer/RichTextLabel.text = page.text
else:
get_tree().paused = false
queue_free()

View File

@ -1,57 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://82kxvlr252x4"]
[ext_resource type="Script" path="res://MsgBox/msg_box.gd" id="1_5d2k7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_msojn"]
[node name="MsgBox" type="Control"]
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_5d2k7")
[node name="Panel" type="Panel" parent="."]
top_level = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -253.0
offset_top = -221.0
offset_right = 253.0
offset_bottom = 221.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_msojn")
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="Panel/VBoxContainer"]
layout_mode = 2
text = "TITRE"
horizontal_alignment = 1
[node name="RichTextLabel" type="RichTextLabel" parent="Panel/VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "text"
fit_content = true
[node name="Button" type="Button" parent="Panel/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 8
text = "OK"
[connection signal="pressed" from="Panel/VBoxContainer/Button" to="." method="_on_button_pressed"]

View File

@ -7,9 +7,6 @@ var m_shoot_timer = 0.0
func _physics_process(dt):
var delta = Vector2(0, 0)
if Input.is_action_just_pressed("player_jump") and $Actor.is_normal():
$Actor.to_jump()
if Input.is_action_just_pressed("player_shoot") \
and m_shoot_timer >= m_shoot_time \
and not $Actor.is_dead():
@ -35,7 +32,7 @@ func _physics_process(dt):
delta = delta.normalized()
$Actor.m_dir = delta
if $Actor.is_normal() or $Actor.is_jump():
if $Actor.is_normal():
$Actor.velocity = delta * $Actor.m_speed
$Actor.move_and_slide()

View File

@ -1,11 +1,10 @@
extends Node2D
@export var strike_enabled = true
var m_broken_timer = 0.0
var m_broken_time = 0.2
var process_state = null
var m_death_timer = 0.0
var m_death_time = 1.0
var m_death_time = 2.0
var m_strike_time = 1.0
var m_strike_timer = 0.0
@ -22,22 +21,13 @@ func _process(delta):
if self.process_state:
self.process_state.call(delta)
func filter_near_player(pos):
var glob_pos = to_global($TileMap.map_to_local(pos))
var to_player = $Player/Actor.global_position - glob_pos
var dist2 = to_player.length_squared()
var min_dist = 300
var max_dist = 128
return dist2 < min_dist * min_dist and dist2 > max_dist * max_dist
func process(delta):
for actor in get_tree().get_nodes_in_group('actors'):
if is_outside(actor) and actor.is_normal():
actor.to_falling()
if m_strike_timer >= m_strike_time and strike_enabled:
if m_strike_timer >= m_strike_time:
var all = $TileMap.get_used_cells(0)
all = all.filter(filter_near_player)
all.shuffle()
var ground = null
for t in all:
@ -45,7 +35,6 @@ func process(delta):
if data.get_custom_data('type') == 'ground':
ground = t
break
if ground:
self.add_broken_ground(ground, 1, 0.8)
$Strikes.add_line(to_global($TileMap.map_to_local(ground)), 0.15)
m_strike_timer = 0.0

View File

@ -1,39 +0,0 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Export/hello.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.0.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""

View File

@ -15,10 +15,6 @@ run/main_scene="res://MainMenu/main_menu.tscn"
config/features=PackedStringArray("4.2", "GL Compatibility")
config/icon="res://icon.svg"
[autoload]
CheckPoint="*res://Checkpoint/CheckPoint.gd"
[input]
player_up={
@ -46,11 +42,6 @@ player_shoot={
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
]
}
player_jump={
"deadzone": 0.5,
"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":32,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}
[rendering]