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
08eec84d
Commit
08eec84d
authored
2 years ago
by
Robin Ruud Kristensen
Browse files
Options
Downloads
Patches
Plain Diff
added spawning of stairs
parent
207656f9
No related branches found
No related tags found
1 merge request
!79
Ruud1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
+3
-1
3 additions, 1 deletion
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+2
-4
2 additions, 4 deletions
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
with
5 additions
and
5 deletions
MrBigsock/Assets/Code/Map/NeighbourMapGenerator.cs
+
3
−
1
View file @
08eec84d
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Security.Cryptography
;
using
UnityEngine
;
using
UnityEngine
;
namespace
Bigsock
namespace
Bigsock
...
@@ -15,7 +16,7 @@ namespace Bigsock
...
@@ -15,7 +16,7 @@ namespace Bigsock
public
override
void
RunProceduralGeneration
()
public
override
void
RunProceduralGeneration
()
{
{
roomList
.
Clear
();
roomList
.
Clear
();
for
(
int
i
=
0
;
i
<=
RoomCount
-
1
;
i
++)
for
(
int
i
=
0
;
i
<=
RoomCount
-
1
;
i
++)
{
{
int
randomMap
=
Random
.
Range
(
0
,
mapParam
.
Length
);
int
randomMap
=
Random
.
Range
(
0
,
mapParam
.
Length
);
...
@@ -29,6 +30,7 @@ namespace Bigsock
...
@@ -29,6 +30,7 @@ namespace Bigsock
roomList
.
Add
(
bossMap
);
roomList
.
Add
(
bossMap
);
tilemapGenerator
.
RenderMap
(
roomList
[
roomList
.
Count
-
1
],
roomList
.
Count
-
1
,
true
);
tilemapGenerator
.
RenderMap
(
roomList
[
roomList
.
Count
-
1
],
roomList
.
Count
-
1
,
true
);
tilemapGenerator
.
SpawnBoss
(
bossMap
,
roomList
.
Count
-
1
);
tilemapGenerator
.
SpawnBoss
(
bossMap
,
roomList
.
Count
-
1
);
tilemapGenerator
.
SpawnStairs
(
bossMap
,
roomList
.
Count
-
1
);
tilemapGenerator
.
polyCollider
(
roomList
[
0
],
0
);
tilemapGenerator
.
polyCollider
(
roomList
[
0
],
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Map/TilemapGenerator.cs
+
2
−
4
View file @
08eec84d
...
@@ -15,7 +15,7 @@ namespace Bigsock
...
@@ -15,7 +15,7 @@ namespace Bigsock
[
SerializeField
]
GameObject
Door
;
[
SerializeField
]
GameObject
Door
;
[
SerializeField
]
GameObject
[]
Enemy
;
[
SerializeField
]
GameObject
[]
Enemy
;
[
SerializeField
]
GameObject
Boss
;
[
SerializeField
]
GameObject
Boss
;
//
[SerializeField] GameObject Stairs;
[
SerializeField
]
GameObject
Stairs
;
[
SerializeField
]
GameObject
Chest
;
[
SerializeField
]
GameObject
Chest
;
private
int
z_value
=
0
;
private
int
z_value
=
0
;
private
static
int
roomID
=
0
;
private
static
int
roomID
=
0
;
...
@@ -353,13 +353,11 @@ namespace Bigsock
...
@@ -353,13 +353,11 @@ namespace Bigsock
}
}
}
}
/*
public
void
SpawnStairs
(
int
[,]
bossRoom
,
int
roomNr
)
public
void
SpawnStairs
(
int
[,]
bossRoom
,
int
roomNr
)
{
{
Instantiate
(
Stairs
,
new
Vector3
(
FloorTilemap
[
roomNr
].
transform
.
position
.
x
+
bossRoom
.
GetUpperBound
(
0
)
/
2
,
Instantiate
(
Stairs
,
new
Vector3
(
FloorTilemap
[
roomNr
].
transform
.
position
.
x
+
bossRoom
.
GetUpperBound
(
0
)
/
2
,
FloorTilemap[roomNr].transform.position.y + bossRoom.GetUpperBound(1)
/ 2
, 0), Quaternion.identity);
FloorTilemap
[
roomNr
].
transform
.
position
.
y
+
bossRoom
.
GetUpperBound
(
1
)
-
3
,
0
),
Quaternion
.
identity
);
}
}
*/
//Spawns a chest in the middle of the room
//Spawns a chest in the middle of the room
public
void
spawnChest
(
int
[,]
room
,
int
roomNr
)
public
void
spawnChest
(
int
[,]
room
,
int
roomNr
)
...
...
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