-
Notifications
You must be signed in to change notification settings - Fork 20
Bonus effects
noooway edited this page Mar 6, 2017
·
19 revisions
- Detect bonus-platform collision
function collisions.resolve_collisions( ball, platform,
walls, bricks, bonuses )
.....
collisions.platform_bonuses_collision( platform, bonuses, ball )
end
function collisions.platform_bonuses_collision( platform, bonuses, ball )
local overlap
local b = { x = platform.position.x,
y = platform.position.y,
width = platform.width,
height = platform.height }
for i, bonus in pairs( bonuses.current_level_bonuses ) do
local a = { x = bonus.position.x,
y = bonus.position.y,
width = 2 * bonuses.radius,
height = 2 * bonuses.radius }
overlap = collisions.check_rectangles_overlap( a, b )
if overlap then
bonuses.bonus_collected( i, bonus, ball, platform )
end
end
end
Feedback is crucial to improve the tutorial!
Let me know if you have any questions, critique, suggestions or just any other ideas.
Chapter 1: Prototype
- The Ball, The Brick, The Platform
- Game Objects as Lua Tables
- Bricks and Walls
- Detecting Collisions
- Resolving Collisions
- Levels
Appendix A: Storing Levels as Strings
Appendix B: Optimized Collision Detection (draft)
Chapter 2: General Code Structure
- Splitting Code into Several Files
- Loading Levels from Files
- Straightforward Gamestates
- Advanced Gamestates
- Basic Tiles
- Different Brick Types
- Basic Sound
- Game Over
Appendix C: Stricter Modules (draft)
Appendix D-1: Intro to Classes (draft)
Appendix D-2: Chapter 2 Using Classes.
Chapter 3 (deprecated): Details
- Improved Ball Rebounds
- Ball Launch From Platform (Two Objects Moving Together)
- Mouse Controls
- Spawning Bonuses
- Bonus Effects
- Glue Bonus
- Add New Ball Bonus
- Life and Next Level Bonuses
- Random Bonuses
- Menu Buttons
- Wall Tiles
- Side Panel
- Score
- Fonts
- More Sounds
- Final Screen
- Packaging
Appendix D: GUI Layouts
Appendix E: Love-release and Love.js
Beyond Programming: