-
Notifications
You must be signed in to change notification settings - Fork 20
Side Panel
noooway edited this page Mar 12, 2017
·
20 revisions
- Background
local side_panel = {}
local position_x = 608
local width = 200
local height_top = 160
local height_middle = 288
local height_bottom = 160
local position_top = vector( position_x, 0 )
local position_middle = vector( position_x, height_top )
local position_bottom = vector( position_x, height_top + height_middle )
function side_panel.draw()
side_panel.draw_background()
.....
end
function side_panel.draw_background()
local drawtype = 'fill'
local r, g, b, a = love.graphics.getColor( )
-- top
love.graphics.setColor( 255, 102, 0, 255 )
love.graphics.rectangle("fill",
position_top.x,
position_top.y,
width,
height_top )
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.rectangle("line",
position_top.x,
position_top.y,
width,
height_top )
-- middle
love.graphics.setColor( 255, 127, 42, 255 )
love.graphics.rectangle("fill",
position_middle.x,
position_middle.y,
width,
height_middle )
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.rectangle("line",
position_middle.x,
position_middle.y,
width,
height_middle )
-- bottom
love.graphics.setColor( 255, 102, 0, 255 )
love.graphics.rectangle("fill",
position_bottom.x,
position_bottom.y,
width,
height_bottom )
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.rectangle("line",
position_bottom.x,
position_bottom.y,
width,
height_bottom )
love.graphics.setColor( r, g, b, a )
end
- Side panel as a container for "lives_display".
local lives_display = require "lives_display"
side_panel.lives_display = lives_display
function side_panel.update( dt )
side_panel.lives_display.update( dt )
end
function side_panel.draw()
side_panel.draw_background()
side_panel.lives_display.draw()
end
- Appropriate changes in "game".
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: