Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mr BigSock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gard Aleksander Furre
Mr BigSock
Commits
632ac86a
Commit
632ac86a
authored
2 years ago
by
Robin Ruud Kristensen
Browse files
Options
Downloads
Patches
Plain Diff
added tag for enemies to check if room is cleared
parent
d2d2bddd
No related branches found
Branches containing commit
No related tags found
2 merge requests
!52
Updating master
,
!49
Ruud1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/InteractionSystem/Door.cs
+17
-12
17 additions, 12 deletions
MrBigsock/Assets/Code/InteractionSystem/Door.cs
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+1
-1
1 addition, 1 deletion
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
with
18 additions
and
13 deletions
MrBigsock/Assets/Code/InteractionSystem/Door.cs
+
17
−
12
View file @
632ac86a
...
...
@@ -9,8 +9,8 @@ namespace BigSock.Interact {
[
SerializeField
]
private
string
_prompt
;
public
SpriteRenderer
spriteRenderer
;
public
Sprite
newSprite
;
private
GameObject
player
;
private
GameObject
[]
enemies
;
private
GameObject
player
;
private
GameObject
cameraPlayer
;
private
int
i
=
TilemapGenerator
.
NextRoom
();
private
GameObject
boundary
;
...
...
@@ -18,15 +18,20 @@ namespace BigSock.Interact {
public
string
InteractionPrompt
=>
_prompt
;
public
bool
Interact
(
Interactor
interactor
)
{
Debug
.
Log
(
"Opening door!"
);
spriteRenderer
.
sprite
=
newSprite
;
player
=
GameObject
.
Find
(
"BigSock"
);
boundary
=
GameObject
.
Find
(
"CameraBoundry"
);
cameraPlayer
=
GameObject
.
Find
(
"Main Camera"
);
player
.
transform
.
position
=
TilemapGenerator
.
DoorLocaitonTransport
(
i
);
cameraPlayer
.
transform
.
position
=
player
.
transform
.
position
;
boundary
.
GetComponent
<
PolygonCollider2D
>().
SetPath
(
0
,
TilemapGenerator
.
GetRoom
(
i
));
return
true
;
enemies
=
GameObject
.
FindGameObjectsWithTag
((
i
-
1
).
ToString
());
if
(
enemies
.
Length
==
0
)
{
Debug
.
Log
(
"Opening door!"
);
spriteRenderer
.
sprite
=
newSprite
;
player
=
GameObject
.
Find
(
"BigSock"
);
boundary
=
GameObject
.
Find
(
"CameraBoundry"
);
cameraPlayer
=
GameObject
.
Find
(
"Main Camera"
);
player
.
transform
.
position
=
TilemapGenerator
.
DoorLocaitonTransport
(
i
);
cameraPlayer
.
transform
.
position
=
player
.
transform
.
position
;
boundary
.
GetComponent
<
PolygonCollider2D
>().
SetPath
(
0
,
TilemapGenerator
.
GetRoomBoundary
(
i
));
return
true
;
}
return
false
;
}
}
}
}
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+
1
−
1
View file @
632ac86a
...
...
@@ -205,7 +205,7 @@ namespace Bigsock
MapBoundaryList
.
Add
(
MapBoudary
);
}
public
static
List
<
Vector2
>
GetRoom
(
int
i
)
public
static
List
<
Vector2
>
GetRoom
Boundary
(
int
i
)
{
return
MapBoundaryList
[
i
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment