# Lack of Tutorials!

**URL:** <https://forum.defold.com/t/lack-of-tutorials/64437>\
**Category:** Questions\
**Created:** [February 12, 2020, 11:28pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437 "2020-02-12T23:28:55Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 12, 2020, 11:28pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/1 "2020-02-12T23:28:55Z")

</div>

Yeah i have noticed a lack of tutorials on subjects i need help with…Making an Inventory system, random loot drops from killed mobs, random level generation…Just to name a few…any help on this would be great!

---

<div class="post-metadata">

**Author:** ![Anthroyd](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/anthroyd/32/19574_2.png) [@Anthroyd](https://forum.defold.com/u/Anthroyd)\
**Post date:** [February 13, 2020, 4:37am UTC](https://forum.defold.com/t/lack-of-tutorials/64437/2 "2020-02-13T04:37:10Z")

</div>

It sounds like you don’t have much experience using the engine. It would be a good idea to start with Defold’s built-in tutorials, then try making something of your own from there.

Once you have a specific task you’re trying to accomplish, try coming up with ways to implement it yourself. If you still need help, try asking about one topic at a time here on the forums.

---

<div class="post-metadata">

**Author:** ![Jerakin](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jerakin/32/3997_2.png) [@Jerakin](https://forum.defold.com/u/Jerakin)\
**Post date:** [February 13, 2020, 9:34am UTC](https://forum.defold.com/t/lack-of-tutorials/64437/3 "2020-02-13T09:34:31Z")

</div>

Additionally to what Anthoryd said; What you are asking for are not _Tutorials for Defold_ but guides on how to create very specific systems, which tend to be highly game specific. There are a lot of these guides out there already and many of them are language agnostic (they might be made for Unity but if you simply change the syntax of the language you could still use it for a Defold game). With that said I do not think that is a good way to learn, you would only learn how to implement one type of system in one particular way. It is better to learn the _programming patterns_ and _language features_ that the system is using which you can then use when creating any of the systems.

* * *

To illustrate my point, I could have a simple game that only have a few different items. In that case a system for getting random loot from a killed mob could be as simple as the example below, is complete tutorial really needed for that?

```lua
-- Monster.script
local all_loot = {"sword", "shield", "gold", "dagger"}

local function on_death()
  --do a bunch of stuff with your monster
  award_loot()
end

local function award_loot()
  local loot = all_loot[math.random(#all_loot)]
  msg.post("player", "gained_loot", {loot=loot})
end

```

But this example would never do in a bigger game or even in a small RPG and the same can be said for any of the systems you mentioned. The implementation of the systems can vary a lot. With this in mind you shouldn’t search for _“random monster loot drop tutorial”_ but instead you should **break down the system you want to create into smaller parts.** In this case it could be as simple as _“get a random item in a list”_ but it could also be more steps like: Reading a data file from disk, storing data to disk, drop rate probability, get random item in list and so on. You can then start to build your system up and if you get stuck you can search for that smaller part.

You wouldn’t build a house before you know how to make a wall. The first part is to figure out how to build a wall.

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [February 13, 2020, 9:59am UTC](https://forum.defold.com/t/lack-of-tutorials/64437/4 "2020-02-13T09:59:12Z")

</div>

Once you’re done with the built-in Tutorials, I would suggest looking at @benjames171 github games.

> **[GitHub - benjames-171/defold-games: Collection of 2D games made with Defold](https://github.com/benjames-171/defold-games)**
>
> Collection of 2D games made with Defold

[https://www.youtube.com/user/defoldvideos/videos](https://www.youtube.com/user/defoldvideos/videos)

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 13, 2020, 9:16pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/5 "2020-02-13T21:16:44Z")

</div>

I am learning lua but the problem is the code is different from what i am learning like the local function called award\_loot…that is no where in the lua learning tutorials and book i have…So this is confusing to me!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 13, 2020, 9:48pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/6 "2020-02-13T21:48:22Z")

</div>

> [@walkerzed1](#):
>
> the code is different from what i am learning like the local function

It is recommended that you use local functions and variables whenever you can to avoid unforeseen problems and side effects of globals. The local keyword is explained in the official documentation:

> **[Programming in Lua : 4.2](https://www.lua.org/pil/4.2.html)**

> **[2.4.7 – Local Declarations - Lua 5.1 Reference Manual](https://www.lua.org/manual/5.1/manual.html#2.4.7)**
>
> Local variables can be declared anywhere inside a block. The declaration can include an initial assignment:

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 13, 2020, 9:49pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/7 "2020-02-13T21:49:58Z")

</div>

i understand that but what i dont understand if the use of award\_loot() dont see that anywhere in my lua learning book or even on any tutorials!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 13, 2020, 9:51pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/8 "2020-02-13T21:51:44Z")

</div>

> [@walkerzed1](#):
>
> what i dont understand if the use of award\_loot()

I don’t understand what you mean? award\_loot() is a user declared function.

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 13, 2020, 9:53pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/9 "2020-02-13T21:53:05Z")

</div>

What im learning from my books does not describe user functions or i have not made it that far into the book yet…I have no clue yet how to utilize user functions…Sorry if i am confusing anyone!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 13, 2020, 10:08pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/10 "2020-02-13T22:08:04Z")

</div>

> [@walkerzed1](#):
>
> What im learning from my books does not describe user functions or i have not made it that far into the book yet…I have no clue yet how to utilize user functions…Sorry if i am confusing anyone!

Ok, well, being able to create your own functions to reuse pieces of logic and create complex logic from small pieces is a key learning in most programming languages. I assume the book you are reading will cover this.

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 13, 2020, 10:12pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/11 "2020-02-13T22:12:21Z")

</div>

Learning to program in lua current edition is what im reading…So any help on learning more would be great!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 13, 2020, 10:13pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/12 "2020-02-13T22:13:14Z")

</div>

> [@walkerzed1](#):
>
> So any help on learning more would be great!

That is a good book. Do you have any prior experience of programming languages?

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 13, 2020, 11:14pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/13 "2020-02-13T23:14:25Z")

</div>

No i have no prior exp of programming…I asked around and some folks said lua is great for beginners! Picked up the book and started reading!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 14, 2020, 4:25am UTC](https://forum.defold.com/t/lack-of-tutorials/64437/14 "2020-02-14T04:25:43Z")

</div>

> [@walkerzed1](#):
>
> I asked around and some folks said lua is great for beginners! Picked up the book and started reading!

Yes, Lua, python and some others are good language for beginners. But since it is your first language you need to be prepared that it is going to take some time. Good luck though!

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 14, 2020, 1:49pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/15 "2020-02-14T13:49:12Z")

</div>

Trying my best to learn but due to learning disabilities its harder for me to learn…im watching this series and need to know if it will help me in my learning and being able to use defold! [https://www.youtube.com/playlist?list=PLxgtJR7f0RBKGid7F2dfv7qc-xWwSee2O](https://www.youtube.com/playlist?list=PLxgtJR7f0RBKGid7F2dfv7qc-xWwSee2O)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 14, 2020, 2:33pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/16 "2020-02-14T14:33:42Z")

</div>

> [@walkerzed1](#):
>
> need to know if it will help me in my learning and being able to use defold!

Yes that will help a lot

---

<div class="post-metadata">

**Author:** ![walkerzed1](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/walkerzed1/32/19681_2.png) [@walkerzed1](https://forum.defold.com/u/walkerzed1)\
**Post date:** [February 14, 2020, 2:56pm UTC](https://forum.defold.com/t/lack-of-tutorials/64437/17 "2020-02-14T14:56:20Z")

</div>

Thank you so much for your help and patients and understanding. Hope i can make my game a reality!
