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
a0c7fd5a
Commit
a0c7fd5a
authored
Jan 05, 2016
by
Yann Ramusat
Browse files
AI stop on player.
parent
bfb791b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/artificial_intelligence/AIEntities/StraightEntity.java
View file @
a0c7fd5a
...
...
@@ -38,7 +38,13 @@ public class StraightEntity extends AbstractEntity {
if
(
victim_i
!=-
1
)
{
double
r
=
random
();
if
(
r
<
0.9
){
this
.
move_to_victim
(
gameState
.
getAllEntities
().
get
(
this
.
Choose_victim
()));
//this.move_to_victim(gameState.getAllEntities().get(this.Choose_victim()));
if
(
relayer
.
getCharacter
().
getCollisionBox
().
intersect
(
gameState
.
getAllEntities
().
get
(
this
.
Choose_victim
()).
getCollisionBox
()))
{
this
.
relayer
.
move
(
Direction
.
NONE
);
}
else
{
this
.
move_to_victim
(
gameState
.
getAllEntities
().
get
(
this
.
Choose_victim
()));
}
}
else
{
this
.
random_move
();
...
...
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