-
Notifications
You must be signed in to change notification settings - Fork 17
Home
This tutorial describes how to write a more or less full-featured Arkanoid (Breakout) clone.
Here are several screenshots from various stages of the development process:
The intended audience are people, who have basic programming experience, but have trouble structuring their code for projects bigger than "Hello World". An Arkanoid, while simple, contains many elements found in more elaborate games. My aim is to introduce a typical code structure, and to provide a starting point for further modifications.
Lua programming language and LÖVE framework are used. Basic programming experience is assumed. Familiarity with Lua and LÖVE is beneficial but not necessary. Some non-obvious Lua idioms are briefly explained.
The code can be downloaded using git
cd /your-path/
git clone https://github.com/noooway/love2d_arkanoid_tutorial
or by Github's "Clone or download -> Download ZIP" button.
Each step can be run with the LÖVE interpreter by issuing a love
command followed by the folder name, for example
cd /your-path/love2d_arkanoid_tutorial
love 1-01_TheBallTheBrickThePlatform
Chapter 1 describes how to build a prototype for an Arkanoid-type game in the most straightforward way, without relying too much on any external libraries or advanced language features.
Chapter 2 expands the prototype, introducing gamestates, basic graphics and sound. At the end of this chapter, the general frame of the game is complete. What is left is to fill it with the details.
Chapter 3 proceeds to add functionality to achieve a full-featured game. While the first two chapters are rather general, material in this chapter is mostly specific for Arkanoid-type games.
Appendices - which are not written yet :) - demonstrate some additional topics, such as how to use environments to define Lua modules, classes, and so on.
I realize that the length of the tutorial - almost 30 parts - is probably a bit too much. On the other hand, the amount of work necessary to write a game is commonly underestimated and this tutorial clearly shows what it actually takes to develop even a simple one.
One last thing before we start: feedback is crucial. If you have any critique, suggestions, improvements or just any other ideas, please let me know.
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 B: Stricter Modules
Appendix C-1: Intro to Classes
Appendix C-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
Beyond Programming:
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: