-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inventory with weapon exchange. start work on doors
- Loading branch information
1 parent
c37a0f2
commit 0a3d19a
Showing
18 changed files
with
262 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
tool | ||
extends Area2D | ||
|
||
export(Array,String) var sensing_groups | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
extends Node2D | ||
|
||
|
||
export(Vector2) var closed_door_region_position | ||
export(Vector2) var opened_door_region_position | ||
|
||
var is_opened := false setget set_opened | ||
|
||
func _ready(): | ||
set_opened(false) | ||
|
||
|
||
func set_opened(opened): | ||
if opened: | ||
$Sprite.region_rect.position = opened_door_region_position | ||
#$SenseArea.set_collision_mask_bit(0,false) | ||
else: | ||
$Sprite.region_rect.position = closed_door_region_position | ||
#$SenseArea.set_collision_mask_bit(0,true) | ||
|
||
|
||
func _on_SenseArea_mouse_entered(): | ||
set_opened(true) | ||
|
||
|
||
func _on_SenseArea_mouse_exited(): | ||
set_opened(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[gd_scene load_steps=5 format=2] | ||
|
||
[ext_resource path="res://assets/0x72_16x16DungeonTileset_walls.v2.png" type="Texture" id=1] | ||
[ext_resource path="res://lib/SenseArea.tscn" type="PackedScene" id=2] | ||
[ext_resource path="res://lib/door/Door.gd" type="Script" id=3] | ||
|
||
[sub_resource type="RectangleShape2D" id=1] | ||
extents = Vector2( 16, 12 ) | ||
|
||
[node name="Door" type="Area2D"] | ||
collision_layer = 64 | ||
collision_mask = 17 | ||
script = ExtResource( 3 ) | ||
closed_door_region_position = Vector2( 112, 16 ) | ||
opened_door_region_position = Vector2( 176, 16 ) | ||
|
||
[node name="Sprite" type="Sprite" parent="."] | ||
texture = ExtResource( 1 ) | ||
region_enabled = true | ||
region_rect = Rect2( 112, 16, 32, 32 ) | ||
|
||
[node name="SenseArea" parent="." instance=ExtResource( 2 )] | ||
collision_layer = 64 | ||
collision_mask = 17 | ||
radius = 32.787 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] | ||
position = Vector2( 0, 4 ) | ||
shape = SubResource( 1 ) | ||
|
||
[connection signal="mouse_entered" from="SenseArea" to="." method="_on_SenseArea_mouse_entered"] | ||
[connection signal="mouse_exited" from="SenseArea" to="." method="_on_SenseArea_mouse_exited"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.