Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Input szoftver projekt laboratorium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
aaendru
Input szoftver projekt laboratorium
Commits
fc6fddc3
Commit
fc6fddc3
authored
May 2, 2020
by
bettinasmid
Browse files
Options
Downloads
Patches
Plain Diff
kevesebb luk, nagyobb pálya a tárgyak miatt
parent
5b92c2cc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Arctic_Nigthmare/src/arctic_nightmare/Board.java
+11
-2
11 additions, 2 deletions
Arctic_Nigthmare/src/arctic_nightmare/Board.java
Arctic_Nigthmare/src/arctic_nightmare/GameWindow.java
+1
-1
1 addition, 1 deletion
Arctic_Nigthmare/src/arctic_nightmare/GameWindow.java
with
12 additions
and
3 deletions
Arctic_Nigthmare/src/arctic_nightmare/Board.java
+
11
−
2
View file @
fc6fddc3
...
...
@@ -23,6 +23,7 @@ public class Board {
public
Board
(
int
field_num
,
int
column_num
,
int
player_num
)
{
fields
=
new
ArrayList
<
Field
>();
int
holesOnBoard
=
0
;
ArrayList
<
Item
>
essentials
=
new
ArrayList
<
Item
>();
essentials
.
add
(
new
Item
(
"Pistol"
));
essentials
.
add
(
new
Item
(
"Flare"
));
essentials
.
add
(
new
Item
(
"Cartridge"
));
ArrayList
<
Item
>
otheritems
=
new
ArrayList
<
Item
>();
...
...
@@ -32,8 +33,16 @@ public class Board {
for
(
int
i
=
0
;
i
<
field_num
;
++
i
)
{
if
(
i
%
2
==
0
)
fields
.
add
(
new
StableField
(
rnd
.
nextInt
(
5
),
(
Item
)
null
));
else
fields
.
add
(
new
UnstableField
(
rnd
.
nextInt
(
5
),
rnd
.
nextInt
(
player_num
),(
Item
)
null
));
else
{
if
(
holesOnBoard
==
2
)
//so that there won't be too much holes
fields
.
add
(
new
UnstableField
(
rnd
.
nextInt
(
5
),
rnd
.
nextInt
(
player_num
-
1
)+
1
,(
Item
)
null
));
else
{
UnstableField
uf
=
new
UnstableField
(
rnd
.
nextInt
(
5
),
rnd
.
nextInt
(
player_num
),(
Item
)
null
);
fields
.
add
(
uf
);
if
(
uf
.
getCapacity
()
==
0
)
holesOnBoard
++;
}
}
}
//place essential objects on stable fields
while
(
essentials
.
size
()
!=
0
){
...
...
This diff is collapsed.
Click to expand it.
Arctic_Nigthmare/src/arctic_nightmare/GameWindow.java
+
1
−
1
View file @
fc6fddc3
...
...
@@ -183,7 +183,7 @@ public class GameWindow extends JFrame{
UIManager
UI
=
new
UIManager
();
UI
.
put
(
"OptionPane.background"
,
new
Color
(
255
,
255
,
255
));
UI
.
put
(
"Panel.background"
,
Color
.
white
);
String
[]
size
=
{
"3"
,
"4"
,
"5"
,
"6"
,
"7"
};
String
[]
size
=
{
"4"
,
"5"
,
"6"
,
"7"
};
String
[]
players
=
{
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
String
[]
difficulty
=
{
"CakeWalk"
,
"Saturdy afternoon"
,
"Sure?"
,
"You are kidding!"
,
"White hell"
};
JComboBox
<
String
>
combo
=
new
JComboBox
<>(
size
);
...
...
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