Skip to content

Commit

Permalink
Started working on puzzle box
Browse files Browse the repository at this point in the history
#223 It doesn't move when pushed, but it exists. We also still need to make the area, and have the box actively check if it's inside its area.
  • Loading branch information
cbcerquiaga committed Aug 26, 2019
1 parent 7165d3a commit b1b234b
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/box_placeholder.png-2b32949113b99f81b2809c54c1526ca8.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Images/box_placeholder.png"
dest_files=[ "res://.import/box_placeholder.png-2b32949113b99f81b2809c54c1526ca8.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
19 changes: 19 additions & 0 deletions You, Me, and the End of the World/Scripts/puzzleBox.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends KinematicBody2D

onready var isInArea
var isTouchingPlayer
var velocity = Vector2()

# Called when the node enters the scene tree for the first time.
func _ready():
isInArea = true
pass # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var collision = move_and_collide(velocity * delta)
if collision and isInArea:
print("move, sucka")
# To make the other kinematicbody2d move as well
collision.collider.move_and_slide(velocity * delta)
pass
16 changes: 10 additions & 6 deletions You, Me, and the End of the World/tscn files/World1.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=2]
[gd_scene load_steps=21 format=2]

[ext_resource path="res://Scripts/sceneManager.gd" type="Script" id=1]
[ext_resource path="res://tscn files/Item_popup.tscn" type="PackedScene" id=2]
Expand All @@ -17,8 +17,9 @@
[ext_resource path="res://tscn files/DollHead.tscn" type="PackedScene" id=15]
[ext_resource path="res://tscn files/LightSaber.tscn" type="PackedScene" id=16]
[ext_resource path="res://tscn files/coins.tscn" type="PackedScene" id=17]
[ext_resource path="res://tscn files/Gut.tscn" type="PackedScene" id=18]
[ext_resource path="res://tscn files/HUDControl.tscn" type="PackedScene" id=19]
[ext_resource path="res://tscn files/puzzleBox.tscn" type="PackedScene" id=18]
[ext_resource path="res://tscn files/Gut.tscn" type="PackedScene" id=19]
[ext_resource path="res://tscn files/HUDControl.tscn" type="PackedScene" id=20]

