summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2022-08-09 23:09:14 +0300
committerJan Tuomi <jan.tuomi@valuemotive.com>2022-08-09 23:09:14 +0300
commit2d888d00efba0314ac6357f2dbccd0ad01173023 (patch)
tree9d1904473ac8cf5553d903db2df7b9d01ffdfb03
parentba41bbbb09e0d1057179a0f221b8d297d37ecb79 (diff)
Add background
-rw-r--r--Assets/.DS_Storebin6148 -> 0 bytes
-rw-r--r--Assets/background_glacial_mountains.pngbin0 -> 26835 bytes
-rw-r--r--Assets/background_glacial_mountains.png.import35
-rw-r--r--GlobalData.gd12
-rw-r--r--GlobalData.tscn6
-rw-r--r--Level.tscn52
-rw-r--r--Player.gd2
-rw-r--r--Player.tscn3
-rw-r--r--project.godot5
9 files changed, 110 insertions, 5 deletions
diff --git a/Assets/.DS_Store b/Assets/.DS_Store
deleted file mode 100644
index 76229c4..0000000
--- a/Assets/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/Assets/background_glacial_mountains.png b/Assets/background_glacial_mountains.png
new file mode 100644
index 0000000..6e20763
--- /dev/null
+++ b/Assets/background_glacial_mountains.png
Binary files differ
diff --git a/Assets/background_glacial_mountains.png.import b/Assets/background_glacial_mountains.png.import
new file mode 100644
index 0000000..5beb950
--- /dev/null
+++ b/Assets/background_glacial_mountains.png.import
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/background_glacial_mountains.png-95c26daddece33ef386974b643b1a6fe.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://Assets/background_glacial_mountains.png"
+dest_files=[ "res://.import/background_glacial_mountains.png-95c26daddece33ef386974b643b1a6fe.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+process/normal_map_invert_y=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/GlobalData.gd b/GlobalData.gd
new file mode 100644
index 0000000..ae803e4
--- /dev/null
+++ b/GlobalData.gd
@@ -0,0 +1,12 @@
+extends Node
+
+export(int) var player_hp = 3
+
+# 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
diff --git a/GlobalData.tscn b/GlobalData.tscn
new file mode 100644
index 0000000..5b6a816
--- /dev/null
+++ b/GlobalData.tscn
@@ -0,0 +1,6 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://GlobalData.gd" type="Script" id=1]
+
+[node name="GlobalData" type="Node"]
+script = ExtResource( 1 )
diff --git a/Level.tscn b/Level.tscn
index 616646a..f3d5525 100644
--- a/Level.tscn
+++ b/Level.tscn
@@ -1,7 +1,8 @@
-[gd_scene load_steps=25 format=2]
+[gd_scene load_steps=27 format=2]
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Assets/kenney_pixelplatformer/Tilemap/tiles_packed.png" type="Texture" id=2]
+[ext_resource path="res://Assets/background_glacial_mountains.png" type="Texture" id=3]
[sub_resource type="ConvexPolygonShape2D" id=2]
points = PoolVector2Array( 0, 0, 18, 0, 18, 18, 0, 18 )
@@ -71,7 +72,7 @@ points = PoolVector2Array( 0, 0, 18, 0, 18, 18, 0, 18 )
0/texture = ExtResource( 2 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
-0/region = Rect2( 0, 0, 360, 162 )
+0/region = Rect2( 0, 0, 18, 18 )
0/tile_mode = 1
0/autotile/bitmask_mode = 1
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 16, Vector2( 0, 1 ), 144, Vector2( 0, 6 ), 146, Vector2( 0, 7 ), 18, Vector2( 1, 0 ), 48, Vector2( 1, 1 ), 432, Vector2( 1, 6 ), 438, Vector2( 1, 7 ), 54, Vector2( 2, 0 ), 56, Vector2( 2, 1 ), 504, Vector2( 2, 6 ), 511, Vector2( 2, 7 ), 63, Vector2( 3, 0 ), 24, Vector2( 3, 1 ), 216, Vector2( 3, 6 ), 219, Vector2( 3, 7 ), 27, Vector2( 4, 0 ), 255, Vector2( 4, 1 ), 507, Vector2( 5, 0 ), 447, Vector2( 5, 1 ), 510 ]
@@ -218,6 +219,29 @@ points = PoolVector2Array( 0, 0, 18, 0, 18, 18, 0, 18 )
} ]
0/z_index = 0
+[sub_resource type="TileSet" id=23]
+0/name = "tiles_packed.png 0"
+0/texture = ExtResource( 2 )
+0/tex_offset = Vector2( 0, 0 )
+0/modulate = Color( 1, 1, 1, 1 )
+0/region = Rect2( 0, 0, 360, 162 )
+0/tile_mode = 2
+0/autotile/icon_coordinate = Vector2( 0, 0 )
+0/autotile/tile_size = Vector2( 18, 18 )
+0/autotile/spacing = 0
+0/autotile/occluder_map = [ ]
+0/autotile/navpoly_map = [ ]
+0/autotile/priority_map = [ ]
+0/autotile/z_index_map = [ ]
+0/occluder_offset = Vector2( 0, 0 )
+0/navigation_offset = Vector2( 0, 0 )
+0/shape_offset = Vector2( 0, 0 )
+0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
+0/shape_one_way = false
+0/shape_one_way_margin = 0.0
+0/shapes = [ ]
+0/z_index = 0
+
[node name="Level" type="Node2D"]
[node name="Player" parent="." instance=ExtResource( 1 )]
@@ -228,13 +252,28 @@ JUMP_FORCE = 600.0
MAX_FALL_SPEED = 1200.0
COYOTE_TIME = 200.0
+[node name="ParallaxBackground" type="ParallaxBackground" parent="Player"]
+offset = Vector2( 0, -450 )
+transform = Transform2D( 1, 0, 0, 1, 0, -450 )
+
+[node name="ParallaxLayer" type="ParallaxLayer" parent="Player/ParallaxBackground"]
+motion_scale = Vector2( 0.5, 0.1 )
+motion_mirroring = Vector2( 1536, 0 )
+
+[node name="Sprite" type="Sprite" parent="Player/ParallaxBackground/ParallaxLayer"]
+scale = Vector2( 2, 2 )
+texture = ExtResource( 3 )
+centered = false
+
[node name="Camera2D" type="Camera2D" parent="Player"]
offset = Vector2( 0, -20 )
current = true
limit_left = 0
limit_top = -100000000
+smoothing_enabled = true
+smoothing_speed = 10.0
-[node name="TileMap" type="TileMap" parent="."]
+[node name="AutoTileMap" type="TileMap" parent="."]
position = Vector2( 3, -2 )
scale = Vector2( 2, 2 )
tile_set = SubResource( 1 )
@@ -242,3 +281,10 @@ cell_size = Vector2( 18, 18 )
cell_custom_transform = Transform2D( 0, 0, 0, 0, 0, 0 )
format = 1
tile_data = PoolIntArray( -327681, 0, 65537, -393216, 0, 65539, -262145, 0, 393217, -327680, 0, 393219, -196609, 0, 393217, -262144, 0, 393219, -131073, 0, 393217, -196608, 0, 393219, -65537, 0, 393217, -131072, 0, 393219, -1, 0, 393217, -65536, 0, 393219, 65535, 0, 393217, 0, 0, 393219, 21, 0, 0, 131071, 0, 393217, 65536, 0, 393219, 196607, 0, 393217, 131072, 0, 393219, 131096, 0, 0, 131106, 0, 65537, 131107, 0, 65539, 262143, 0, 393217, 196608, 0, 65540, 196609, 0, 65538, 196610, 0, 65538, 196611, 0, 65539, 196619, 0, 65537, 196620, 0, 65539, 196642, 0, 393217, 196643, 0, 393219, 327679, 0, 393217, 262144, 0, 393218, 262145, 0, 393218, 262146, 0, 393218, 262147, 0, 393219, 262155, 0, 393217, 262156, 0, 65540, 262157, 0, 65538, 262158, 0, 65539, 262171, 0, 0, 262177, 0, 65537, 262178, 0, 65541, 262179, 0, 393219, 393215, 0, 393217, 327680, 0, 393218, 327681, 0, 4, 327682, 0, 458754, 327683, 0, 458755, 327687, 0, 0, 327691, 0, 458753, 327692, 0, 458754, 327693, 0, 458754, 327694, 0, 458755, 327698, 0, 0, 327713, 0, 458753, 327714, 0, 5, 327715, 0, 393219, 458751, 0, 393217, 393216, 0, 393218, 393217, 0, 393219, 393246, 0, 0, 393250, 0, 393217, 393251, 0, 65540, 393252, 0, 65539, 524287, 0, 393217, 458752, 0, 393218, 458753, 0, 393219, 458786, 0, 393217, 458787, 0, 393218, 458788, 0, 393219, 589823, 0, 393217, 524288, 0, 393218, 524289, 0, 393219, 524307, 0, 65537, 524308, 0, 65538, 524309, 0, 65538, 524310, 0, 65539, 524322, 0, 393217, 524323, 0, 393218, 524324, 0, 393219, 655359, 0, 393217, 589824, 0, 393218, 589825, 0, 393219, 589839, 0, 1, 589840, 0, 3, 589843, 0, 458753, 589844, 0, 458754, 589845, 0, 5, 589846, 0, 393219, 589858, 0, 393217, 589859, 0, 393218, 589860, 0, 393219, 720895, 0, 393217, 655360, 0, 393218, 655361, 0, 393219, 655373, 0, 65537, 655374, 0, 65539, 655381, 0, 458753, 655382, 0, 458755, 655393, 0, 65537, 655394, 0, 65541, 655395, 0, 393218, 655396, 0, 65540, 655397, 0, 65539, 786431, 0, 393217, 720896, 0, 393218, 720897, 0, 393219, 720904, 0, 1, 720905, 0, 2, 720906, 0, 3, 720909, 0, 458753, 720910, 0, 458755, 720929, 0, 393217, 720930, 0, 393218, 720931, 0, 393218, 720932, 0, 393218, 720933, 0, 393219, 851967, 0, 393217, 786432, 0, 393218, 786433, 0, 393219, 786464, 0, 65537, 786465, 0, 65541, 786466, 0, 393218, 786467, 0, 393218, 786468, 0, 4, 786469, 0, 458755, 917503, 0, 393217, 851968, 0, 393218, 851969, 0, 393219, 851994, 0, 65537, 851995, 0, 65538, 851996, 0, 65538, 851997, 0, 65538, 851998, 0, 65539, 852000, 0, 393217, 852001, 0, 393218, 852002, 0, 393218, 852003, 0, 393218, 852004, 0, 393219, 983039, 0, 393217, 917504, 0, 393218, 917505, 0, 65540, 917506, 0, 65538, 917507, 0, 65538, 917508, 0, 65538, 917509, 0, 65538, 917510, 0, 65538, 917511, 0, 65538, 917512, 0, 65538, 917513, 0, 65538, 917514, 0, 65538, 917515, 0, 65538, 917516, 0, 65538, 917517, 0, 65538, 917518, 0, 65538, 917519, 0, 65538, 917520, 0, 65538, 917521, 0, 65538, 917522, 0, 65538, 917523, 0, 65538, 917524, 0, 65538, 917525, 0, 65538, 917526, 0, 65538, 917527, 0, 65538, 917528, 0, 65538, 917529, 0, 65538, 917530, 0, 65541, 917531, 0, 393218, 917532, 0, 393218, 917533, 0, 393218, 917534, 0, 393219, 917536, 0, 393217, 917537, 0, 393218, 917538, 0, 393218, 917539, 0, 393218, 917540, 0, 393219, 1048575, 0, 393217, 983040, 0, 393218, 983041, 0, 393218, 983042, 0, 393218, 983043, 0, 393218, 983044, 0, 393218, 983045, 0, 393218, 983046, 0, 393218, 983047, 0, 393218, 983048, 0, 393218, 983049, 0, 393218, 983050, 0, 393218, 983051, 0, 393218, 983052, 0, 393218, 983053, 0, 393218, 983054, 0, 393218, 983055, 0, 393218, 983056, 0, 393218, 983057, 0, 393218, 983058, 0, 393218, 983059, 0, 393218, 983060, 0, 393218, 983061, 0, 393218, 983062, 0, 393218, 983063, 0, 393218, 983064, 0, 393218, 983065, 0, 393218, 983066, 0, 393218, 983067, 0, 393218, 983068, 0, 393218, 983069, 0, 393218, 983070, 0, 65540, 983071, 0, 65538, 983072, 0, 65541, 983073, 0, 393218, 983074, 0, 393218, 983075, 0, 393218, 983076, 0, 393219, 1114111, 0, 393217, 1048576, 0, 393218, 1048577, 0, 393218, 1048578, 0, 393218, 1048579, 0, 393218, 1048580, 0, 393218, 1048581, 0, 393218, 1048582, 0, 393218, 1048583, 0, 393218, 1048584, 0, 393218, 1048585, 0, 393218, 1048586, 0, 393218, 1048587, 0, 393218, 1048588, 0, 393218, 1048589, 0, 393218, 1048590, 0, 393218, 1048591, 0, 393218, 1048592, 0, 393218, 1048593, 0, 393218, 1048594, 0, 393218, 1048595, 0, 393218, 1048596, 0, 393218, 1048597, 0, 393218, 1048598, 0, 393218, 1048599, 0, 393218, 1048600, 0, 393218, 1048601, 0, 393218, 1048602, 0, 393218, 1048603, 0, 393218, 1048604, 0, 393218, 1048605, 0, 393218, 1048606, 0, 393218, 1048607, 0, 393218, 1048608, 0, 393218, 1048609, 0, 393218, 1048610, 0, 393218, 1048611, 0, 393218, 1048612, 0, 393219, 1179647, 0, 393217, 1114112, 0, 393218, 1114113, 0, 393218, 1114114, 0, 393218, 1114115, 0, 393218, 1114116, 0, 393218, 1114117, 0, 393218, 1114118, 0, 393218, 1114119, 0, 393218, 1114120, 0, 393218, 1114121, 0, 393218, 1114122, 0, 393218, 1114123, 0, 393218, 1114124, 0, 393218, 1114125, 0, 393218, 1114126, 0, 393218, 1114127, 0, 393218, 1114128, 0, 393218, 1114129, 0, 393218, 1114130, 0, 393218, 1114131, 0, 393218, 1114132, 0, 393218, 1114133, 0, 393218, 1114134, 0, 393218, 1114135, 0, 393218, 1114136, 0, 393218, 1114137, 0, 393218, 1114138, 0, 393218, 1114139, 0, 393218, 1114140, 0, 393218, 1114141, 0, 393218, 1114142, 0, 393218, 1114143, 0, 393218, 1114144, 0, 393218, 1114145, 0, 393218, 1114146, 0, 393218, 1114147, 0, 393218, 1114148, 0, 393219, 1245183, 0, 393217, 1179648, 0, 393218, 1179649, 0, 393218, 1179650, 0, 393218, 1179651, 0, 393218, 1179652, 0, 393218, 1179653, 0, 393218, 1179654, 0, 393218, 1179655, 0, 393218, 1179656, 0, 393218, 1179657, 0, 393218, 1179658, 0, 393218, 1179659, 0, 393218, 1179660, 0, 393218, 1179661, 0, 393218, 1179662, 0, 393218, 1179663, 0, 393218, 1179664, 0, 393218, 1179665, 0, 393218, 1179666, 0, 393218, 1179667, 0, 393218, 1179668, 0, 393218, 1179669, 0, 393218, 1179670, 0, 393218, 1179671, 0, 393218, 1179672, 0, 393218, 1179673, 0, 393218, 1179674, 0, 393218, 1179675, 0, 393218, 1179676, 0, 393218, 1179677, 0, 393218, 1179678, 0, 393218, 1179679, 0, 393218, 1179680, 0, 393218, 1179681, 0, 393218, 1179682, 0, 393218, 1179683, 0, 393218, 1179684, 0, 393219, 1310719, 0, 393217, 1245184, 0, 393218, 1245185, 0, 393218, 1245186, 0, 393218, 1245187, 0, 393218, 1245188, 0, 393218, 1245189, 0, 393218, 1245190, 0, 393218, 1245191, 0, 393218, 1245192, 0, 393218, 1245193, 0, 393218, 1245194, 0, 393218, 1245195, 0, 393218, 1245196, 0, 393218, 1245197, 0, 393218, 1245198, 0, 393218, 1245199, 0, 393218, 1245200, 0, 393218, 1245201, 0, 393218, 1245202, 0, 393218, 1245203, 0, 393218, 1245204, 0, 393218, 1245205, 0, 393218, 1245206, 0, 393218, 1245207, 0, 393218, 1245208, 0, 393218, 1245209, 0, 393218, 1245210, 0, 393218, 1245211, 0, 393218, 1245212, 0, 393218, 1245213, 0, 393218, 1245214, 0, 393218, 1245215, 0, 393218, 1245216, 0, 393218, 1245217, 0, 393218, 1245218, 0, 393218, 1245219, 0, 393218, 1245220, 0, 393219, 1376255, 0, 393217, 1310720, 0, 393218, 1310721, 0, 393218, 1310722, 0, 393218, 1310723, 0, 393218, 1310724, 0, 393218, 1310725, 0, 393218, 1310726, 0, 393218, 1310727, 0, 393218, 1310728, 0, 393218, 1310729, 0, 393218, 1310730, 0, 393218, 1310731, 0, 393218, 1310732, 0, 393218, 1310733, 0, 393218, 1310734, 0, 393218, 1310735, 0, 393218, 1310736, 0, 393218, 1310737, 0, 393218, 1310738, 0, 393218, 1310739, 0, 393218, 1310740, 0, 393218, 1310741, 0, 393218, 1310742, 0, 393218, 1310743, 0, 393218, 1310744, 0, 393218, 1310745, 0, 393218, 1310746, 0, 393218, 1310747, 0, 393218, 1310748, 0, 393218, 1310749, 0, 393218, 1310750, 0, 393218, 1310751, 0, 393218, 1310752, 0, 393218, 1310753, 0, 393218, 1310754, 0, 393218, 1310755, 0, 393218, 1310756, 0, 393219, 1441791, 0, 393217, 1376256, 0, 393218, 1376257, 0, 393218, 1376258, 0, 393218, 1376259, 0, 393218, 1376260, 0, 393218, 1376261, 0, 393218, 1376262, 0, 393218, 1376263, 0, 393218, 1376264, 0, 393218, 1376265, 0, 393218, 1376266, 0, 393218, 1376267, 0, 393218, 1376268, 0, 393218, 1376269, 0, 393218, 1376270, 0, 393218, 1376271, 0, 393218, 1376272, 0, 393218, 1376273, 0, 393218, 1376274, 0, 393218, 1376275, 0, 393218, 1376276, 0, 393218, 1376277, 0, 393218, 1376278, 0, 393218, 1376279, 0, 393218, 1376280, 0, 393218, 1376281, 0, 393218, 1376282, 0, 393218, 1376283, 0, 393218, 1376284, 0, 393218, 1376285, 0, 393218, 1376286, 0, 393218, 1376287, 0, 393218, 1376288, 0, 393218, 1376289, 0, 393218, 1376290, 0, 393218, 1376291, 0, 393218, 1376292, 0, 393219, 1507327, 0, 458753, 1441792, 0, 458754, 1441793, 0, 458754, 1441794, 0, 458754, 1441795, 0, 458754, 1441796, 0, 458754, 1441797, 0, 458754, 1441798, 0, 458754, 1441799, 0, 458754, 1441800, 0, 458754, 1441801, 0, 458754, 1441802, 0, 458754, 1441803, 0, 458754, 1441804, 0, 458754, 1441805, 0, 458754, 1441806, 0, 458754, 1441807, 0, 458754, 1441808, 0, 458754, 1441809, 0, 458754, 1441810, 0, 458754, 1441811, 0, 458754, 1441812, 0, 458754, 1441813, 0, 458754, 1441814, 0, 458754, 1441815, 0, 458754, 1441816, 0, 458754, 1441817, 0, 458754, 1441818, 0, 458754, 1441819, 0, 458754, 1441820, 0, 458754, 1441821, 0, 458754, 1441822, 0, 458754, 1441823, 0, 458754, 1441824, 0, 458754, 1441825, 0, 458754, 1441826, 0, 458754, 1441827, 0, 458754, 1441828, 0, 458755 )
+
+[node name="SingleTileMap" type="TileMap" parent="."]
+scale = Vector2( 2, 2 )
+tile_set = SubResource( 23 )
+cell_size = Vector2( 18, 18 )
+format = 1
+tile_data = PoolIntArray( -196575, -536870912, 131091, -196574, 1073741824, 131090, -196573, 1073741824, 131091, -131039, 536870912, 131091, -131038, 536870912, 262161, -131037, -2147483648, 131091, -65502, 536870912, 262160, 33, 1073741824, 262162, 34, 1610612736, 327697, 35, 1073741824, 262163, 36, 1610612736, 262162, 65570, 0, 327696, 131075, 0, 262149 )
diff --git a/Player.gd b/Player.gd
index 8fbeb35..795faf3 100644
--- a/Player.gd
+++ b/Player.gd
@@ -71,3 +71,5 @@ func _physics_process(delta):
# print($AnimationPlayer.current_animation, ", ", $AnimationTree.get("parameters/walk_speed/scale"))
# warning-ignore:return_value_discarded
move_and_slide(velocity, Vector2.UP)
+
+ GlobalData.player_hp
diff --git a/Player.tscn b/Player.tscn
index ec8edf8..65c474e 100644
--- a/Player.tscn
+++ b/Player.tscn
@@ -43,7 +43,7 @@ nodes/is_grounded/position = Vector2( 400, 90 )
nodes/is_moving/node = SubResource( 15 )
nodes/is_moving/position = Vector2( 140, 190 )
nodes/output/position = Vector2( 620, 100 )
-node_connections = [ "TimeScale", 0, "Walk", "is_grounded", 0, "Fall", "is_grounded", 1, "is_moving", "output", 0, "is_grounded", "is_moving", 0, "Idle", "is_moving", 1, "TimeScale" ]
+node_connections = [ "output", 0, "is_grounded", "TimeScale", 0, "Walk", "is_grounded", 0, "Fall", "is_grounded", 1, "is_moving", "is_moving", 0, "Idle", "is_moving", 1, "TimeScale" ]
[sub_resource type="Animation" id=10]
resource_name = "Fall"
@@ -142,7 +142,6 @@ frame = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, 4 )
-scale = Vector2( 1, 1 )
shape = SubResource( 18 )
[node name="FloorRaycastL" type="RayCast2D" parent="."]
diff --git a/project.godot b/project.godot
index 9510c7a..e69a9ba 100644
--- a/project.godot
+++ b/project.godot
@@ -30,6 +30,10 @@ config/name="MobilePlatformer"
run/main_scene="res://Level.tscn"
config/icon="res://icon.png"
+[autoload]
+
+GlobalData="*res://GlobalData.tscn"
+
[display]
window/stretch/mode="2d"
@@ -80,4 +84,5 @@ common/enable_pause_aware_picking=true
[rendering]
+2d/snapping/use_gpu_pixel_snap=true
environment/default_environment="res://default_env.tres"