player and exit showing on select !

This commit is contained in:
Harmony Honey Monroe 2025-02-25 04:54:10 -05:00
parent 364f8a4062
commit 4425e61508
4 changed files with 94 additions and 60 deletions

View file

@ -2,6 +2,8 @@ extends Node2D
onready var cam : Camera2D = Shared.cam
onready var cursor_node := $Cursor
onready var player := $"%Player"
onready var exit := $"%Exit"
var cursor = 0
var current_map := "1-1"
@ -228,8 +230,16 @@ func scroll(arg := cursor):
var sp = screen_pos[cursor]
cursor_node.rect_position = sp
score_node.rect_position = sp + Vector2(1, 1)
cam.pos_target = sp + (screen_size * 0.5)
var half = sp + (screen_size * 0.5)
cam.pos_target = half
refresh_score()
var dict = Shared.map_dict[str(map_list[cursor])]
player.position = Vector2(dict[2], dict[3])
player.node_sprite.flip_h = randf() > 0.5
exit.position = Vector2(dict[4], dict[5])
func show_scoreboard(arg := show_score):
var n = arg == 2

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=21 format=2]
[gd_scene load_steps=23 format=2]
[ext_resource path="res://media/image/corner.png" type="Texture" id=1]
[ext_resource path="res://media/font/QuinqueFive.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://media/image/note.png" type="Texture" id=3]
[ext_resource path="res://src/menu/Vis.gd" type="Script" id=4]
[ext_resource path="res://src/actor/Player.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/shader/outline2D_outer.shader" type="Shader" id=6]
[ext_resource path="res://src/menu/select.gd" type="Script" id=7]
[ext_resource path="res://media/image/diamond16.png" type="Texture" id=8]
@ -13,6 +14,7 @@
[ext_resource path="res://src/stage/CamBounds.gd" type="Script" id=12]
[ext_resource path="res://src/menu/cursor_anim.gd" type="Script" id=13]
[ext_resource path="res://src/stage/sheet.png" type="Texture" id=14]
[ext_resource path="res://src/actor/Exit.tscn" type="PackedScene" id=15]
[sub_resource type="ShaderMaterial" id=10]
shader = ExtResource( 6 )
@ -274,39 +276,63 @@ text = "12:67 long_name1234567
10. thats it"
[node name="Cursor" type="Control" parent="."]
modulate = Color( 1, 0.92549, 0.152941, 1 )
margin_left = 110.0
margin_top = 40.0
margin_right = 246.0
margin_bottom = 144.0
margin_bottom = 136.0
[node name="Arrows" type="Control" parent="Cursor"]
modulate = Color( 1, 0.92549, 0.152941, 1 )
margin_right = 136.0
margin_bottom = 96.0
script = ExtResource( 13 )
__meta__ = {
"_editor_description_": ""
}
time = 0.5
distance = 12.0
offset = -6.0
size = Vector2( 136, 96 )
[node name="c1" type="Sprite" parent="Cursor"]
[node name="c1" type="Sprite" parent="Cursor/Arrows"]
material = SubResource( 11 )
texture = ExtResource( 1 )
[node name="c2" type="Sprite" parent="Cursor"]
[node name="c2" type="Sprite" parent="Cursor/Arrows"]
material = SubResource( 11 )
position = Vector2( 136, 0 )
rotation = 1.5708
texture = ExtResource( 1 )
[node name="c3" type="Sprite" parent="Cursor"]
[node name="c3" type="Sprite" parent="Cursor/Arrows"]
material = SubResource( 11 )
position = Vector2( 0, 103 )
rotation = -1.5708
texture = ExtResource( 1 )
[node name="c4" type="Sprite" parent="Cursor"]
[node name="c4" type="Sprite" parent="Cursor/Arrows"]
material = SubResource( 11 )
position = Vector2( 136, 103 )
rotation = 3.14159
texture = ExtResource( 1 )
[node name="Control" type="Control" parent="Cursor"]
margin_right = 40.0
margin_bottom = 40.0
rect_min_size = Vector2( 136, 96 )
rect_clip_content = true
[node name="Actors" type="Node2D" parent="Cursor/Control"]
position = Vector2( 68, 48 )
[node name="Player" parent="Cursor/Control/Actors" instance=ExtResource( 5 )]
unique_name_in_owner = true
position = Vector2( -21, 10 )
[node name="Exit" parent="Cursor/Control/Actors" instance=ExtResource( 15 )]
unique_name_in_owner = true
position = Vector2( 19, 17 )
[node name="BG" type="CanvasLayer" parent="."]
layer = -1

