From a5302367de832e05be1f910259ee27c8be338606 Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Wed, 8 Mar 2023 02:07:12 -0500 Subject: [PATCH] made move direction export actually work --- maps/rust.tscn | 26 ++++++++++++++++++++++---- maps/test_room.tscn | 6 ++++++ objects/enemy/enemy_move_diagonal.gd | 4 ++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/maps/rust.tscn b/maps/rust.tscn index a19003f..4fff58b 100644 --- a/maps/rust.tscn +++ b/maps/rust.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://maps/map.gd" type="Script" id=1] [ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=2] @@ -10,6 +10,8 @@ [ext_resource path="res://objects/environment/rock/rock.tscn" type="PackedScene" id=8] [ext_resource path="res://objects/environment/turniwood/turning_platform.tscn" type="PackedScene" id=9] [ext_resource path="res://graphics/secret/i_cant_take_it_anymore.png" type="Texture" id=10] +[ext_resource path="res://objects/enemy/rolling_saw.tscn" type="PackedScene" id=11] +[ext_resource path="res://objects/enemy/tin.tscn" type="PackedScene" id=12] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 4, 112 ) @@ -34,10 +36,10 @@ __meta__ = { tile_set = ExtResource( 4 ) cell_size = Vector2( 8, 8 ) format = 1 -tile_data = PoolIntArray( 589830, 0, 0, 655366, 0, 0, 720902, 0, 0, 786438, 0, 0, 851974, 0, 0, 917510, 0, 0, 917511, 0, 0, 917512, 0, 0, 917513, 0, 0, 917514, 0, 0, 917515, 0, 0, 917516, 0, 0, 917517, 0, 0, 917518, 0, 0, 917519, 0, 0, 1179661, 0, 65536, 1179662, 0, 65537, 1179663, 0, 65537, 1179664, 0, 65537, 1179665, 0, 131074, 1179666, 0, 65537, 1179667, 0, 65537, 1179668, 0, 65537, 1179669, 0, 65537, 1179670, 0, 131074, 1179671, 0, 65537, 1179672, 0, 65537, 1441792, 0, 1, 1441793, 0, 2, 1441794, 0, 2, 1441795, 0, 2, 1441796, 0, 2, 1441797, 0, 2, 1441798, 0, 2, 1441799, 0, 2, 1441800, 0, 2, 1441801, 0, 2, 1441802, 0, 2, 1441803, 0, 2, 1441804, 0, 2, 1441805, 0, 2, 1441806, 0, 2, 1441807, 0, 2, 1441808, 0, 2, 1441809, 0, 2, 1441810, 0, 2, 1441811, 0, 2, 1441812, 0, 2, 1441813, 0, 2, 1441814, 0, 2, 1441815, 0, 2, 1441816, 0, 2, 1441817, 0, 2, 1441818, 0, 2, 1441819, 0, 2, 1441820, 0, 2, 1441821, 0, 2, 1441822, 0, 2, 1441823, 0, 2, 1441824, 0, 2, 1441825, 0, 2, 1441826, 0, 2, 1441827, 0, 2, 1441828, 0, 2, 1441829, 0, 2, 1441830, 0, 2, 1441831, 0, 2, 1441832, 0, 2, 1441833, 0, 2, 1441834, 0, 2, 1441835, 0, 2, 1441836, 0, 2, 1441837, 0, 2, 1441838, 0, 2, 1441839, 0, 2, 1441840, 0, 2, 1441841, 0, 2, 1441842, 0, 2, 1441843, 0, 2, 1441844, 0, 2, 1441845, 0, 2, 1441846, 0, 2, 1441847, 0, 2, 1441848, 0, 2, 1441849, 0, 2, 1441850, 0, 2, 1441851, 0, 2, 1441852, 0, 2, 1441853, 0, 2, 1441854, 0, 2, 1441855, 0, 2, 1441856, 0, 2, 1441857, 0, 2, 1441858, 0, 2, 1441859, 0, 2, 1441860, 0, 2, 1441861, 0, 2, 1441862, 0, 2, 1441863, 0, 2, 1441864, 0, 2, 1441865, 0, 2, 1441866, 0, 2, 1441867, 0, 2, 1441868, 0, 2, 1441869, 0, 2, 1441870, 0, 2, 1441871, 0, 2, 1441872, 0, 2, 1441873, 0, 2, 1441874, 0, 2, 1441875, 0, 2, 1441876, 0, 2, 1441877, 0, 2, 1441878, 0, 2, 1441879, 0, 2, 1441880, 0, 2, 1441881, 0, 2, 1441882, 0, 2, 1441883, 0, 2, 1441884, 0, 2, 1441885, 0, 2, 1441886, 0, 2, 1441887, 0, 3, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0, 1507384, 0, 0, 1507385, 0, 0, 1507386, 0, 0, 1507387, 0, 0, 1507388, 0, 0, 1507389, 0, 0, 1507390, 0, 0, 1507391, 0, 0, 1507392, 0, 0, 1507393, 0, 0, 1507394, 0, 0, 1507395, 0, 0, 1507396, 0, 0, 1507397, 0, 0, 1507398, 0, 0, 1507399, 0, 0, 1507400, 0, 0, 1507401, 0, 0, 1507402, 0, 0, 1507403, 0, 0, 1507404, 0, 0, 1507405, 0, 0, 1507406, 0, 0, 1507407, 0, 0, 1507408, 0, 0, 1507409, 0, 0, 1507410, 0, 0, 1507411, 0, 0, 1507412, 0, 0, 1507413, 0, 0, 1507414, 0, 0, 1507415, 0, 0, 1507416, 0, 0, 1507417, 0, 0, 1507418, 0, 0, 1507419, 0, 0, 1507420, 0, 0, 1507421, 0, 0, 1507422, 0, 0, 1507423, 0, 0 ) +tile_data = PoolIntArray( 589830, 0, 0, 655366, 0, 0, 655382, 0, 0, 720902, 0, 0, 720918, 0, 0, 786438, 0, 0, 786454, 0, 0, 851974, 0, 0, 851990, 0, 0, 917510, 0, 0, 917511, 0, 0, 917512, 0, 0, 917513, 0, 0, 917514, 0, 0, 917515, 0, 0, 917516, 0, 0, 917517, 0, 0, 917518, 0, 0, 917519, 0, 0, 917520, 0, 0, 917521, 0, 0, 917522, 0, 0, 917523, 0, 0, 917524, 0, 0, 917525, 0, 0, 917526, 0, 0, 917541, 0, 0, 917542, 0, 0, 917543, 0, 0, 917544, 0, 0, 1048602, 0, 0, 1048603, 0, 0, 1048604, 0, 0, 1048605, 0, 0, 1048606, 0, 0, 1048607, 0, 0, 1048608, 0, 0, 1048609, 0, 0, 1048610, 0, 0, 1179661, 0, 65536, 1179662, 0, 65537, 1179663, 0, 65537, 1179664, 0, 65537, 1179665, 0, 131074, 1179666, 0, 65537, 1179667, 0, 65537, 1179668, 0, 65537, 1179669, 0, 65537, 1179670, 0, 131074, 1179671, 0, 65537, 1179672, 0, 65537, 1179673, 0, 65537, 1179674, 0, 65537, 1179675, 0, 65537, 1179676, 0, 65537, 1179677, 0, 65537, 1179678, 0, 65537, 1179679, 0, 65537, 1179680, 0, 65537, 1179681, 0, 65537, 1179682, 0, 65537, 1179683, 0, 65537, 1179684, -1610612736, 131072, 1245220, -1073741824, 131072, 1245221, 0, 65537, 1245222, 0, 65537, 1245223, 0, 131075, 1441792, 0, 1, 1441793, 0, 2, 1441794, 0, 2, 1441795, 0, 2, 1441796, 0, 2, 1441797, 0, 2, 1441798, 0, 2, 1441799, 0, 2, 1441800, 0, 2, 1441801, 0, 2, 1441802, 0, 2, 1441803, 0, 2, 1441804, 0, 2, 1441805, 0, 2, 1441806, 0, 2, 1441807, 0, 2, 1441808, 0, 2, 1441809, 0, 2, 1441810, 0, 2, 1441811, 0, 2, 1441812, 0, 2, 1441813, 0, 2, 1441814, 0, 2, 1441815, 0, 2, 1441816, 0, 2, 1441817, 0, 2, 1441818, 0, 2, 1441819, 0, 2, 1441820, 0, 2, 1441821, 0, 2, 1441822, 0, 2, 1441823, 0, 2, 1441824, 0, 2, 1441825, 0, 2, 1441826, 0, 2, 1441827, 0, 2, 1441828, 0, 2, 1441829, 0, 2, 1441830, 0, 2, 1441831, 0, 2, 1441832, 0, 2, 1441833, 0, 2, 1441834, 0, 2, 1441835, 0, 2, 1441836, 0, 2, 1441837, 0, 2, 1441838, 0, 2, 1441839, 0, 2, 1441840, 0, 2, 1441841, 0, 2, 1441842, 0, 2, 1441843, 0, 2, 1441844, 0, 2, 1441845, 0, 2, 1441846, 0, 2, 1441847, 0, 2, 1441848, 0, 2, 1441849, 0, 2, 1441850, 0, 2, 1441851, 0, 2, 1441852, 0, 2, 1441853, 0, 2, 1441854, 0, 2, 1441855, 0, 2, 1441856, 0, 2, 1441857, 0, 2, 1441858, 0, 2, 1441859, 0, 2, 1441860, 0, 2, 1441861, 0, 2, 1441862, 0, 2, 1441863, 0, 2, 1441864, 0, 2, 1441865, 0, 2, 1441866, 0, 2, 1441867, 0, 2, 1441868, 0, 2, 1441869, 0, 2, 1441870, 0, 2, 1441871, 0, 2, 1441872, 0, 2, 1441873, 0, 2, 1441874, 0, 2, 1441875, 0, 2, 1441876, 0, 2, 1441877, 0, 2, 1441878, 0, 2, 1441879, 0, 2, 1441880, 0, 2, 1441881, 0, 2, 1441882, 0, 2, 1441883, 0, 2, 1441884, 0, 2, 1441885, 0, 2, 1441886, 0, 2, 1441887, 0, 3, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0, 1507339, 0, 0, 1507340, 0, 0, 1507341, 0, 0, 1507342, 0, 0, 1507343, 0, 0, 1507344, 0, 0, 1507345, 0, 0, 1507346, 0, 0, 1507347, 0, 0, 1507348, 0, 0, 1507349, 0, 0, 1507350, 0, 0, 1507351, 0, 0, 1507352, 0, 0, 1507353, 0, 0, 1507354, 0, 0, 1507355, 0, 0, 1507356, 0, 0, 1507357, 0, 0, 1507358, 0, 0, 1507359, 0, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 0, 0, 1507367, 0, 0, 1507368, 0, 0, 1507369, 0, 0, 1507370, 0, 0, 1507371, 0, 0, 1507372, 0, 0, 1507373, 0, 0, 1507374, 0, 0, 1507375, 0, 0, 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0, 1507384, 0, 0, 1507385, 0, 0, 1507386, 0, 0, 1507387, 0, 0, 1507388, 0, 0, 1507389, 0, 0, 1507390, 0, 0, 1507391, 0, 0, 1507392, 0, 0, 1507393, 0, 0, 1507394, 0, 0, 1507395, 0, 0, 1507396, 0, 0, 1507397, 0, 0, 1507398, 0, 0, 1507399, 0, 0, 1507400, 0, 0, 1507401, 0, 0, 1507402, 0, 0, 1507403, 0, 0, 1507404, 0, 0, 1507405, 0, 0, 1507406, 0, 0, 1507407, 0, 0, 1507408, 0, 0, 1507409, 0, 0, 1507410, 0, 0, 1507411, 0, 0, 1507412, 0, 0, 1507413, 0, 0, 1507414, 0, 0, 1507415, 0, 0, 1507416, 0, 0, 1507417, 0, 0, 1507418, 0, 0, 1507419, 0, 0, 1507420, 0, 0, 1507421, 0, 0, 1507422, 0, 0, 1507423, 0, 0 ) [node name="Player" parent="." instance=ExtResource( 5 )] -position = Vector2( 64, 160 ) +position = Vector2( 32, 160 ) [node name="Ladder" type="TileMap" parent="."] tile_set = ExtResource( 4 ) @@ -47,10 +49,11 @@ format = 1 [node name="Environment" type="Node2D" parent="."] [node name="Rock" parent="Environment" instance=ExtResource( 8 )] -position = Vector2( 104, 104 ) +position = Vector2( 314, 145 ) [node name="TurningPlatform" parent="Environment" instance=ExtResource( 9 )] position = Vector2( 88, 160 ) +time = 30.0 [node name="Enemies" type="Node2D" parent="."] @@ -68,6 +71,15 @@ rotation = 3.14159 position = Vector2( 184, 152 ) rotation = 3.14159 +[node name="RollingSaw" parent="Enemies" instance=ExtResource( 11 )] +position = Vector2( 304, 104 ) + +[node name="Tin" parent="Enemies" instance=ExtResource( 12 )] +position = Vector2( 192, 128 ) +up_boundary = 5.0 +down_boundary = 2.0 +move_direction = 1 + [node name="Collectibles" type="Node2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="."] @@ -86,6 +98,9 @@ margin_right = 512.0 margin_bottom = 192.0 color = Color( 0, 1, 0.227451, 0.0627451 ) script = ExtResource( 6 ) +__meta__ = { +"_edit_lock_": true +} [node name="ColorRect2" type="ColorRect" parent="."] margin_left = 512.0 @@ -93,6 +108,9 @@ margin_right = 768.0 margin_bottom = 192.0 color = Color( 1, 0.937255, 0, 0.0627451 ) script = ExtResource( 6 ) +__meta__ = { +"_edit_lock_": true +} [node name="ICantTakeItAnymore" type="Sprite" parent="."] position = Vector2( -96, 96 ) diff --git a/maps/test_room.tscn b/maps/test_room.tscn index 8c56bf1..82e02e1 100644 --- a/maps/test_room.tscn +++ b/maps/test_room.tscn @@ -144,6 +144,12 @@ position = Vector2( 32, 72 ) up_boundary = 3.0 down_boundary = 3.0 +[node name="Tin3" parent="." instance=ExtResource( 20 )] +position = Vector2( 96, 72 ) +up_boundary = 3.0 +down_boundary = 3.0 +move_direction = 1 + [node name="SawTest3" type="AnimatedSprite" parent="."] material = SubResource( 4 ) position = Vector2( 120, 168 ) diff --git a/objects/enemy/enemy_move_diagonal.gd b/objects/enemy/enemy_move_diagonal.gd index cf45db0..cab732a 100644 --- a/objects/enemy/enemy_move_diagonal.gd +++ b/objects/enemy/enemy_move_diagonal.gd @@ -7,7 +7,7 @@ export var down_boundary = 0.0 var direction = Vector2(1,1) export var speed = 50 #Move horizontal or vertical -export(int, "Left To Right", "Right To Left") var move_direction +export(int, "/", "\\") var move_direction #Onreadys onready var startpos = position @@ -17,7 +17,7 @@ func _ready(): down_boundary *= 8 #Move in direction selected if move_direction == 0: - direction = Vector2(-1,-1) + direction = Vector2(1,-1) func _physics_process(delta): #Move