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
1b9e5287
Commit
1b9e5287
authored
8 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
implemented explosive ball
parent
d142c558
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/de/bricked/game/board/Board.java
+16
-3
16 additions, 3 deletions
src/de/bricked/game/board/Board.java
src/de/bricked/ui/LevelController.java
+2
-2
2 additions, 2 deletions
src/de/bricked/ui/LevelController.java
with
18 additions
and
5 deletions
src/de/bricked/game/board/Board.java
+
16
−
3
View file @
1b9e5287
...
...
@@ -2,6 +2,8 @@ package de.bricked.game.board;
import
java.util.ArrayList
;
import
de.bricked.game.balls.Ball
;
import
de.bricked.game.balls.BallType
;
import
de.bricked.game.bricks.Brick
;
import
de.bricked.game.bricks.BrickType
;
import
de.bricked.game.levels.Level
;
...
...
@@ -151,11 +153,22 @@ public class Board
return
HEIGHT
;
}
public
int
hitBrick
(
int
row
,
int
col
,
boolean
instantDestroy
)
public
int
hitBrick
(
int
row
,
int
col
,
Ball
ball
)
{
points
=
0
;
destroyBrick
(
row
,
col
,
instantDestroy
);
if
(
ball
.
getType
().
equals
(
BallType
.
EXPLOSIVE
))
{
Brick
currentBrick
=
bricks
.
get
(
row
).
get
(
col
);
if
(
currentBrick
.
getPowerUp
()
!=
null
)
{
//TODO deploy PowerUp
}
bricks
.
get
(
row
).
set
(
col
,
new
Brick
(
BrickType
.
TNT
));
}
destroyBrick
(
row
,
col
,
false
);
return
points
;
}
...
...
This diff is collapsed.
Click to expand it.
src/de/bricked/ui/LevelController.java
+
2
−
2
View file @
1b9e5287
...
...
@@ -607,7 +607,7 @@ public class LevelController
{
anchorPaneGame
.
getChildren
().
remove
(
stackPaneBall
);
game
.
setBall
(
new
Ball
(
BallType
.
NO_COLLISION
));
game
.
setBall
(
new
Ball
(
BallType
.
EXPLOSIVE
));
// create circle for ball
final
Circle
circle
=
new
Circle
(
game
.
getBall
().
getBallRadius
(),
Color
.
web
(
game
.
getBall
().
getType
().
getColor
()));
...
...
@@ -661,7 +661,7 @@ public class LevelController
correctBallPosition
(
hitLocation
,
ballPosition
,
brickPosition
,
stackPaneBrick
.
getWidth
(),
stackPaneBrick
.
getHeight
());
game
.
setPoints
(
game
.
getPoints
()
+
game
.
getBoard
().
hitBrick
(
i
,
k
,
false
));
game
.
setPoints
(
game
.
getPoints
()
+
game
.
getBoard
().
hitBrick
(
i
,
k
,
game
.
getBall
()
));
labelPoints
.
setText
(
String
.
valueOf
(
game
.
getPoints
()));
labelBlocksRemaining
.
setText
(
game
.
getBoard
().
getNumberOfRemainingBricks
()
+
" Bricks remaining"
);
...
...
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