feat: DVD Logo like moving thing
This commit is contained in:
parent
d22290e239
commit
d3affaca7d
@ -971,9 +971,10 @@ texture = ExtResource( 8 )
|
|||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
||||||
frames = SubResource( 7 )
|
frames = SubResource( 7 )
|
||||||
|
frame = 3
|
||||||
playing = true
|
playing = true
|
||||||
|
|
||||||
[node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
[node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
||||||
frames = SubResource( 8 )
|
frames = SubResource( 8 )
|
||||||
frame = 5
|
frame = 8
|
||||||
playing = true
|
playing = true
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=15 format=2]
|
[gd_scene load_steps=18 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/Utilities/LevelState.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://src/UserInterface/UserInterface.tscn" type="PackedScene" id=2]
|
||||||
@ -10,6 +10,10 @@
|
|||||||
[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=8]
|
[ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=8]
|
||||||
[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=9]
|
[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=9]
|
||||||
[ext_resource path="res://src/Levels/Level 1.gd" type="Script" id=10]
|
[ext_resource path="res://src/Levels/Level 1.gd" type="Script" id=10]
|
||||||
|
[ext_resource path="res://addons/controller_icons/objects/Button.gd" type="Script" id=11]
|
||||||
|
[ext_resource path="res://src/Levels/TutorialThingy.gd" type="Script" id=12]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=14]
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=4]
|
[sub_resource type="AnimationNodeStateMachinePlayback" id=4]
|
||||||
|
|
||||||
@ -99,6 +103,26 @@ unique_name_in_owner = true
|
|||||||
[node name="Timer" parent="UserInterface/HUD/HUDOverlay/GetBackTimer" index="0"]
|
[node name="Timer" parent="UserInterface/HUD/HUDOverlay/GetBackTimer" index="0"]
|
||||||
wait_time = 20.0
|
wait_time = 20.0
|
||||||
|
|
||||||
|
[node name="TutorialButton" type="StaticBody2D" parent="."]
|
||||||
|
z_index = 4
|
||||||
|
z_as_relative = false
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 0
|
||||||
|
script = ExtResource( 12 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="TutorialButton"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="TutorialButton"]
|
||||||
|
shape = SubResource( 14 )
|
||||||
|
|
||||||
|
[node name="ControllerButton" type="Button" parent="TutorialButton"]
|
||||||
|
visible = false
|
||||||
|
margin_left = -10.0
|
||||||
|
margin_top = -10.0
|
||||||
|
margin_right = 10.0
|
||||||
|
margin_bottom = 10.0
|
||||||
|
script = ExtResource( 11 )
|
||||||
|
|
||||||
[node name="BlobbyCam" parent="." instance=ExtResource( 3 )]
|
[node name="BlobbyCam" parent="." instance=ExtResource( 3 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
drag_margin_bottom = 0.3
|
drag_margin_bottom = 0.3
|
||||||
@ -107,7 +131,10 @@ drag_margin_bottom = 0.3
|
|||||||
visible = true
|
visible = true
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||||
frame = 12
|
frame = 3
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||||
|
frame = 10
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
34
src/Levels/TutorialThingy.gd
Normal file
34
src/Levels/TutorialThingy.gd
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
extends StaticBody2D
|
||||||
|
var screen_size: Vector2
|
||||||
|
var velocity = Vector2(1,1)
|
||||||
|
onready var blobby = $"%Blobby"
|
||||||
|
onready var cam = $"%BlobbyCam"
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
$ControllerButton.path = "jump"
|
||||||
|
screen_size = cam.screen_rect
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
$Sprite.texture = $ControllerButton.icon
|
||||||
|
var tex_size = Vector2(20,20)
|
||||||
|
var up_left_pos = cam.get_global_transform().affine_inverse() * (position - tex_size/2)
|
||||||
|
var down_right_pos = cam.get_global_transform().affine_inverse() * (position + tex_size/2)
|
||||||
|
|
||||||
|
var screen_stretch_factor = get_tree().root.size / screen_size
|
||||||
|
var blobby_screen_pos = (blobby.get_viewport_transform() * (blobby.position))/screen_stretch_factor
|
||||||
|
var corrected_screen = screen_size - blobby_screen_pos
|
||||||
|
print(get_tree().root.get_visible_rect().position)
|
||||||
|
|
||||||
|
if up_left_pos.x + blobby_screen_pos.x <= 0:
|
||||||
|
velocity.x = 1
|
||||||
|
elif down_right_pos.x >= corrected_screen.x:
|
||||||
|
velocity.x = -1
|
||||||
|
|
||||||
|
if up_left_pos.y + blobby_screen_pos.y <= 0:
|
||||||
|
velocity.y = 1
|
||||||
|
elif down_right_pos.y >= corrected_screen.y:
|
||||||
|
velocity.y = -1
|
||||||
|
|
||||||
|
self.position += velocity
|
||||||
|
|
||||||
|
|
||||||
@ -4,11 +4,10 @@ onready var _action_list = $"%ActionKeyList"
|
|||||||
onready var changes_made := false
|
onready var changes_made := false
|
||||||
onready var changes_saved := false
|
onready var changes_saved := false
|
||||||
|
|
||||||
func on_start():
|
func _ready() -> void:
|
||||||
$InputMapper.connect('profile_changed', self, 'rebuild')
|
$InputMapper.connect('profile_changed', self, 'rebuild')
|
||||||
$InputMapper.initialize_profiles()
|
$InputMapper.initialize_profiles()
|
||||||
$ProfilesMenu.initialize($InputMapper)
|
$ProfilesMenu.initialize($InputMapper)
|
||||||
$ProfilesMenu.grab_focus()
|
|
||||||
$InputMapper.change_profile($ProfilesMenu.selected)
|
$InputMapper.change_profile($ProfilesMenu.selected)
|
||||||
|
|
||||||
func rebuild(input_profile):
|
func rebuild(input_profile):
|
||||||
@ -43,7 +42,3 @@ func _on_InputLine_change_button_pressed(action_name, line):
|
|||||||
changes_made = true
|
changes_made = true
|
||||||
changes_saved = false
|
changes_saved = false
|
||||||
line.update_key(event)
|
line.update_key(event)
|
||||||
|
|
||||||
|
|
||||||
func _on_Back_button_up() -> void:
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ func _on_GlobalState_player_died() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
# TODO don't match for specific text... why did i even consider that... did I pull that from the tutorial???
|
||||||
if event.is_action_pressed("pause") && pause_title.text != "You lost" && !$ControlsMenu.visible:
|
if event.is_action_pressed("pause") && pause_title.text != "You lost" && !$ControlsMenu.visible:
|
||||||
#not oder ! schaltet einen boolean um
|
#not oder ! schaltet einen boolean um
|
||||||
#Ist self hier notwendig?
|
#Ist self hier notwendig?
|
||||||
@ -35,6 +36,6 @@ func set_paused(value: bool) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_Controls_button_up() -> void:
|
func _on_Controls_button_up() -> void:
|
||||||
$ControlsMenu.on_start()
|
|
||||||
$ControlsMenu.visible = true
|
$ControlsMenu.visible = true
|
||||||
$PauseOverlay.visible = false
|
$PauseOverlay.visible = false
|
||||||
|
$ControlsMenu/ProfilesMenu.grab_focus()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=29 format=2]
|
[gd_scene load_steps=27 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=1]
|
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=1]
|
||||||
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
|
||||||
@ -16,8 +16,6 @@
|
|||||||
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/Reset.gd" type="Script" id=15]
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/Reset.gd" type="Script" id=15]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/SaveButton.gd" type="Script" id=16]
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/SaveButton.gd" type="Script" id=16]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/ProfilesMenu.gd" type="Script" id=17]
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/ProfilesMenu.gd" type="Script" id=17]
|
||||||
[ext_resource path="res://assets/environment/background/Spaceship-Wall.png" type="Texture" id=18]
|
|
||||||
[ext_resource path="res://assets/environment/background/starry-space.png" type="Texture" id=19]
|
|
||||||
[ext_resource path="res://assets/sounds/EpsonStart.ogg" type="AudioStream" id=20]
|
[ext_resource path="res://assets/sounds/EpsonStart.ogg" type="AudioStream" id=20]
|
||||||
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=21]
|
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=21]
|
||||||
[ext_resource path="res://assets/meta/montserrat_extrabold.otf" type="DynamicFontData" id=22]
|
[ext_resource path="res://assets/meta/montserrat_extrabold.otf" type="DynamicFontData" id=22]
|
||||||
@ -59,6 +57,7 @@ script = ExtResource( 5 )
|
|||||||
pause_mode = 2
|
pause_mode = 2
|
||||||
physics_interpolation_mode = 1
|
physics_interpolation_mode = 1
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
@ -67,28 +66,15 @@ size_flags_vertical = 0
|
|||||||
theme = ExtResource( 1 )
|
theme = ExtResource( 1 )
|
||||||
script = ExtResource( 10 )
|
script = ExtResource( 10 )
|
||||||
|
|
||||||
|
[node name="PauseOverlay" type="ColorRect" parent="ControlsMenu"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
color = Color( 0, 0, 0, 0.156863 )
|
||||||
|
|
||||||
[node name="InputMapper" type="Node" parent="ControlsMenu"]
|
[node name="InputMapper" type="Node" parent="ControlsMenu"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
script = ExtResource( 13 )
|
script = ExtResource( 13 )
|
||||||
|
|
||||||
[node name="background" type="TextureRect" parent="ControlsMenu"]
|
|
||||||
visible = false
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
margin_top = 46.0
|
|
||||||
margin_bottom = 46.0
|
|
||||||
texture = ExtResource( 19 )
|
|
||||||
expand = true
|
|
||||||
stretch_mode = 1
|
|
||||||
|
|
||||||
[node name="background2" type="TextureRect" parent="ControlsMenu"]
|
|
||||||
visible = false
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
texture = ExtResource( 18 )
|
|
||||||
expand = true
|
|
||||||
stretch_mode = 1
|
|
||||||
|
|
||||||
[node name="ProfilesMenu" type="OptionButton" parent="ControlsMenu"]
|
[node name="ProfilesMenu" type="OptionButton" parent="ControlsMenu"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
@ -266,7 +252,6 @@ text = "Save"
|
|||||||
script = ExtResource( 16 )
|
script = ExtResource( 16 )
|
||||||
|
|
||||||
[node name="KeySelectMenu" type="Panel" parent="ControlsMenu"]
|
[node name="KeySelectMenu" type="Panel" parent="ControlsMenu"]
|
||||||
pause_mode = 2
|
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
process_priority = 1
|
process_priority = 1
|
||||||
visible = false
|
visible = false
|
||||||
@ -274,6 +259,7 @@ material = SubResource( 8 )
|
|||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
focus_mode = 2
|
focus_mode = 2
|
||||||
|
mouse_filter = 2
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
script = ExtResource( 12 )
|
script = ExtResource( 12 )
|
||||||
|
|
||||||
@ -420,7 +406,7 @@ color = Color( 0, 0, 0, 0.235294 )
|
|||||||
[node name="Title" type="Label" parent="PauseOverlay"]
|
[node name="Title" type="Label" parent="PauseOverlay"]
|
||||||
margin_right = 170.0
|
margin_right = 170.0
|
||||||
margin_bottom = 45.0
|
margin_bottom = 45.0
|
||||||
text = "Wumper"
|
text = "BOBBI!"
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="PauseOverlay"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="PauseOverlay"]
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
|
|||||||
@ -9,13 +9,15 @@ func _ready() -> void:
|
|||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
$Prompt2.text = ("(ESC to cancel or wait: %s" % round($Timer.time_left)) + " sec)"
|
$Prompt2.text = ("(ESC to cancel or wait: %s" % round($Timer.time_left)) + " sec)"
|
||||||
|
|
||||||
func _input(event):
|
func _input(event: InputEvent) -> void:
|
||||||
if !event.is_pressed():
|
if !self.visible || !event.is_pressed():
|
||||||
return
|
return
|
||||||
|
# TODO Static quit button esc
|
||||||
if "scancode" in event && event.scancode == 16777217:
|
if "scancode" in event && event.scancode == 16777217:
|
||||||
event = null
|
event = null
|
||||||
emit_signal("key_selected", event)
|
accept_event()
|
||||||
get_tree().set_input_as_handled()
|
get_tree().set_input_as_handled()
|
||||||
|
emit_signal("key_selected", event)
|
||||||
close()
|
close()
|
||||||
|
|
||||||
func open():
|
func open():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user