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
3cab2681
Commit
3cab2681
authored
2 years ago
by
Robin Ruud Kristensen
Browse files
Options
Downloads
Patches
Plain Diff
Enemy spawns in each room, no check for door to be locked
parent
6c525d1e
No related branches found
Branches containing commit
No related tags found
2 merge requests
!52
Updating master
,
!42
Ruud
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
+1
-0
1 addition, 0 deletions
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+12
-0
12 additions, 0 deletions
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
with
13 additions
and
0 deletions
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
+
1
−
0
View file @
3cab2681
...
...
@@ -20,6 +20,7 @@ namespace Bigsock
int
[,]
map
=
tilemapGenerator
.
GenerateArray
(
mapParam
[
randomMap
].
width
,
mapParam
[
randomMap
].
height
,
mapParam
[
randomMap
].
empty
);
roomList
.
Add
(
map
);
tilemapGenerator
.
RenderMap
(
roomList
[
i
],
i
);
tilemapGenerator
.
SpawnEnemies
(
map
,
4
+
i
,
i
);
}
/*
int randomMap = Random.Range(0, mapParam.Length);
...
...
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+
12
−
0
View file @
3cab2681
...
...
@@ -14,6 +14,7 @@ namespace Bigsock
[
SerializeField
]
PolygonCollider2D
polygonCollider
;
[
SerializeField
]
GameObject
Door
;
[
SerializeField
]
GameObject
Pad
;
[
SerializeField
]
GameObject
[]
Enemy
;
private
int
z_value
=
0
;
private
static
int
i
=
0
;
...
...
@@ -217,6 +218,17 @@ namespace Bigsock
return
i
++;
}
public
void
SpawnEnemies
(
int
[,]
map
,
int
enemies
,
int
roomNr
)
{
for
(
int
i
=
0
;
i
<
enemies
;
i
++)
{
int
randomLocation_x
=
Random
.
Range
(
0
,
map
.
GetUpperBound
(
0
));
int
randomLocation_y
=
Random
.
Range
(
0
,
map
.
GetUpperBound
(
1
));
Instantiate
(
Enemy
[
0
],
new
Vector3Int
((
int
)
FloorTilemap
[
roomNr
].
transform
.
position
.
x
+
randomLocation_x
,
(
int
)
FloorTilemap
[
roomNr
].
transform
.
position
.
y
+
randomLocation_y
,
0
),
Quaternion
.
identity
);
}
}
public
void
polyCollider
(
int
[,]
map
,
int
roomNr
)
{
polygonCollider
.
pathCount
=
1
;
...
...
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