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
4d24925c
Commit
4d24925c
authored
Aug 02, 2020
by
nargessalehi98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add setEnemy method.
parent
ebeb7583
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
GameFrame.java
src/GameFrame.java
+7
-0
No files found.
src/GameFrame.java
View file @
4d24925c
...
...
@@ -193,6 +193,7 @@ public class GameFrame extends JFrame {
g2d
.
setColor
(
Color
.
black
);
//g2d.drawImage(rotate(image1, state1.rotateAmount), state1.locX, state1.locY, null);
setTanks
(
3
,
g2d
,
state
,
state1
,
state2
);
setEnemy
(
g2d
);
setName
(
g2d
,
"narges"
,
"sara"
,
"bardia"
);
setMap
(
g2d
,
new
File
(
"map3.txt"
));
drawMap
(
g2d
);
...
...
@@ -239,6 +240,12 @@ public class GameFrame extends JFrame {
// g2d.drawImage(image5, 1050, 750, null);
}
public
void
setEnemy
(
Graphics2D
g2d
){
Tank
tank
=
new
Tank
(
"enemy.png"
);
taken
=
tank
.
getIcon
();
tanks
.
add
(
tank
);
g2d
.
drawImage
(
tank
.
getIcon
(),
200
,
200
,
null
);
}
public
void
setTanks
(
int
numOfPlayer
,
Graphics2D
g2d
,
GameState
state
,
GameState
state1
,
GameState
state2
)
{
//g2d.drawImage(background, 0, 0, null);
if
(
numOfPlayer
>
0
)
{
...
...
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