MapManager 1st pass
This commit is contained in:
parent
e58860163a
commit
37b26fec0a
10 changed files with 181 additions and 14 deletions
|
@ -4,7 +4,11 @@ extends CharacterBody2D
|
|||
@export var CurrentSkin: CanvasTexture
|
||||
@export var CurrentHat: CanvasTexture
|
||||
|
||||
const SPEED = 700.0
|
||||
const SPEED = 1000.0
|
||||
|
||||
func teleport(location:Transform2D , direction:float = 1):
|
||||
transform = location
|
||||
scale = Vector2(direction,1)
|
||||
|
||||
# Change the skin on every sprite
|
||||
func changeSkin(NewSkin:CanvasTexture,_NewHat:CanvasTexture = null):
|
45
core/sceneInstance.gd
Normal file
45
core/sceneInstance.gd
Normal file
|
@ -0,0 +1,45 @@
|
|||
extends Node2D
|
||||
|
||||
@export var InitialPlayer :PackedScene
|
||||
@export var InitialMap :PackedScene
|
||||
|
||||
@onready var current_scene = $CurrentScene
|
||||
#@onready var scene_transition = $ScreenTransition/AnimationPlayer
|
||||
var next_scene = null
|
||||
|
||||
var player
|
||||
var player_location : Vector2 = Vector2(0,0)
|
||||
var player_direction : float = 1
|
||||
|
||||
|
||||
|
||||
func transition_to_scene(new_scene: PackedScene, spawn_location:Vector2, spawn_direction:float ):
|
||||
next_scene = new_scene
|
||||
player_location = spawn_location
|
||||
player_direction = spawn_direction
|
||||
#screen_transition.play('FadeToBlack')
|
||||
if(current_scene.get_child(0)):
|
||||
current_scene.get_child(0).queue_free()
|
||||
current_scene.add_child(next_scene.instantiate())
|
||||
|
||||
#region Spawn Player
|
||||
|
||||
if (player):
|
||||
player.teleport(player_location, player_direction)
|
||||
else:
|
||||
player = $CurrentScene.find_child("player",true)
|
||||
if (player):
|
||||
player.teleport(player_location, player_direction)
|
||||
else:
|
||||
if (InitialPlayer):
|
||||
player = InitialPlayer.instantiate()
|
||||
player.set_name("player")
|
||||
add_child(player)
|
||||
else:
|
||||
printerr("No Initial player found")
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
func _on_ready():
|
||||
transition_to_scene(InitialMap,Vector2(0,0),1)
|
BIN
extracted/4010-A Tiny Sticker Tale review pic 1.jpg
Normal file
BIN
extracted/4010-A Tiny Sticker Tale review pic 1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 227 KiB |
34
extracted/4010-A Tiny Sticker Tale review pic 1.jpg.import
Normal file
34
extracted/4010-A Tiny Sticker Tale review pic 1.jpg.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c5bd2ta3esnib"
|
||||
path="res://.godot/imported/4010-A Tiny Sticker Tale review pic 1.jpg-ccd7b9a1b501ca420459a5659cc7c780.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://extracted/4010-A Tiny Sticker Tale review pic 1.jpg"
|
||||
dest_files=["res://.godot/imported/4010-A Tiny Sticker Tale review pic 1.jpg-ccd7b9a1b501ca420459a5659cc7c780.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
8
maps/map1.tres
Normal file
8
maps/map1.tres
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cacwy4tka88k1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bk87x1lpjog5j" path="res://extracted/Texture2D/Floors_05_SPRT.png" id="1_vellv"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_vellv")
|
||||
region = Rect2(0, 0, 1024, 992)
|
||||
filter_clip = true
|
35
maps/map1.tscn
Normal file
35
maps/map1.tscn
Normal file
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://wlqsvbqpcbh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cacwy4tka88k1" path="res://maps/map1.tres" id="1_pt5vq"]
|
||||
[ext_resource type="Texture2D" uid="uid://db1k2fu0p2ek8" path="res://extracted/Sprite/Floors_11_SPRT_0.png" id="2_ha1lv"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5bd2ta3esnib" path="res://extracted/4010-A Tiny Sticker Tale review pic 1.jpg" id="3_yh2wy"]
|
||||
|
||||
[node name="Map1" type="Node2D"]
|
||||
|
||||
[node name="Floors05Sprt" type="Sprite2D" parent="."]
|
||||
scale = Vector2(6, 6)
|
||||
texture = ExtResource("1_pt5vq")
|
||||
region_rect = Rect2(0, 0, 1024, 992)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="Floors05Sprt"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Floors05Sprt/StaticBody2D"]
|
||||
visible = false
|
||||
polygon = PackedVector2Array(-450, 68.3333, -446.167, 162.667, 194.833, 162.667, 211.833, 162.667, 208.167, -35.3333, 462.667, -31.5, 458.833, -131.5, 191.167, -129.667, 191.167, 66.5)
|
||||
|
||||
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Floors05Sprt/StaticBody2D"]
|
||||
visible = false
|
||||
build_mode = 1
|
||||
polygon = PackedVector2Array(-448, -432.5, 458, -430.833, 455.5, 196.833, 490.333, 198, 497, 305, 453.833, 307.333, 456.167, 411, -448, 407.5)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Floors05Sprt"]
|
||||
position = Vector2(477.167, 300.333)
|
||||
scale = Vector2(0.192195, 0.20323)
|
||||
texture = ExtResource("2_ha1lv")
|
||||
|
||||
[node name="4010-aTinyStickerTaleReviewPic1" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
top_level = true
|
||||
position = Vector2(78, -148)
|
||||
scale = Vector2(6.15, 6.15)
|
||||
texture = ExtResource("3_yh2wy")
|
12
maps/map8D66.tmp
Normal file
12
maps/map8D66.tmp
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://d382cexpr4075"]
|
||||
|
||||
[ext_resource type="Script" path="res://core/sceneInstance.gd" id="1_p0vo1"]
|
||||
[ext_resource type="PackedScene" uid="uid://wlqsvbqpcbh" path="res://maps/map1.tscn" id="2_qgqfi"]
|
||||
|
||||
[node name="MapManager" type="Node2D"]
|
||||
script = ExtResource("1_p0vo1")
|
||||
InitialMap = ExtResource("2_qgqfi")
|
||||
|
||||
[node name="CurrentScene" type="Node2D" parent="."]
|
||||
|
||||
[connection signal="ready" from="." to="." method="_on_ready"]
|
12
maps/mapF9BA.tmp
Normal file
12
maps/mapF9BA.tmp
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://d382cexpr4075"]
|
||||
|
||||
[ext_resource type="Script" path="res://core/sceneInstance.gd" id="1_p0vo1"]
|
||||
[ext_resource type="PackedScene" uid="uid://wlqsvbqpcbh" path="res://maps/map1.tscn" id="2_qgqfi"]
|
||||
|
||||
[node name="MapManager" type="Node2D"]
|
||||
script = ExtResource("1_p0vo1")
|
||||
InitialMap = ExtResource("2_qgqfi")
|
||||
|
||||
[node name="CurrentScene" type="Node2D" parent="."]
|
||||
|
||||
[connection signal="ready" from="." to="." method="_on_ready"]
|
14
maps/mapManager.tscn
Normal file
14
maps/mapManager.tscn
Normal file
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://d382cexpr4075"]
|
||||
|
||||
[ext_resource type="Script" path="res://core/sceneInstance.gd" id="1_p0vo1"]
|
||||
[ext_resource type="PackedScene" uid="uid://0m1hk2nu4bps" path="res://player.tscn" id="2_fyjh8"]
|
||||
[ext_resource type="PackedScene" uid="uid://wlqsvbqpcbh" path="res://maps/map1.tscn" id="2_qgqfi"]
|
||||
|
||||
[node name="MapManager" type="Node2D"]
|
||||
script = ExtResource("1_p0vo1")
|
||||
InitialPlayer = ExtResource("2_fyjh8")
|
||||
InitialMap = ExtResource("2_qgqfi")
|
||||
|
||||
[node name="CurrentScene" type="Node2D" parent="."]
|
||||
|
||||
[connection signal="ready" from="." to="." method="_on_ready"]
|
29
player.tscn
29
player.tscn
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=23 format=3 uid="uid://0m1hk2nu4bps"]
|
||||
|
||||
[ext_resource type="Script" path="res://player.gd" id="1_0pgv8"]
|
||||
[ext_resource type="Script" path="res://core/player.gd" id="1_whhfc"]
|
||||
[ext_resource type="Texture2D" uid="uid://5pmqr3y62guu" path="res://player/currentCloth.tres" id="2_45h8h"]
|
||||
[ext_resource type="Animation" uid="uid://b85dikp6ps8i2" path="res://player/animations/idle.res" id="2_ymiw5"]
|
||||
[ext_resource type="Animation" uid="uid://2woypk4u40b5" path="res://player/animations/WalkLeft.res" id="3_2eohq"]
|
||||
|
@ -493,7 +493,6 @@ value_label = "speed"
|
|||
sync = true
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_wgp38"]
|
||||
graph_offset = Vector2(-108, 70)
|
||||
nodes/WalkRun/node = SubResource("AnimationNodeBlendSpace1D_c82tj")
|
||||
nodes/WalkRun/position = Vector2(180, 120)
|
||||
nodes/output/position = Vector2(440, 120)
|
||||
|
@ -503,7 +502,7 @@ node_connections = [&"output", 0, &"WalkRun"]
|
|||
diffuse_texture = ExtResource("4_ytgpb")
|
||||
|
||||
[node name="Node2D" type="CharacterBody2D"]
|
||||
script = ExtResource("1_0pgv8")
|
||||
script = ExtResource("1_whhfc")
|
||||
CurrentSkin = ExtResource("2_45h8h")
|
||||
CurrentHat = ExtResource("3_qyf3b")
|
||||
|
||||
|
@ -512,13 +511,17 @@ position = Vector2(0, -75)
|
|||
shape = SubResource("RectangleShape2D_kapu3")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(0, -129)
|
||||
zoom = Vector2(0.13, 0.13)
|
||||
position_smoothing_enabled = true
|
||||
position_smoothing_speed = 2.0
|
||||
drag_horizontal_enabled = true
|
||||
drag_vertical_enabled = true
|
||||
drag_left_margin = 0.62
|
||||
drag_top_margin = 0.57
|
||||
drag_right_margin = 0.61
|
||||
drag_bottom_margin = 0.74
|
||||
editor_draw_limits = true
|
||||
editor_draw_drag_margin = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." groups=["Animation"]]
|
||||
libraries = {
|
||||
|
@ -538,24 +541,24 @@ parameters/WalkRun/3/TimeScale/scale = 0.3
|
|||
position = Vector2(17, 0)
|
||||
|
||||
[node name="BootL" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(-77.0483, -35.8612)
|
||||
rotation = 0.298037
|
||||
scale = Vector2(1, 1)
|
||||
position = Vector2(-96.6778, -35.0139)
|
||||
rotation = 0.433871
|
||||
texture = ExtResource("2_45h8h")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(896, 768, 128, 128)
|
||||
metadata/Type = "Skin"
|
||||
|
||||
[node name="BootR" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(26.6367, -42.0048)
|
||||
rotation = -0.528737
|
||||
position = Vector2(42.7357, -41.0162)
|
||||
rotation = -0.697008
|
||||
scale = Vector2(1, 1)
|
||||
texture = ExtResource("2_45h8h")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(896, 768, 128, 128)
|
||||
metadata/Type = "Skin"
|
||||
|
||||
[node name="Body" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(51, -242.284)
|
||||
position = Vector2(51, -240.552)
|
||||
texture = ExtResource("2_45h8h")
|
||||
offset = Vector2(-15, 0)
|
||||
region_enabled = true
|
||||
|
@ -579,7 +582,7 @@ metadata/Type = "Skin"
|
|||
|
||||
[node name="Tail" type="Sprite2D" parent="Skeleton2D/Body"]
|
||||
show_behind_parent = true
|
||||
position = Vector2(44, 112.284)
|
||||
position = Vector2(44, 110.552)
|
||||
rotation = 0.153589
|
||||
texture = ExtResource("2_45h8h")
|
||||
offset = Vector2(70, 0)
|
||||
|
@ -588,8 +591,8 @@ region_rect = Rect2(768, 640, 256, 128)
|
|||
metadata/Type = "Skin"
|
||||
|
||||
[node name="Head" type="Sprite2D" parent="Skeleton2D"]
|
||||
position = Vector2(-40, -415.284)
|
||||
rotation = 0.0557601
|
||||
position = Vector2(-40, -413.552)
|
||||
rotation = 0.0758805
|
||||
texture = ExtResource("2_45h8h")
|
||||
offset = Vector2(0, -168)
|
||||
region_enabled = true
|
||||
|
|
Loading…
Reference in a new issue