Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bricked
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
Robert Goldmann
Bricked
Commits
52312b4e
Commit
52312b4e
authored
Oct 29, 2016
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
started implementing multiplicator display
parent
b0234f81
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/de/bricked/ui/LevelGUI.fxml
+1
-6
1 addition, 6 deletions
bin/de/bricked/ui/LevelGUI.fxml
src/de/bricked/ui/LevelController.java
+52
-15
52 additions, 15 deletions
src/de/bricked/ui/LevelController.java
src/de/bricked/ui/LevelGUI.fxml
+1
-6
1 addition, 6 deletions
src/de/bricked/ui/LevelGUI.fxml
with
54 additions
and
27 deletions
bin/de/bricked/ui/LevelGUI.fxml
+
1
−
6
View file @
52312b4e
...
...
@@ -57,16 +57,11 @@
</Label>
</children>
</HBox>
<VBox
fx:id=
"vboxLives"
layoutX=
"745.0"
layoutY=
"603.0"
minHeight=
"71.0"
minWidth=
"40.0"
prefHeight=
"
183
.0"
prefWidth=
"40.0"
AnchorPane.bottomAnchor=
"24.0"
AnchorPane.rightAnchor=
"15.0"
/>
<VBox
fx:id=
"vboxLives"
layoutX=
"745.0"
layoutY=
"603.0"
minHeight=
"71.0"
minWidth=
"40.0"
prefHeight=
"
227
.0"
prefWidth=
"40.0"
AnchorPane.bottomAnchor=
"24.0"
AnchorPane.rightAnchor=
"15.0"
/>
<Label
fx:id=
"labelFPS"
layoutX=
"770.0"
layoutY=
"6.0"
text=
"0"
AnchorPane.rightAnchor=
"8.0"
AnchorPane.topAnchor=
"8.0"
>
<font>
<Font
name=
"System Bold"
size=
"16.0"
/>
</font>
</Label>
<Label
fx:id=
"labelMultiplicator"
alignment=
"CENTER_RIGHT"
layoutX=
"736.0"
layoutY=
"543.0"
prefHeight=
"30.0"
prefWidth=
"49.0"
text=
"x0"
textAlignment=
"JUSTIFY"
AnchorPane.rightAnchor=
"18.0"
AnchorPane.topAnchor=
"543.0"
>
<font>
<Font
name=
"System Bold"
size=
"20.0"
/>
</font>
</Label>
</children>
</AnchorPane>
This diff is collapsed.
Click to expand it.
src/de/bricked/ui/LevelController.java
+
52
−
15
View file @
52312b4e
...
...
@@ -70,7 +70,6 @@ public class LevelController
@FXML
private
VBox
vboxPowerUps
;
@FXML
private
VBox
vboxLives
;
@FXML
private
Label
labelFPS
;
@FXML
private
Label
labelMultiplicator
;
public
Stage
stage
;
public
Image
icon
=
new
Image
(
"de/bricked/resources/icon.png"
);
...
...
@@ -632,7 +631,6 @@ public class LevelController
game
.
applyMultiplicator
();
game
.
resetMultiplicator
();
game
.
resetPointsSinceLastMultiplicatorReset
();
labelMultiplicator
.
setText
(
"x0"
);
labelPoints
.
setText
(
String
.
valueOf
(
game
.
getTotalPoints
()));
}
...
...
@@ -640,7 +638,46 @@ public class LevelController
{
game
.
increaseMultiplicator
();
game
.
increasePointsSinceLastMultiplicatorReset
(
points
);
labelMultiplicator
.
setText
(
"x"
+
game
.
getMultiplicator
());
if
(
game
.
getMultiplicator
()
>
1
)
{
double
xPosition
=
(
gamePaneWidth
/
Board
.
WIDTH
)
*
(
7
);
double
yPosition
=
(
gamePaneHeight
/
Board
.
HEIGHT
)
*
(
20
);
Label
labelNotification
=
new
Label
(
"x"
+
game
.
getMultiplicator
());
labelNotification
.
setTranslateX
(
xPosition
);
labelNotification
.
setTranslateY
(
yPosition
);
labelNotification
.
setStyle
(
"-fx-font-weight: bold; -fx-font-size: 30; "
);
labelNotification
.
setAlignment
(
Pos
.
CENTER
);
labelNotification
.
setPrefWidth
((
gamePaneWidth
/
Board
.
WIDTH
)
*
3
);
labelNotification
.
setPrefHeight
((
gamePaneHeight
/
Board
.
HEIGHT
)
*
2
);
anchorPaneGame
.
getChildren
().
add
(
labelNotification
);
FadeTransition
fadeTransition
=
new
FadeTransition
(
Duration
.
millis
(
800
),
labelNotification
);
fadeTransition
.
setFromValue
(
1.0
);
fadeTransition
.
setToValue
(
0.0
);
fadeTransition
.
setCycleCount
(
1
);
fadeTransition
.
setAutoReverse
(
false
);
TranslateTransition
translateTransition
=
new
TranslateTransition
(
Duration
.
millis
(
800
),
labelNotification
);
translateTransition
.
setFromY
(
yPosition
);
translateTransition
.
setToY
(
yPosition
-
(
gamePaneHeight
/
Board
.
HEIGHT
)
*
3
);
translateTransition
.
setCycleCount
(
1
);
translateTransition
.
setAutoReverse
(
false
);
ParallelTransition
parallelTransition
=
new
ParallelTransition
();
parallelTransition
.
getChildren
().
addAll
(
fadeTransition
,
translateTransition
);
parallelTransition
.
setCycleCount
(
1
);
parallelTransition
.
setOnFinished
(
new
EventHandler
<
ActionEvent
>()
{
@Override
public
void
handle
(
ActionEvent
event
)
{
anchorPaneGame
.
getChildren
().
remove
(
labelNotification
);
}
});
parallelTransition
.
play
();
}
}
private
void
movePaddleLeft
()
...
...
This diff is collapsed.
Click to expand it.
src/de/bricked/ui/LevelGUI.fxml
+
1
−
6
View file @
52312b4e
...
...
@@ -57,16 +57,11 @@
</Label>
</children>
</HBox>
<VBox
fx:id=
"vboxLives"
layoutX=
"745.0"
layoutY=
"603.0"
minHeight=
"71.0"
minWidth=
"40.0"
prefHeight=
"
183
.0"
prefWidth=
"40.0"
AnchorPane.bottomAnchor=
"24.0"
AnchorPane.rightAnchor=
"15.0"
/>
<VBox
fx:id=
"vboxLives"
layoutX=
"745.0"
layoutY=
"603.0"
minHeight=
"71.0"
minWidth=
"40.0"
prefHeight=
"
227
.0"
prefWidth=
"40.0"
AnchorPane.bottomAnchor=
"24.0"
AnchorPane.rightAnchor=
"15.0"
/>
<Label
fx:id=
"labelFPS"
layoutX=
"770.0"
layoutY=
"6.0"
text=
"0"
AnchorPane.rightAnchor=
"8.0"
AnchorPane.topAnchor=
"8.0"
>
<font>
<Font
name=
"System Bold"
size=
"16.0"
/>
</font>
</Label>
<Label
fx:id=
"labelMultiplicator"
alignment=
"CENTER_RIGHT"
layoutX=
"736.0"
layoutY=
"543.0"
prefHeight=
"30.0"
prefWidth=
"49.0"
text=
"x0"
textAlignment=
"JUSTIFY"
AnchorPane.rightAnchor=
"18.0"
AnchorPane.topAnchor=
"543.0"
>
<font>
<Font
name=
"System Bold"
size=
"20.0"
/>
</font>
</Label>
</children>
</AnchorPane>
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