[node name="Root" type="Control"]
script = ExtResource( 1 )
Expand Down Expand Up @@ -52,7 +53,7 @@ cell_y_sort = true
cell_clip_uv = true
collision_friction = 0.0
format = 1
tile_data = PoolIntArray( -2031640, 2, 0, -2031639, 2, 0, -2031638, 2, 0, -2031637, 2, 0, -2031636, 2, 0, -2031635, 2, 0, -2031634, 2, 0, -2031633, 2, 0, -2031632, 2, 0, -2031631, 2, 0, -2031630, 2, 0, -2031629, 2, 0, -2031628, 2, 0, -2031627, 2, 0, -2031626, 2, 0, -2031625, 2, 0, -2031624, 2, 0, -2031623, 2, 0, -2031622, 2, 0, -2031621, 2, 0, -2031620, 2, 0, -2031619, 2, 0, -2031618, 2, 0, -2031617, 2, 0, -2097152, 2, 0, -2097151, 2, 0, -2097150, 2, 0, -2097149, 2, 0, -2097148, 2, 0, -2097147, 2, 0, -2097146, 2, 0, -2097145, 2, 0, -2097144, 2, 0, -2097143, 2, 0, -2097142, 2, 0, -2097141, 2, 0, -2097140, 2, 0, -2097139, 2, 0, -2097138, 2, 0, -2097137, 2, 0, -2097136, 2, 0, -2097135, 2, 0, -2097134, 2, 0, -2097133, 2, 0, -2097132, 2, 0, -2097131, 2, 0, -2097130, 2, 0, -2097129, 2, 0, -1966104, 2, 0, -2031593, 2, 0, -1900568, 2, 0, -1966057, 2, 0, -1835032, 2, 0, -1900521, 2, 0, -1769496, 2, 0, -1834985, 2, 0, -1703960, 2, 0, -1769449, 2, 0, -1638424, 2, 0, -1703913, 2, 0, -1572888, 2, 0, -1638377, 2, 0, -1507352, 2, 0, -1572841, 2, 0, -1441816, 2, 0, -1507305, 2, 0, -1376280, 2, 0, -1441769, 2, 0, -1310744, 2, 0, -1376233, 2, 0, -1245208, 2, 0, -1310697, 2, 0, -1179672, 2, 0, -1245161, 2, 0, -1114136, 2, 0, -1179625, 2, 0, -1048600, 2, 0, -1114089, 2, 0, -983064, 2, 0, -1048553, 2, 0, -983017, 2, 0, -851992, 2, 0, -917481, 2, 0, -786456, 2, 0, -851945, 2, 0, -720920, 2, 0, -786409, 2, 0, -655384, 2, 0, -720873, 2, 0, -589848, 2, 0, -655337, 2, 0, -524312, 2, 0, -589801, 2, 0, -458776, 2, 0, -524265, 2, 0, -393240, 2, 0, -458729, 2, 0, -327704, 2, 0, -393193, 2, 0, -262168, 2, 0, -327657, 2, 0, -196632, 2, 0, -196610, 2, 0, -196609, 2, 0, -262144, 2, 0, -262143, 2, 0, -262142, 2, 0, -262141, 2, 0, -262140, 2, 0, -262139, 2, 0, -262138, 2, 0, -262137, 2, 0, -262136, 2, 0, -262135, 2, 0, -262134, 2, 0, -262133, 2, 0, -262121, 2, 0, -131096, 2, 0, -196597, 2, 0, -196585, 2, 0, -65560, 2, 0, -65538, 2, 0, -131049, 2, 0, -24, 2, 0, -2, 2, 0, -65532, 2, 0, -65531, 2, 0, -65530, 2, 0, -65529, 2, 0, -65528, 2, 0, -65527, 2, 0, -65526, 2, 0, -65525, 2, 0, -65513, 2, 0, 65512, 2, 0, 65534, 2, 0, 4, 2, 0, 11, 2, 0, 23, 2, 0, 131048, 2, 0, 131070, 2, 0, 65547, 2, 0, 65559, 2, 0, 196584, 2, 0, 196606, 2, 0, 131076, 2, 0, 131083, 2, 0, 131095, 2, 0, 262120, 2, 0, 262142, 2, 0, 262143, 2, 0, 196608, 2, 0, 196609, 2, 0, 196610, 2, 0, 196611, 2, 0, 196612, 2, 0, 196613, 2, 0, 196614, 2, 0, 196615, 2, 0, 196616, 2, 0, 196617, 2, 0, 196618, 2, 0, 196619, 2, 0, 196631, 2, 0, 327656, 2, 0, 262167, 2, 0, 393192, 2, 0, 327703, 2, 0, 458728, 2, 0, 393239, 2, 0, 524264, 2, 0, 458775, 2, 0, 589800, 2, 0, 524311, 2, 0, 655336, 2, 0, 589847, 2, 0, 720872, 2, 0, 655383, 2, 0, 786408, 2, 0, 720919, 2, 0, 851944, 2, 0, 786455, 2, 0, 917480, 2, 0, 851991, 2, 0, 983016, 2, 0, 917527, 2, 0, 1048552, 2, 0, 983063, 2, 0, 1114088, 2, 0, 1048599, 2, 0, 1179624, 2, 0, 1114135, 2, 0, 1245160, 2, 0, 1179671, 2, 0, 1310696, 2, 0, 1245207, 2, 0, 1376232, 2, 0, 1310743, 2, 0, 1441768, 2, 0, 1376279, 2, 0, 1507304, 2, 0, 1441815, 2, 0, 1572840, 2, 0, 1507351, 2, 0, 1638376, 2, 0, 1572887, 2, 0, 1703912, 2, 0, 1638423, 2, 0, 1769448, 2, 0, 1703959, 2, 0, 1834984, 2, 0, 1769495, 2, 0, 1900520, 2, 0, 1835031, 2, 0, 1966056, 2, 0, 1900567, 2, 0, 2031592, 2, 0, 1966103, 2, 0, 2097128, 2, 0, 2031639, 2, 0, 2162664, 2, 0, 2097175, 2, 0, 2228200, 2, 0, 2162711, 2, 0, 2293736, 2, 0, 2228247, 2, 0, 2359272, 2, 0, 2293783, 2, 0, 2424808, 2, 0, 2359319, 2, 0, 2490344, 2, 0, 2424855, 2, 0, 2555880, 2, 0, 2490391, 2, 0, 2621416, 2, 0, 2555927, 2, 0, 2686952, 2, 0, 2621463, 2, 0, 2752488, 2, 0, 2686999, 2, 0, 2818024, 2, 0, 2752535, 2, 0, 2883560, 2, 0, 2818071, 2, 0, 2949096, 2, 0, 2883607, 2, 0, 3014632, 2, 0, 2949143, 2, 0, 3080168, 2, 0, 3014679, 2, 0, 3145704, 2, 0, 3145705, 2, 0, 3145706, 2, 0, 3145707, 2, 0, 3145708, 2, 0, 3145709, 2, 0, 3145710, 2, 0, 3145711, 2, 0, 3145712, 2, 0, 3145713, 2, 0, 3145714, 2, 0, 3145715, 2, 0, 3145716, 2, 0, 3145717, 2, 0, 3145718, 2, 0, 3145719, 2, 0, 3145720, 2, 0, 3145721, 2, 0, 3145722, 2, 0, 3145723, 2, 0, 3145724, 2, 0, 3145725, 2, 0, 3145726, 2, 0, 3080192, 2, 0, 3080193, 2, 0, 3080194, 2, 0, 3080195, 2, 0, 3080196, 2, 0, 3080197, 2, 0, 3080198, 2, 0, 3080199, 2, 0, 3080200, 2, 0, 3080201, 2, 0, 3080202, 2, 0, 3080203, 2, 0, 3080204, 2, 0, 3080205, 2, 0, 3080206, 2, 0, 3080207, 2, 0, 3080208, 2, 0, 3080209, 2, 0, 3080210, 2, 0, 3080211, 2, 0, 3080212, 2, 0, 3080213, 2, 0, 3080214, 2, 0, 3080215, 2, 0 )
tile_data = PoolIntArray( -2031640, 2, 0, -2031639, 2, 0, -2031638, 2, 0, -2031637, 2, 0, -2031636, 2, 0, -2031635, 2, 0, -2031634, 2, 0, -2031633, 2, 0, -2031632, 2, 0, -2031631, 2, 0, -2031630, 2, 0, -2031629, 2, 0, -2031628, 2, 0, -2031627, 2, 0, -2031626, 2, 0, -2031625, 2, 0, -2031624, 2, 0, -2031623, 2, 0, -2031622, 2, 0, -2031621, 2, 0, -2031620, 2, 0, -2031619, 2, 0, -2031618, 2, 0, -2031617, 2, 0, -2097152, 2, 0, -2097151, 2, 0, -2097150, 2, 0, -2097149, 2, 0, -2097148, 2, 0, -2097147, 2, 0, -2097146, 2, 0, -2097145, 2, 0, -2097144, 2, 0, -2097143, 2, 0, -2097142, 2, 0, -2097141, 2, 0, -2097140, 2, 0, -2097139, 2, 0, -2097138, 2, 0, -2097137, 2, 0, -2097136, 2, 0, -2097135, 2, 0, -2097134, 2, 0, -2097133, 2, 0, -2097132, 2, 0, -2097131, 2, 0, -2097130, 2, 0, -2097129, 2, 0, -1966104, 2, 0, -2031593, 2, 0, -1900568, 2, 0, -1966057, 2, 0, -1835032, 2, 0, -1900521, 2, 0, -1769496, 2, 0, -1834985, 2, 0, -1703960, 2, 0, -1769449, 2, 0, -1638424, 2, 0, -1703913, 2, 0, -1572888, 2, 0, -1638377, 2, 0, -1507352, 2, 0, -1572841, 2, 0, -1441816, 2, 0, -1507305, 2, 0, -1376280, 2, 0, -1441769, 2, 0, -1310744, 2, 0, -1376233, 2, 0, -1245208, 2, 0, -1310697, 2, 0, -1179672, 2, 0, -1245161, 2, 0, -1114136, 2, 0, -1179625, 2, 0, -1048600, 2, 0, -1114089, 2, 0, -983064, 2, 0, -1048553, 2, 0, -983017, 2, 0, -851992, 2, 0, -917481, 2, 0, -786456, 2, 0, -851945, 2, 0, -720920, 2, 0, -786409, 2, 0, -655384, 2, 0, -720873, 2, 0, -589848, 2, 0, -655337, 2, 0, -524312, 2, 0, -589801, 2, 0, -458776, 2, 0, -524265, 2, 0, -393240, 2, 0, -458729, 2, 0, -327704, 2, 0, -393193, 2, 0, -262168, 2, 0, -327657, 2, 0, -196632, 2, 0, -196610, 2, 0, -196609, 2, 0, -262144, 2, 0, -262143, 2, 0, -262142, 2, 0, -262141, 2, 0, -262140, 2, 0, -262139, 2, 0, -262138, 2, 0, -262137, 2, 0, -262136, 2, 0, -262135, 2, 0, -262134, 2, 0, -262133, 2, 0, -262121, 2, 0, -131096, 2, 0, -196597, 2, 0, -196585, 2, 0, -65560, 2, 0, -65538, 2, 0, -131049, 2, 0, -24, 2, 0, -2, 2, 0, -65532, 2, 0, -65531, 2, 0, -65530, 2, 0, -65529, 2, 0, -65528, 2, 0, -65527, 2, 0, -65526, 2, 0, -65525, 2, 0, -65513, 2, 0, 65512, 2, 0, 65534, 2, 0, 4, 2, 0, 11, 2, 0, 23, 2, 0, 131048, 2, 0, 131070, 2, 0, 65547, 2, 0, 65559, 2, 0, 196584, 2, 0, 196606, 2, 0, 131076, 2, 0, 131083, 2, 0, 131095, 2, 0, 262120, 2, 0, 262142, 2, 0, 262143, 2, 0, 196608, 2, 0, 196609, 2, 0, 196610, 2, 0, 196611, 2, 0, 196612, 2, 0, 196613, 2, 0, 196614, 2, 0, 196618, 2, 0, 196619, 2, 0, 196631, 2, 0, 327656, 2, 0, 262167, 2, 0, 393192, 2, 0, 327703, 2, 0, 458728, 2, 0, 393239, 2, 0, 524264, 2, 0, 458775, 2, 0, 589800, 2, 0, 524311, 2, 0, 655336, 2, 0, 589847, 2, 0, 720872, 2, 0, 655383, 2, 0, 786408, 2, 0, 720919, 2, 0, 851944, 2, 0, 786455, 2, 0, 917480, 2, 0, 851991, 2, 0, 983016, 2, 0, 917527, 2, 0, 1048552, 2, 0, 983063, 2, 0, 1114088, 2, 0, 1048599, 2, 0, 1179624, 2, 0, 1114135, 2, 0, 1245160, 2, 0, 1179671, 2, 0, 1310696, 2, 0, 1245207, 2, 0, 1376232, 2, 0, 1310743, 2, 0, 1441768, 2, 0, 1376279, 2, 0, 1507304, 2, 0, 1441815, 2, 0, 1572840, 2, 0, 1507351, 2, 0, 1638376, 2, 0, 1572887, 2, 0, 1703912, 2, 0, 1638423, 2, 0, 1769448, 2, 0, 1703959, 2, 0, 1834984, 2, 0, 1769495, 2, 0, 1900520, 2, 0, 1835031, 2, 0, 1966056, 2, 0, 1900567, 2, 0, 2031592, 2, 0, 1966103, 2, 0, 2097128, 2, 0, 2031639, 2, 0, 2162664, 2, 0, 2097175, 2, 0, 2228200, 2, 0, 2162711, 2, 0, 2293736, 2, 0, 2228247, 2, 0, 2359272, 2, 0, 2293783, 2, 0, 2424808, 2, 0, 2359319, 2, 0, 2490344, 2, 0, 2424855, 2, 0, 2555880, 2, 0, 2490391, 2, 0, 2621416, 2, 0, 2555927, 2, 0, 2686952, 2, 0, 2621463, 2, 0, 2752488, 2, 0, 2686999, 2, 0, 2818024, 2, 0, 2752535, 2, 0, 2883560, 2, 0, 2818071, 2, 0, 2949096, 2, 0, 2883607, 2, 0, 3014632, 2, 0, 2949143, 2, 0, 3080168, 2, 0, 3014679, 2, 0, 3145704, 2, 0, 3145705, 2, 0, 3145706, 2, 0, 3145707, 2, 0, 3145708, 2, 0, 3145709, 2, 0, 3145710, 2, 0, 3145711, 2, 0, 3145712, 2, 0, 3145713, 2, 0, 3145714, 2, 0, 3145715, 2, 0, 3145716, 2, 0, 3145717, 2, 0, 3145718, 2, 0, 3145719, 2, 0, 3145720, 2, 0, 3145721, 2, 0, 3145722, 2, 0, 3145723, 2, 0, 3145724, 2, 0, 3145725, 2, 0, 3145726, 2, 0, 3080192, 2, 0, 3080193, 2, 0, 3080194, 2, 0, 3080195, 2, 0, 3080196, 2, 0, 3080197, 2, 0, 3080198, 2, 0, 3080199, 2, 0, 3080200, 2, 0, 3080201, 2, 0, 3080202, 2, 0, 3080203, 2, 0, 3080204, 2, 0, 3080205, 2, 0, 3080206, 2, 0, 3080207, 2, 0, 3080208, 2, 0, 3080209, 2, 0, 3080210, 2, 0, 3080211, 2, 0, 3080212, 2, 0, 3080213, 2, 0, 3080214, 2, 0, 3080215, 2, 0 )
__meta__ = {
"_edit_lock_": true
}
Expand Down Expand Up @@ -100,7 +101,10 @@ position = Vector2( 326.471, 203.025 )
[node name="coins" parent="walls" instance=ExtResource( 17 )]
position = Vector2( 387.029, 231.751 )

