Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
3d48f0f6
Commit
3d48f0f6
authored
Dec 31, 2015
by
Lucas Delcros
Browse files
entities spawn is now checked is speciesArray (see issue)
parent
ed3617c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/map_generation/map/MapBuilder.java
View file @
3d48f0f6
...
...
@@ -164,7 +164,8 @@ public final class MapBuilder implements Serializable{
int
jj
=
rooms
.
get
(
room
).
j1
+
r
.
nextInt
(
rooms
.
get
(
room
).
width
);
int
posY
=
ii
*
Point
.
TileScale
;
int
posX
=
jj
*
Point
.
TileScale
;
if
(
tb
[
jj
][
ii
].
getType
()
!=
TileType
.
WATER
)
entities
.
add
(
SpeciesArray
.
create
(
posX
,
posY
,
100
,
"Ronflex"
,
"Monster "
+
i
));
//if(tb[jj][ii].getType() != TileType.WATER) entities.add(SpeciesArray.create(posX,posY,100,"Ronflex","Monster "+i));
if
(
SpeciesArray
.
canSpawn
(
Point
.
construct
(
posX
,
posY
),
"Ronflex"
))
entities
.
add
(
SpeciesArray
.
create
(
posX
,
posY
,
100
,
"Ronflex"
,
"Monster "
+
i
));
}
}
...
...
src/map_generation/tests/MapTests.java
View file @
3d48f0f6
...
...
@@ -32,5 +32,5 @@ public class MapTests {
Map
map
=
SurfacesMapGeneration
.
roomsRandomGeneration
(
20
,
500
);
assertFalse
(
"The player has spawn on water !"
,
map
.
getTileAt
(
map
.
getPositionPlayerStart
()).
getType
()
==
TileType
.
WATER
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment