Commit Graph

70 Commits

Author SHA1 Message Date
f70dc67878 Begin adding support for rendering different shaped bricks 2018-11-15 20:09:48 +04:00
64e00c1a1a Treat brick coordinates as their center 2018-11-15 18:19:54 +04:00
cb90c949ff New MINIMUM_ANGLE constant in Ball, currently PI/16
Apply impulses to ball when angle relative to horizontal axis is less
than MINIMUM_ANGLE. Prevents balls getting stuck going horizontally
2018-11-15 16:31:42 +04:00
998286de8d Ensure balls collide with the shield 2018-11-15 14:53:14 +04:00
9eac3353b6 Use instance bodies array 2018-11-15 14:48:32 +04:00
adebc42c16 Add Box2d collision filtering, allow collecting power ups with balls 2018-11-15 14:22:42 +04:00
74aa10de04 Refactor to use libGdx Array instead of java ArrayList
Render bricks with their box2d angle
Add ball density = 1f
2018-11-15 13:43:48 +04:00
b44b48097c Update paddle.update() to handle edge collision more nicely + cleaner code
Calculates an adjust variable which locates the paddle at exactly the
screen edge if a regular speed * dt move would put it past. Applies
the same adjust to stuck balls so they don't drift.
2018-11-15 12:24:33 +04:00
e4000998cc Complete box2d implementation, all collisions handled with box2d
Shield re-implemented as an entity with a box2d body
Multiball powerup now spawns balls at paddle instead of from block location
2018-11-15 10:34:22 +04:00
92201411b9 Refactor entity.PhysicsBody to physics.PhysicsBody
Create CollisionListener interface and Box2dContactListener
Register the Box2dContactListener with the box2d world
2018-11-14 22:26:02 +04:00
0994289c7e Begin box2d physics implementation.
Created box2d bodies for all game entities (except shield)
Scale units down to box2d friendly units (40:1 <-> pixels:box2d)
Use floats in places integers were used for position and sizing
2018-11-14 22:04:41 +04:00
b3cbe0cda5 Remove magic value 2018-11-13 19:01:14 +04:00
e2c0bad9e0 Altered powerup weights (decreased glue, increased multi ball)
Allow bricks to have their colour changed.
2018-11-13 18:58:55 +04:00
ea6240bd2c Add PowerUpType enum
Handles weighted random seletion, color and instantiation, cleaning up
other sections of Brick and PlayState code.
2018-11-13 18:42:27 +04:00
0abae880d3 Add MenuState, start with it and switch back when a game is finished 2018-11-13 17:58:42 +04:00
fa7e93953b Speed ball up 2018-11-13 17:21:23 +04:00
409735d94e Scale entity units to new board units.
Rename Brick.BLOCK_ to Brick.BRICK_
2018-11-13 17:17:19 +04:00
1fe82cb5b2 Change viewport to FitViewport, board height/width to 4K
Enable font anti-aliasing
2018-11-13 17:14:33 +04:00
a56d721050 Move away from using pixel coordinates to "board coordinates"
Changed aspect ratio from 4:3 to 9:16
2018-11-13 15:58:01 +04:00
1c7e20f8e9 Move any stuck balls along with paddle when shields get added/removed 2018-11-13 12:54:09 +04:00
7588a0986b Refactored to use states
Various other refactoring, no functional differences
2018-11-13 11:51:00 +04:00
3fad2085b6 Refactor power up chance to be a variable 2018-11-13 10:21:05 +04:00
70ece88a89 Allow shields to stack.
Refactor Ball.render to keep a local instance of BrickBuster
2018-11-12 21:46:02 +04:00
a199c82fd8 Fixed ball DEFAULT_SPEED being used when BOOST_SPEED should have been 2018-11-12 21:24:02 +04:00
c34610b3e3 Keep a global ShapeRenderer instance rather than an instance per entity 2018-11-12 21:22:16 +04:00
219622ff53 Add shield powerup 2018-11-12 21:11:40 +04:00
393b2fae58 Use a weighted random choice for powerup selection, 15% of power up 2018-11-12 20:39:59 +04:00
4694947a08 Added multi ball powerup 2018-11-12 19:15:24 +04:00
4a7c9215dd Use brick.hit() as a check for whether the brick should be removed. 2018-11-12 18:20:56 +04:00
e1c7fbb53f Move ball speed boost check to Brick's hit() method 2018-11-12 18:19:19 +04:00
1ee5a5a36c Allow ball to fall "out" of screen 2018-11-12 18:13:48 +04:00
83e270062b Refactor to support multiple balls 2018-11-12 18:12:42 +04:00
ed8c90be1a Add debug info to bottom left of screen 2018-11-12 17:15:27 +04:00
5e3f71f236 Replace snake_case to camelCase 2018-11-12 15:46:47 +04:00
d89a20134b Only check for paddle collision when ball position <= paddle height. 2018-11-12 11:50:50 +04:00
d3eb876960 Refactor powerups, move to new package. Decrease long paddle chance to 8% 2018-11-12 11:33:22 +04:00
88428fded9 Keep speed of ball when hitting sticky paddle 2018-11-12 11:18:26 +04:00
a736229c18 Only reset ball speed to default when launching normally 2018-11-12 11:08:09 +04:00
ac27cc5e90 Make sure paddle reaches screen edge 2018-11-12 11:07:04 +04:00
e8901d2ed4 Added longer paddle powerup, fixed issues with sticky paddle bouncing 2018-11-12 11:02:26 +04:00
1f9c2e6db0 Decrease chance of glue powerup dropping from 50% to 8%
Increase default ball speed to 350px/sec
Change paddle speed control to time-based, 375px/sec
2018-11-12 09:54:07 +04:00
3e0d4657f2 Add PowerUp logic + GluePowerUp 2018-11-12 09:28:12 +04:00
28e0ed27f3 Entity take float in constructor instead of int 2018-11-12 09:27:29 +04:00
353afe1cee Update velocity based on time delta 2018-11-11 21:53:18 +04:00
c5642f7050 Change rows of blocks from 10 to 7, increase height padding 2018-11-11 21:53:00 +04:00
711a5548ef Added speed boost after a certain amount of bricks remain
Reset board after all bricks are destroyed
2018-11-11 21:50:30 +04:00
78d0a72217 Rename ball -> new_pos
Fix paddle reset
2018-11-11 21:25:09 +04:00
659fde4622 Use a Vector2 to track entity position. 2018-11-11 20:56:58 +04:00
3feca300be Shrink ball, increase brick height, improve paddle collision, add brick collision 2018-11-11 20:42:25 +04:00
a0b0753c5e Remove redundant .nor() in nearestPoint() 2018-11-11 20:41:01 +04:00