[node name="Gut" parent="." instance=ExtResource( 18 )]
[node name="box" parent="." instance=ExtResource( 18 )]
position = Vector2( 107.153, 583.209 )

[node name="Gut" parent="." instance=ExtResource( 19 )]
visible = false
_visibility_option = false
_should_maximize = false
Expand All @@ -120,7 +124,7 @@ _directory4 = ""
_directory5 = ""
_directory6 = ""

[node name="HUDControl" parent="." instance=ExtResource( 19 )]
[node name="HUDControl" parent="." instance=ExtResource( 20 )]
margin_left = -64.0
margin_top = -81.0
margin_right = -24.0
Expand Down
15 changes: 15 additions & 0 deletions You, Me, and the End of the World/tscn files/puzzleBox.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Scripts/puzzleBox.gd" type="Script" id=1]
[ext_resource path="res://Images/box_placeholder.png" type="Texture" id=2]

[node name="box" type="KinematicBody2D"]
scale = Vector2( 0.25, 0.25 )
script = ExtResource( 1 )

[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 154.895, -39.6647, 155.904, 102.161, 26.696, 169.289, -155.508, 106.704, -156.012, -25.0278, 14.179, -117.795, 153.986, -40.5732 )

0 comments on commit b1b234b

Please sign in to comment.