Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
the_dungeon_project
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
ff0221e7
Commit
ff0221e7
authored
Jan 06, 2016
by
Theodore Lopez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.crans.org/genie_logiciel_2015/the_dungeon_project
parents
c22a3c1e
461411a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
5 deletions
+52
-5
src/assets/gold.png
src/assets/gold.png
+0
-0
src/assets/species/species.txt
src/assets/species/species.txt
+1
-1
src/graphics/guiSkeleton/entityDisplayer/EntityDisplayerProvider.java
.../guiSkeleton/entityDisplayer/EntityDisplayerProvider.java
+34
-0
src/graphics/guiSkeleton/sprites/SpriteStorage.java
src/graphics/guiSkeleton/sprites/SpriteStorage.java
+3
-2
src/ingame_programming/IGPEntity.java
src/ingame_programming/IGPEntity.java
+14
-2
No files found.
src/assets/gold.png
0 → 100644
View file @
ff0221e7
237 KB
src/assets/species/species.txt
View file @
ff0221e7
...
...
@@ -327,7 +327,7 @@ R
200
200
#entityDisplayerType
FIREBOLT
GOLD
#triggers
1
#trigger function
...
...
src/graphics/guiSkeleton/entityDisplayer/EntityDisplayerProvider.java
View file @
ff0221e7
...
...
@@ -316,6 +316,40 @@ public class EntityDisplayerProvider {
}
return
new
EntityDisplayer
(
associatedEntity
,
animationMapTab
,
'C'
);
}
case
GOLD
:
{
Map
<
Action
,
Animation
>[]
animationMapTab
=
new
Map
[
Direction
.
values
().
length
]
;
animationMapTab
[
Direction
.
RIGHT
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
animationMapTab
[
Direction
.
RIGHTUP
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
animationMapTab
[
Direction
.
UP
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
animationMapTab
[
Direction
.
LEFTUP
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();;
animationMapTab
[
Direction
.
LEFT
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
animationMapTab
[
Direction
.
LEFTDOWN
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();;
animationMapTab
[
Direction
.
DOWN
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
animationMapTab
[
Direction
.
RIGHTDOWN
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
Sprite
gold
=
SpriteStorage
.
getInstance
().
getGold
();
for
(
Action
action
:
Action
.
values
())
{
Sprite
persoR
=
new
Sprite
(
gold
.
getSpriteImage
(),
0
,
0
,
64
,
32
);
Animation
persoAnimationRIGHT
=
new
Animation
(
persoR
,
2
,
frameDelay
);
animationMapTab
[
Direction
.
RIGHT
.
ordinal
()].
put
(
action
,
persoAnimationRIGHT
);
animationMapTab
[
Direction
.
RIGHTUP
.
ordinal
()].
put
(
action
,
persoAnimationRIGHT
);
Sprite
persoU
=
new
Sprite
(
gold
.
getSpriteImage
(),
0
,
32
,
64
,
32
);
Animation
persoAnimationUP
=
new
Animation
(
persoU
,
2
,
frameDelay
);
animationMapTab
[
Direction
.
UP
.
ordinal
()].
put
(
action
,
persoAnimationUP
);
animationMapTab
[
Direction
.
LEFTUP
.
ordinal
()].
put
(
action
,
persoAnimationUP
);
Sprite
persoL
=
new
Sprite
(
gold
.
getSpriteImage
(),
0
,
64
,
64
,
32
);
Animation
persoAnimationLEFT
=
new
Animation
(
persoL
,
2
,
frameDelay
);
animationMapTab
[
Direction
.
LEFT
.
ordinal
()].
put
(
action
,
persoAnimationLEFT
);
animationMapTab
[
Direction
.
LEFTDOWN
.
ordinal
()].
put
(
action
,
persoAnimationLEFT
);
Sprite
persoroseD
=
new
Sprite
(
gold
.
getSpriteImage
(),
0
,
96
,
64
,
32
);
Animation
persoAnimationDOWN
=
new
Animation
(
persoroseD
,
2
,
frameDelay
);
animationMapTab
[
Direction
.
DOWN
.
ordinal
()].
put
(
action
,
persoAnimationDOWN
);
animationMapTab
[
Direction
.
RIGHTDOWN
.
ordinal
()].
put
(
action
,
persoAnimationDOWN
);
}
return
new
EntityDisplayer
(
associatedEntity
,
animationMapTab
,
'C'
);
}
default
:
{
Map
<
Action
,
Animation
>[]
animationMapTab
=
new
Map
[
Direction
.
values
().
length
]
;
animationMapTab
[
Direction
.
RIGHT
.
ordinal
()]
=
new
HashMap
<
Action
,
Animation
>();
...
...
src/graphics/guiSkeleton/sprites/SpriteStorage.java
View file @
ff0221e7
...
...
@@ -28,7 +28,7 @@ public class SpriteStorage {
diagla
=
new
Sprite
(
ImageIO
.
read
(
UsedForLoadingSprites
.
getInstance
().
getClass
().
getResource
(
"diagla.png"
)));
firebolt
=
new
Sprite
(
ImageIO
.
read
(
UsedForLoadingSprites
.
getInstance
().
getClass
().
getResource
(
"firebolt.png"
)));
frostbolt
=
new
Sprite
(
ImageIO
.
read
(
UsedForLoadingSprites
.
getInstance
().
getClass
().
getResource
(
"frostbolt.png"
)));
gold
=
new
Sprite
(
ImageIO
.
read
(
UsedForLoadingSprites
.
getInstance
().
getClass
().
getResource
(
"
GOLD
.png"
)));
gold
=
new
Sprite
(
ImageIO
.
read
(
UsedForLoadingSprites
.
getInstance
().
getClass
().
getResource
(
"
gold
.png"
)));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -82,5 +82,6 @@ public class SpriteStorage {
}
public
Sprite
getFrostbolt
(){
return
frostbolt
;
}
}
}
src/ingame_programming/IGPEntity.java
View file @
ff0221e7
...
...
@@ -84,7 +84,19 @@ public class IGPEntity extends AbstractEntity {
}
break
;
case
"soigner"
:
// This case is not implemented in the game, so "soigner" willl be considered as nothing by the IA
// This case is not implemented in the game, so "soigner" will be considered as "follow" by the IA
System
.
out
.
println
(
"Je suis"
+
victim
.
getName
());
int
dX4
=
victim
.
getX
();
int
dY4
=
victim
.
getY
();
int
sX4
=
relayer
.
getCharacter
().
getX
();
int
sY4
=
relayer
.
getCharacter
().
getY
();
Direction
dir4
=
AI
.
alpha_star
(
map
,
sX4
,
sY4
,
dX4
,
dY4
,
map
.
getWidth
(),
map
.
getHeight
());
if
(
relayer
.
getCharacter
().
getCollisionBox
().
intersect
(
victim
.
getCollisionBox
()))
{
this
.
relayer
.
move
(
Direction
.
NONE
);
}
else
{
this
.
relayer
.
move
(
dir4
);
}
break
;
default
:
// In the default case, so the aciton "nothing", the Follower will just follow his owner
Entity
owner
=
null
;
...
...
@@ -102,7 +114,7 @@ public class IGPEntity extends AbstractEntity {
this
.
relayer
.
move
(
Direction
.
NONE
);
}
else
{
this
.
relayer
.
move
(
dir3
);
}
this
.
relayer
.
move
(
dir3
);
}
}
}
}
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