Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
JTankTrouble
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9831111
JTankTrouble
Commits
ebeb7583
Commit
ebeb7583
authored
Aug 02, 2020
by
nargessalehi98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add prize field for tank.
parent
4ee7bef3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
Tank.java
src/Tank.java
+17
-10
No files found.
src/Tank.java
View file @
ebeb7583
...
...
@@ -12,30 +12,37 @@ public class Tank {
BufferedImage
icon
;
Bullets
bullets
;
GameState
state
;
String
prize
;
int
Health
;
Prize
prize
;
public
Tank
(
String
path
){
Health
=
100
;
public
String
getPrize
()
{
return
prize
;
}
public
void
setPrize
(
String
prize
)
{
this
.
prize
=
prize
;
}
public
Tank
(
String
path
)
{
Health
=
100
;
try
{
icon
=
ImageIO
.
read
(
new
File
(
path
));
}
catch
(
IOException
e
){
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"File not found "
);
}
bullets
=
new
Bullets
();
bullets
=
new
Bullets
();
}
public
BufferedImage
getIcon
(){
public
BufferedImage
getIcon
()
{
return
icon
;
}
public
int
getX
(){
public
int
getX
()
{
return
x
;
}
public
int
getY
(){
public
int
getY
()
{
return
y
;
}
...
...
@@ -56,6 +63,6 @@ public class Tank {
}
public
void
setHealth
(
int
healthDamage
)
{
Health
=
Health
-
healthDamage
;
Health
=
Health
-
healthDamage
;
}
}
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