Giter Club home page Giter Club logo

love2d-book's Introduction

LÖVE for Newbies

The collaborative book will be divided into three main units:

  1. A walkthrough to building a small prototype and introducing the user to the LÖVE framework,

  2. A more realistic revamp of the built prototype to create a "full" game, and lastly

  3. An area of examples and snippets containing best and known practices in game development.

The book s written using a generator called Asciidoctor.
Quick Reference: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/

We have extended the AsciiDoctor syntax with livecode blocks and block macros. There also are some other additions, you can use them like this:

livecode::test[] // (1)

livecode::test[name=test2] // (2)

[livecode,example] // (3)
++++
function love.draw()
    love.graphics.setColor( 255, 255, 0, 255 )
    love.graphics.rectangle( "fill", 10, 10, 100, 100 )
end
++++

code_example::world1/05_better-steering/rotation[] // (4)
code_example::world1/05_better-steering/rotation[exclude="lib/*,maps/*",include="**/*.lua,**/*.txt"] // (5)

wiki:love.graphics.setColor[] // (6)
wiki:love.graphics[the graphics module] // (7)
  1. loads love2D-book-code/test directory

  2. load love2D-book/code/test directory. It’s name is test2 so it doesn’t conflict with the first.

  3. runs the code below it; has the name of "example"

  4. shows all .lua files from the specified directory, except those in lib/

  5. shows all .lua and .txt files from the specified directory, except those in lib/ and maps/

  6. links to the wiki page for love.graphics.setColor and formats the link accordingly

  7. links to the wiki page for love.graphics using the text the graphics

Contributions

Prerequisites

You will need ruby and bundler to be installed for rendering the book.

With ruby set up, you can install bundler like so:

$ gem install bundle

then install the dependencies:

$ bundle install

Rendering

To render the ebook and pdf you can run render.sh:

$ ./render.sh

but the preferred way to work on the project is by running Guard:

$ bundle exec guard

this will automatically render the HTML ebook as you change the files. You can use any LiveReload extension in a browser to have it automaically refresh as you modify the book.

Committing

Whenever a significant portion of the book has changed and is ready for release, stage the files on master and run release.sh. Make sure that book/code is at the correct revision and staged before releasing.

Style Guidelines

  • The three chapters are called Worlds and each section is a Level

  • At the end of every Level, remind the reader about what he has learned in this chapter

  • Use examples and concrete language wherever possible.

  • Programming is all about abstraction, and examples help make this a lighter and more enjoyable read

  • Make everything interesting to read about and motivate the reader to keep on learning

  • Be clear and direct when talking something new. Keep it simple, stupid!

  • Every Level ends with additional exercises that the reader can choose to try

  • Give “Pro Tips” and “Watch out!”-notices where fitting (Admonitions)

  • Use informal language and short text to show new content

  • Keep lines shorter than 125 characters (soft rule, better have a slightly longer line than wrap two words)

  • One sentence per line

  • If sentences need to be wrapped due to length, try to wrap at a comma to keep the source readable

  • Use the code repository for examples that readers may want to try out or modify, use inline livecode for minor changes and demos

  • Style lists with *, don’t end items with .

  • Use wiki block macros when discussing LÖVE functions and concepts (wiki:love.graphics.print[print] → wiki:love.graphics.print[print])

  • Use backticks when mentioning Lua values ("string""string")

  • Link to sections you reference (<<world1-2, last Level>>lastLevel)

  • Show relevant portions of source code before livecode displays, use callouts (<1>) to discuss source code

Thank you for helping create this :)

love2d-book's People

Contributors

desk467 avatar gitter-badger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.