From f0ade5d211fe795ab19a540e3a6ddfaf112889f3 Mon Sep 17 00:00:00 2001 From: as4s4hetic Date: Mon, 24 Jan 2022 13:23:58 +1100 Subject: [PATCH] clamped player position, some art updates --- Resources/woods.tres | 2 +- Scripts/Ch1S1.gd | 17 +++++++++++++++++ {Story => Scripts}/Covers.gd | 0 {Story => Scripts}/ScrollCamera.gd | 2 +- Story/Ch1S1.tscn | 12 +++++++----- Tiles/road.png | Bin 637 -> 810 bytes 6 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 Scripts/Ch1S1.gd rename {Story => Scripts}/Covers.gd (100%) rename {Story => Scripts}/ScrollCamera.gd (95%) diff --git a/Resources/woods.tres b/Resources/woods.tres index d0801ff..9ba5280 100644 --- a/Resources/woods.tres +++ b/Resources/woods.tres @@ -221,7 +221,7 @@ 14/texture = ExtResource( 15 ) 14/tex_offset = Vector2( 0, 0 ) 14/modulate = Color( 1, 1, 1, 1 ) -14/region = Rect2( 0, 0, 240, 180 ) +14/region = Rect2( 0, 0, 240, 240 ) 14/tile_mode = 0 14/occluder_offset = Vector2( 0, 0 ) 14/navigation_offset = Vector2( 0, 0 ) diff --git a/Scripts/Ch1S1.gd b/Scripts/Ch1S1.gd new file mode 100644 index 0000000..4aca85c --- /dev/null +++ b/Scripts/Ch1S1.gd @@ -0,0 +1,17 @@ +extends Node2D +onready var player = get_node("Player") + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# 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): + player.position.y = clamp(player.position.y, 460, 500) + pass diff --git a/Story/Covers.gd b/Scripts/Covers.gd similarity index 100% rename from Story/Covers.gd rename to Scripts/Covers.gd diff --git a/Story/ScrollCamera.gd b/Scripts/ScrollCamera.gd similarity index 95% rename from Story/ScrollCamera.gd rename to Scripts/ScrollCamera.gd index 9f72122..331769c 100644 --- a/Story/ScrollCamera.gd +++ b/Scripts/ScrollCamera.gd @@ -17,4 +17,4 @@ onready var target = get_node("../Player") func _process (delta): position = target.position - position.y -= 180 + position.y -= 240 diff --git a/Story/Ch1S1.tscn b/Story/Ch1S1.tscn index 4b238ad..63058cd 100644 --- a/Story/Ch1S1.tscn +++ b/Story/Ch1S1.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://Resources/woods.tres" type="TileSet" id=1] [ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=2] -[ext_resource path="res://Story/ScrollCamera.gd" type="Script" id=3] +[ext_resource path="res://Scripts/ScrollCamera.gd" type="Script" id=3] +[ext_resource path="res://Scripts/Ch1S1.gd" type="Script" id=4] [node name="Ch1S1" type="Node2D"] +script = ExtResource( 4 ) [node name="ScrollCamera" type="Camera2D" parent="."] current = true @@ -93,7 +95,7 @@ motion_mirroring = Vector2( 1440, 0 ) tile_set = ExtResource( 1 ) cell_y_sort = true format = 1 -tile_data = PoolIntArray( -262138, 19, 0, -131071, 18, 0 ) +tile_data = PoolIntArray( -131071, 18, 0 ) [node name="Grass" type="TileMap" parent="Background/Close"] tile_set = ExtResource( 1 ) @@ -118,7 +120,7 @@ format = 1 tile_data = PoolIntArray( 65536, 7, 0, 65538, 15, 0, 65540, 15, 0, 65542, 15, 0, 65544, 15, 0, 65546, 15, 0, 65548, 15, 0, 65550, 15, 0, 65552, 15, 0, 65554, 15, 0, 65556, 15, 0, 65558, 15, 0, 65560, 15, 0, 65562, 15, 0, 65564, 15, 0, 65566, 15, 0, 65568, 15, 0, 65570, 15, 0, 65572, 15, 0, 65574, 15, 0, 65576, 15, 0, 65578, 15, 0, 65580, 15, 0, 65582, 15, 0, 720896, 16, 0 ) [node name="Player" parent="." instance=ExtResource( 2 )] -position = Vector2( 472, 433 ) +position = Vector2( 480, 480 ) [node name="Foreground" type="ParallaxBackground" parent="."] layer = 1 @@ -143,4 +145,4 @@ tile_set = ExtResource( 1 ) cell_size = Vector2( 60, 60 ) cell_y_sort = true format = 1 -tile_data = PoolIntArray( -65518, 19, 0, 65548, 18, 0, 393216, 12, 0, 393220, 12, 0, 393224, 12, 0, 393228, 12, 0, 393232, 12, 0, 393236, 12, 0, 589824, 13, 0, 589828, 13, 0, 589832, 13, 0, 589836, 13, 0, 589840, 13, 0, 589844, 13, 0 ) +tile_data = PoolIntArray( 18, 19, 0, 458752, 12, 0, 458756, 12, 0, 458760, 12, 0, 458764, 12, 0, 458768, 12, 0, 458772, 12, 0, 655360, 13, 0, 655364, 13, 0, 655368, 13, 0, 655372, 13, 0, 655376, 13, 0, 655380, 13, 0 ) diff --git a/Tiles/road.png b/Tiles/road.png index 7bb8aeca04298b051b69fa9f2fbc297da56e2c59..2ce7e8c65d6d1ab9a6395cc7b05a6b5514088725 100644 GIT binary patch delta 63 zcmey%vWjhjINt{jHU@D7#Ns7ZdAR`IPpUz%dzDB>nA3LPZnUb5&O;jIFH?^ TkvV21P$7e-tDnm{r-UW|&DRz4 delta 62 zcmZ3*_LpUXINufyHU