Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
the_dungeon_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
3d48f0f6
Commit
3d48f0f6
authored
Dec 31, 2015
by
Lucas Delcros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
entities spawn is now checked is speciesArray (see issue)
parent
ed3617c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/map_generation/map/MapBuilder.java
src/map_generation/map/MapBuilder.java
+2
-1
src/map_generation/tests/MapTests.java
src/map_generation/tests/MapTests.java
+1
-1
No files found.
src/map_generation/map/MapBuilder.java
View file @
3d48f0f6
...
@@ -164,7 +164,8 @@ public final class MapBuilder implements Serializable{
...
@@ -164,7 +164,8 @@ public final class MapBuilder implements Serializable{
int
jj
=
rooms
.
get
(
room
).
j1
+
r
.
nextInt
(
rooms
.
get
(
room
).
width
);
int
jj
=
rooms
.
get
(
room
).
j1
+
r
.
nextInt
(
rooms
.
get
(
room
).
width
);
int
posY
=
ii
*
Point
.
TileScale
;
int
posY
=
ii
*
Point
.
TileScale
;
int
posX
=
jj
*
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 {
...
@@ -32,5 +32,5 @@ public class MapTests {
Map
map
=
SurfacesMapGeneration
.
roomsRandomGeneration
(
20
,
500
);
Map
map
=
SurfacesMapGeneration
.
roomsRandomGeneration
(
20
,
500
);
assertFalse
(
"The player has spawn on water !"
,
map
.
getTileAt
(
map
.
getPositionPlayerStart
()).
getType
()
==
TileType
.
WATER
);
assertFalse
(
"The player has spawn on water !"
,
map
.
getTileAt
(
map
.
getPositionPlayerStart
()).
getType
()
==
TileType
.
WATER
);
}
}
}
}
Write
Preview
Markdown
is supported
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