View file

@ -42,21 +42,19 @@ func _ready():
var cb = inst.get_node("CamBounds")
if is_instance_valid(cb):
inst.position -= cb.position
dict[2] = int(cb.position.x)
dict[3] = int(cb.position.y)
var p = inst.get_node("Actors/Player")
if is_instance_valid(p):
p.visible = false
dict[4] = int(p.position.x)
dict[5] = int(p.position.y)
var e = inst.get_node("Actors/Exit")
if is_instance_valid(e):
e.visible = false
dict[6] = int(e.position.x)
dict[7] = int(e.position.y)
var p = inst.get_node("Actors/Player")
if is_instance_valid(p):
p.visible = false
dict[2] = int(p.position.x - cb.position.x)
dict[3] = int(p.position.y - cb.position.y)
var e = inst.get_node("Actors/Exit")
if is_instance_valid(e):
e.visible = false
dict[4] = int(e.position.x - cb.position.x)
dict[5] = int(e.position.y - cb.position.y)
yield(get_tree(), "idle_frame")
var image = viewport.get_texture().get_data()

View file

@ -5,41 +5,41 @@
[resource]
script = ExtResource( 1 )
dict = {
"1-1": [ 0, 0, 0, 0, -40, 8, 45, 5 ],
"1-2": [ 1, 0, 0, 0, -48, 24, 45, -19 ],
"1-3": [ 2, 0, -24, -16, -92, 24, -67, -51 ],
"1-4": [ 3, 0, 16, 0, 40, 32, -51, -27 ],
"1-5": [ 4, 0, 32, -24, 34, 16, 53, -67 ],
"1-6": [ 0, 1, 8, -24, -12, -8, -3, -67 ],
"1-7": [ 1, 1, 16, -40, -4, -8, 77, -75 ],
"1-8": [ 2, 1, 0, -48, -4, -8, -3, -83 ],
"2-1": [ 3, 1, 40, -16, -53, -8, 125, -11 ],
"2-2": [ 4, 1, 40, -20, 36, -24, 125, -27 ],
"2-3": [ 0, 2, -14, -24, -84, -8, 125, -51 ],
"2-4": [ 1, 2, 20, -24, 52, 16, 29, -123 ],
"2-5": [ 2, 2, 52, -20, -11, -8, 133, -35 ],
"2-6": [ 3, 2, 8, 8, -27, -24, 57, 49 ],
"2-7": [ 4, 2, 0, -24, -68, -8, -3, -55 ],
"2-8": [ 0, 3, -16, -32, -40, 8, -91, -67 ],
"3-1": [ 1, 3, 8, -8, -28, -8, 61, -35 ],
"3-2": [ 2, 3, -4, -16, -40, -8, 5, -59 ],
"3-3": [ 3, 3, -8, -24, -56, -16, -35, -67 ],
"3-4": [ 4, 3, 16, -8, -64, 16, 149, -35 ],
"3-5": [ 0, 4, -16, -24, -68, -8, 29, -43 ],
"3-6": [ 1, 4, -16, -36, -63, -32, 53, -59 ],
"3-7": [ 2, 4, 16, -44, -52, -32, 95, -67 ],
"3-8": [ 3, 4, 4, -33, -60, -16, 77, -75 ],
"4-1": [ 4, 4, 0, -4, -44, 8, 41, -15 ],
"4-2": [ 0, 5, 0, -52, -9, -8, -3, -99 ],
"4-3": [ 1, 5, 16, -4, 60, 24, -59, -51 ],
"4-4": [ 2, 5, 28, -40, -4, -24, 25, -55 ],
"4-5": [ 3, 5, -8, -28, 5, -24, 49, -63 ],
"4-6": [ 4, 5, 48, -44, 87, -16, -35, -51 ],
"4-7": [ 0, 6, 40, -36, 86, -16, -119, -55 ],
"4-8": [ 1, 6, 40, -44, -8, -16, -47, -79 ],
"5-1": [ 2, 6, 34, -40, -12, -16, 174, -59 ],
"5-2": [ 3, 6, 52, -32, 121, -16, -43, -67 ],
"5-3": [ 4, 6, 48, -48, 33, -64, -39, -47 ],
"5-4": [ 0, 7, 34, -56, 69, -16, -51, -91 ],
"win": [ 1, 7, 0, -24, -13, 8, 89, -39 ]
"1-1": [ 0, 0, -40, 8, 45, 5, 0, 0 ],
"1-2": [ 1, 0, -48, 24, 45, -19, 0, 0 ],
"1-3": [ 2, 0, -68, 40, -43, -35, 0, 0 ],
"1-4": [ 3, 0, 24, 32, -67, -27, 0, 0 ],
"1-5": [ 4, 0, 2, 40, 21, -43, 0, 0 ],
"1-6": [ 0, 1, -20, 16, -11, -43, 0, 0 ],
"1-7": [ 1, 1, -20, 32, 61, -35, 0, 0 ],
"1-8": [ 2, 1, -4, 40, -3, -35, 0, 0 ],
"2-1": [ 3, 1, -93, 8, 85, 5, 0, 0 ],
"2-2": [ 4, 1, -4, -4, 85, -7, 0, 0 ],
"2-3": [ 0, 2, -70, 16, 139, -27, 0, 0 ],
"2-4": [ 1, 2, 32, 40, 9, -99, 0, 0 ],
"2-5": [ 2, 2, -63, 12, 81, -15, 0, 0 ],
"2-6": [ 3, 2, -35, -32, 49, 41, 0, 0 ],
"2-7": [ 4, 2, -68, 16, -3, -31, 0, 0 ],
"2-8": [ 0, 3, -24, 40, -75, -35, 0, 0 ],
"3-1": [ 1, 3, -36, 0, 53, -27, 0, 0 ],
"3-2": [ 2, 3, -36, 8, 9, -43, 0, 0 ],
"3-3": [ 3, 3, -48, 8, -27, -43, 0, 0 ],
"3-4": [ 4, 3, -80, 24, 133, -27, 0, 0 ],
"3-5": [ 0, 4, -52, 16, 45, -19, 0, 0 ],
"3-6": [ 1, 4, -47, 4, 69, -23, 0, 0 ],
"3-7": [ 2, 4, -68, 12, 79, -23, 0, 0 ],
"3-8": [ 3, 4, -64, 17, 73, -42, 0, 0 ],
"4-1": [ 4, 4, -44, 12, 41, -11, 0, 0 ],
"4-2": [ 0, 5, -9, 44, -3, -47, 0, 0 ],
"4-3": [ 1, 5, 44, 28, -75, -47, 0, 0 ],
"4-4": [ 2, 5, -32, 16, -3, -15, 0, 0 ],
"4-5": [ 3, 5, 13, 4, 57, -35, 0, 0 ],
"4-6": [ 4, 5, 39, 28, -83, -7, 0, 0 ],
"4-7": [ 0, 6, 46, 20, -159, -19, 0, 0 ],
"4-8": [ 1, 6, -48, 28, -87, -35, 0, 0 ],
"5-1": [ 2, 6, -46, 24, 140, -19, 0, 0 ],
"5-2": [ 3, 6, 69, 16, -95, -35, 0, 0 ],
"5-3": [ 4, 6, -15, -16, -87, 1, 0, 0 ],
"5-4": [ 0, 7, 35, 40, -85, -35, 0, 0 ],
"win": [ 1, 7, -13, 32, 89, -15, 0, 0 ]
}