Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
Tutorials

Tutorial series on making Arkanoid-type game with Lua and Love2d

noway
Sunday, May 21, 2017 - 07:58

Hey!

I have been writing a tutorial series on making a small Arkanoid-type game using LÖVE framework. I think, it has reached a point where I can announce it to a wider audience.

The LÖVE framework uses Lua language and it is geared towards 2d games. It is cross-platform, running on major desktop and mobile operating systems, and on the web. LÖVE is simple and intuitive; glancing over this short article is enough to understand it's basic principles of operation. Another advantage is that it is free and open-source. Some example games can be found here.

The tutorial is intended for 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 goal is to introduce a typical code structure, and to provide a starting point for further modifications.

Here is a couple of screenshots:

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.

(follow the links for screenshots).

  1. The Ball, The Brick, The Platform
  2. Bricks and Walls
  3. Detecting Collisions
  4. Resolving Collisions
  5. Levels

         Appendix A: Storing Levels as Strings

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.

  1. Splitting Code into Several Files
  2. Loading Levels from Files
  3. Straightforward Gamestates
  4. Advanced Gamestates
  5. Basic Tiles
  6. Different Brick Types
  7. Basic Sound
  8. Game Over

 

Chapter 3 proceeds to add functionality to achieve a full-featured game. While the code for this chapter works and available in the repository, some minor corrections are required. Overall, this chapter is currently in a draft stage, and the finished parts can be found on the github.

My current plans are to finish the third chapter and then to update the graphics and the sound. Any feedback is appreciated.

  • Log in or register to post comments
Spring Spring
joined 8 years 11 months ago
Sunday, May 21, 2017 - 12:54
Spring Spring's picture

Seems pretty simple, even I could code something like that. And your tutorial is well-written, too. :)

 

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Monday, May 22, 2017 - 08:41

Seems pretty simple, even I could code something like that. And your tutorial is well-written, too. :)

Thanks!

  • Log in or register to post comments
nosycat
joined 13 years 7 months ago
Wednesday, May 24, 2017 - 05:44
nosycat's picture

I added your tutorial to my big list of knowledge bases. I like the way it's structured, though sometimes it seems to tumble forward very fast, with lots of code and few explanations. But then, that should appeal to more impatient readers. Good work!

  • Log in or register to post comments
Spring Spring
joined 8 years 11 months ago
Wednesday, May 24, 2017 - 05:53
Spring Spring's picture

I'd say it has a nice pacing, but then again I am a terribly impatient person.

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Wednesday, May 24, 2017 - 07:52

I like the way it's structured, though sometimes it seems to tumble forward very fast, with lots of code and few explanations

I'm open to discussion and suggestions. If you point out, where exactly it rushes forward and what exactly is unclear, I can try to fix that.

  • Log in or register to post comments
nosycat
joined 13 years 7 months ago
Wednesday, May 24, 2017 - 09:09
nosycat's picture

Oh, I'm not saying it's bad. As someone else pointed out, people are different, and this tutorial caters to a certain type of reader. Besides, I'd have to try and follow it, which doesn't mesh with my plans right now. :P

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Thursday, May 25, 2017 - 11:53

Oh, I'm not saying it's bad. As someone else pointed out, people are different, and this tutorial caters to a certain type of reader. Besides, I'd have to try and follow it, which doesn't mesh with my plans right now. :P

Ok. If there are any specific suggestions, please let me know.

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Sunday, May 28, 2017 - 11:00

I haven't announced the contents of the third chapter, so here it is.

1. Better Ball Rebounds
2. Ball Launch From Platform (Two Objects Moving Together)
3. Mouse Controls
4. Spawning Bonuses
5. Bonus Effects
6. Glue Bonus
7. Add New Ball Bonus
8. Life and Next Level Bonuses
9. Random Bonuses
10. Menu Buttons
11. Wall Tiles
12. Side Panel (draft) 
13. Score (draft)
14. Fonts (draft)
15. More Sounds (draft)
16. Final Screen (draft)
17. Packaging and Distribution (draft)

While it is moslty concerned with Arkanoid-specific details, some topics can be applied to other types of the games.

For example, the sections on Random Bonuses, Menu Buttons, and Wall Tiles have been updated recently.

 

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Tuesday, June 6, 2017 - 07:51

Several updates in the wiki: Side Panel, Score, Fonts, More Sounds

yvDrs5F.png?1 DgDh1fq.png?1

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Sunday, July 2, 2017 - 00:57

I've finished the last 2 parts of the tutorial: credits screen and packaging.

kRt7M5J.png?1

All in all I don't like how the Chapter 3 has turned out.
My initial idea has been to discuss typical problems arising in game programming on real-life examples.
However, most of the code in Chapter 3 has become too specific for this Arkanoid and hardly can be transferred to any other project.
Besides, technical details of the specific implementation obscure the general ideas.
I think, instead of describing a step by step code evolution, a better approach would be to restructure the Chapter 3 into a series of loosely related articles grouped by a common subject. For example, a group on visual effects with articles on postprocessing, particle effects, etc. Basically, topics currently placed in appendicies should become the main material for this chapter.

This will require a lot of work that I currently don't want to deal with.
Instead I would like to concentrate on making a small but well-polished, publishable quality, game.
As one of the first steps, this will require to find an artist and a sound designer.

Regarding the tutorial, the plan is following:
1) Update the Chapters 1 and 2.
2) Find a native speaker to get help with the text proofreading.
3) Restructure the Chapter 3 into a series of "additional topics".

  • Log in or register to post comments
andrewj
joined 12 years 12 months ago
Monday, July 3, 2017 - 06:45

I have found this tutorial really useful, thanks for making it :)

  • Log in or register to post comments
noway
joined 14 years 3 months ago
Wednesday, July 5, 2017 - 00:44

I have found this tutorial really useful, thanks for making it :)

Thanks! Glad to hear this!

  • Log in or register to post comments