Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
A ket torony
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sabvente
A ket torony
Commits
ba912132
Commit
ba912132
authored
11 years ago
by
Sabvente
Browse files
Options
Downloads
Patches
Plain Diff
könnyebb legyett
parent
a08d8796
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/world/Enemy.java
+8
-11
8 additions, 11 deletions
src/world/Enemy.java
src/world/Tower.java
+4
-4
4 additions, 4 deletions
src/world/Tower.java
with
12 additions
and
15 deletions
src/world/Enemy.java
+
8
−
11
View file @
ba912132
...
...
@@ -23,10 +23,14 @@ public class Enemy extends Placeable implements ITickable {
moveTimes
.
put
(
EnemyType
.
ELF
,
2
);
moveTimes
.
put
(
EnemyType
.
HOBBIT
,
5
);
}
/**
*
* @param dmg
*/
public
Enemy
(
EnemyType
p_type
)
{
type
=
p_type
;
reset
();
prevField
=
null
;
hp
=
100
;
}
public
void
hurt
(
int
dmg
)
{
Random
rand
=
new
Random
();
...
...
@@ -87,13 +91,6 @@ public class Enemy extends Placeable implements ITickable {
return
moveTries
;
}
public
Enemy
(
EnemyType
p_type
)
{
type
=
p_type
;
reset
();
prevField
=
null
;
hp
=
100
;
}
public
void
tick
()
{
if
(
moveTimeLeft
<=
0
&&
hp
>
0
)
move
();
...
...
This diff is collapsed.
Click to expand it.
src/world/Tower.java
+
4
−
4
View file @
ba912132
...
...
@@ -37,10 +37,10 @@ public class Tower extends Placeable implements ITickable, IEnemyObserver,
public
Tower
()
{
damage
=
new
HashMap
<
EnemyType
,
Integer
>();
damage
.
put
(
EnemyType
.
HUMAN
,
2
0
);
damage
.
put
(
EnemyType
.
DWARF
,
2
0
);
damage
.
put
(
EnemyType
.
ELF
,
2
0
);
damage
.
put
(
EnemyType
.
HOBBIT
,
2
0
);
damage
.
put
(
EnemyType
.
HUMAN
,
3
0
);
damage
.
put
(
EnemyType
.
DWARF
,
3
0
);
damage
.
put
(
EnemyType
.
ELF
,
3
0
);
damage
.
put
(
EnemyType
.
HOBBIT
,
3
0
);
enemiesInRange
=
new
ArrayList
<
Enemy
>();
recoilTime
=
5
;
range
=
1
;
...
...
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