Before the workshop begin, you must install Lua and LÖVE2d
------- On Debian, Ubuntu & Mint -------
> sudo apt install lua5.4
------- On Fedora Linux -------
> sudo dnf install lua
Check if the installation is complete by using this command :
> lua -v
------ On Debian, Ubuntu & Mint ------
> sudo apt-get install love
------ On Fedora Linux ------
> sudo yum install love
If you need it here's the documentation for LOVE
Check if the installation is complete by using one of this commands (the second is funnier) :
> love --version
> love
You are going to write you first ever program in Lua
- Find a way to create a window in lua
- this window must be named "casse-brique" and must have the following dimenssions (480; 640)
Your window should look like something lile this :
A Brick breaker need a bar
- Find a way to create a rectangle and to draw it the previous window
- Your bar must follow the following requirement:
- Height = 17
- Width = 120
- It must be at 64 pixel above the botom of your window
- It must be centered
- The bar must be movable by the user using the array of your keyboard, the bar should move all the way to the left or the right of the window
Your window with the bar should look something like this:
Now that you have a movable bar you need some brick.
- Make 7 lines of brick with 6 brick per lines
- A brick is 75 width, 18 height
- The line first line must be separate by from the top of the window by 5
Your Window should look like this:
- Your ball will look like a square with a side of 14
- Your ball must have a fix absolute speed bettween the 2 axis
- Your ball must colide with your bar, your brick, the side of your window and the bottom of your window
- when the ball colide with a brick, the brick must be destroyed
Your window should look like this:
use this png to represented your life
- Put 3 hearth at the botom left of the window
- Now when your ball collision with the bottom of your screen one of your hearth disapere
- And When you loose all your hearth draw a loose screen
- When you destroy all the brick you draw a win screen
You now have a game the replicate the comportement of a Brickbreacker like this: