<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: JDBC</title>
    <description>The latest articles on DEV Community by JDBC (@jdbcdev).</description>
    <link>https://dev.to/jdbcdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F669266%2Fcb670424-183f-4467-8b10-025705906c6c.png</url>
      <title>DEV Community: JDBC</title>
      <link>https://dev.to/jdbcdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jdbcdev"/>
    <language>en</language>
    <item>
      <title>Making Games With Raylib Library As Senior Developer</title>
      <dc:creator>JDBC</dc:creator>
      <pubDate>Sat, 09 Dec 2023 17:30:33 +0000</pubDate>
      <link>https://dev.to/jdbcdev/raylib-library-for-video-games-programming-as-senior-developer-56jo</link>
      <guid>https://dev.to/jdbcdev/raylib-library-for-video-games-programming-as-senior-developer-56jo</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oIPK7E6v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a6z79pzq3da64mfsije.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oIPK7E6v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a6z79pzq3da64mfsije.jpg" alt="Photo by shark ovski on Unsplash" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine you are an experienced Senior Developer, so you have decided to give you the chance to build your first indie video game.&lt;/p&gt;

&lt;p&gt;Obviously, the natural and first option &lt;em&gt;seems&lt;/em&gt; to start learning a &lt;strong&gt;Game Engine&lt;/strong&gt; like &lt;em&gt;Unity&lt;/em&gt; or &lt;em&gt;Godot&lt;/em&gt; with some visual tools that help you in developing your first indie game. &lt;/p&gt;

&lt;p&gt;As I explained in my last article &lt;a href="https://dev.to/jdbcdev/is-it-worth-to-use-unity-game-engine-for-indie-game-developers-2g6h"&gt;Is it worth to use Unity Game Engine for Indie Game Developers?&lt;/a&gt;, &lt;em&gt;Unity engine&lt;/em&gt; is not a choice for different reasons.&lt;/p&gt;

&lt;p&gt;Also, learning &lt;em&gt;How to use a new visual tool and specific Game Engine workflow&lt;/em&gt; is not the path you really want to follow.&lt;/p&gt;

&lt;p&gt;You have the expertise of developing software for many years and do not want to begin learning from scratch. And the truth is, you really do not need it.&lt;/p&gt;

&lt;p&gt;Maybe you really want to keep using your favorite text editor like vim or Visual Studio Code. You would rather develop your indie video game following the old-school way, just coding it, just you and your programming expertise. You do not want more visual tools, one text editor and your knowledge should be enough.&lt;/p&gt;

&lt;p&gt;You only want to learn how to use a game library and to write your indie game using a simple text editor running on multiple platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking for simple Game library
&lt;/h2&gt;

&lt;p&gt;In this context, three requirements are set up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose an open-source and free Game library without any visual tool I must learn from scratch. The control of source code of your game has to be full.&lt;/li&gt;
&lt;li&gt;The game library does not need any extra dependencies. Choose a text editor and start building.&lt;/li&gt;
&lt;li&gt;The game library should be cross-platform, just one single codebase to run on multiple platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this point, you are digging into multiple game frameworks or libraries which fit into those previous requirements. &lt;/p&gt;

&lt;p&gt;So &lt;strong&gt;&lt;a href="https://www.raylib.com"&gt;Raylib library&lt;/a&gt;&lt;/strong&gt; could be your best option. Let's code, just open your text editor like &lt;a href="https://www.vim.org"&gt;vim&lt;/a&gt; or &lt;a href="https://vscodium.com"&gt;VSCodium&lt;/a&gt; in your Windows, Linux or Mac computer and let's build our indie game with &lt;em&gt;Raylib&lt;/em&gt; library, no extra dependencies are needed.&lt;/p&gt;

&lt;p&gt;The best part is Raylib also supports multiple target platforms in any platform that supports C language and OpenGL: Windows, Linux, MacOS, Android, HTML, Raspberry PI... &lt;/p&gt;

&lt;p&gt;Write once, running multiple platforms is really cool feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raylib and its own history
&lt;/h2&gt;

&lt;p&gt;Raylib is a simple and open-source library that was built by &lt;em&gt;Ramon Santamaria&lt;/em&gt; starting in August 2013 to support a game development course.&lt;/p&gt;

&lt;p&gt;Inspired by Windows XNA framework, the first stable version of Raylib 1.0 was published on November 2013 as an open-source library. &lt;/p&gt;

&lt;p&gt;Now in December 2023, ten years later, &lt;strong&gt;&lt;a href="https://github.com/raysan5/raylib"&gt;Raylib 5.0&lt;/a&gt;&lt;/strong&gt; has been released and, along the way, it has been ported to more than 50 programming languages, known as Raylib bindings.&lt;/p&gt;

&lt;p&gt;In words of the creator of Raylib: &lt;em&gt;A simple and easy-to-use library to enjoy videogames programming&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raylib formed by modules
&lt;/h2&gt;

&lt;p&gt;Raylib architecture is defined by a set of modules named accordingly to its primary functionality.&lt;/p&gt;

&lt;p&gt;The following image is the current Raylib 5 architecture:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A3uqRwGm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvb8dthfymeywd00eoa6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A3uqRwGm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvb8dthfymeywd00eoa6.png" alt="Raylib architecture image" width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every Raylib module defines a set of functions which provides a feature to make a game easy. &lt;/p&gt;

&lt;p&gt;For instance, &lt;em&gt;rcore&lt;/em&gt; module defines the functions to manage windows, file system and game input.&lt;/p&gt;

&lt;p&gt;Even some of those modules can be used in standalone mode, independently of Raylib library.&lt;/p&gt;
&lt;h2&gt;
  
  
  Learning Raylib
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.raylib.com/cheatsheet/cheatsheet.html"&gt;Raylib cheatsheet&lt;/a&gt; provides you with a quick reference for Raylib API API (functions and datatypes) in HTML and PDF format.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Raylib cheatshee&lt;/em&gt; is listed and colored by its modules and datatypes: &lt;em&gt;rcore&lt;/em&gt;, &lt;em&gt;rshapes&lt;/em&gt;, &lt;em&gt;rtextures&lt;/em&gt;, &lt;em&gt;rtext&lt;/em&gt;, &lt;em&gt;rmodels&lt;/em&gt;, and &lt;em&gt;raudio&lt;/em&gt;, &lt;/p&gt;

&lt;p&gt;For example, the Raylib &lt;em&gt;rcore&lt;/em&gt; module defines these basic functions to &lt;em&gt;init&lt;/em&gt; and &lt;em&gt;close&lt;/em&gt; windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Window-related functions&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;InitWindow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Initialize window and OpenGL context&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;CloseWindow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                                     &lt;span class="c1"&gt;// Close window and unload OpenGL context&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and functions to clear background and begin / end drawing on the screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt; &lt;span class="c1"&gt;// Drawing-related functions&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ClearBackground&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Color&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                          &lt;span class="c1"&gt;// Set background color (framebuffer clear color)&lt;/span&gt;

    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;BeginDrawing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                                    &lt;span class="c1"&gt;// Setup canvas (framebuffer) to start drawing&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;EndDrawing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                                      &lt;span class="c1"&gt;// End canvas drawing and swap buffers (double buffering)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take a look at these &lt;em&gt;Raylib cheatsheet&lt;/em&gt; to know more about Raylib features provided.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's code
&lt;/h2&gt;

&lt;p&gt;In addition, the &lt;a href="https://www.raylib.com/examples.html"&gt;Huge examples collection&lt;/a&gt; is available to acquire how to use Raylib library in a proper form.&lt;/p&gt;

&lt;p&gt;Choose your favourite programming language and begin to use the Rayblib binding for that language.&lt;/p&gt;

&lt;p&gt;There are Raylib binding for &lt;a href="https://github.com/raysan5/raylib/blob/master/BINDINGS.md"&gt;+60 bindings&lt;/a&gt;, no excuses if you really know one programming language to begin developing your next indie game.&lt;/p&gt;

&lt;p&gt;For example, if you are a C# expertise developer then you will use the &lt;strong&gt;&lt;a href="https://github.com/ChrisDill/Raylib-cs"&gt;Raylib C# binding&lt;/a&gt;&lt;/strong&gt; to begin developing your video game.&lt;/p&gt;

&lt;p&gt;Linux is also the favorite operating system for senior developers, but no problem at all, C# also works in Linux through &lt;a href="https://dotnet.microsoft.com"&gt;.Net&lt;/a&gt; &lt;em&gt;free&lt;/em&gt;, &lt;em&gt;open-source&lt;/em&gt; and &lt;em&gt;cross-platform&lt;/em&gt; framework.&lt;/p&gt;

&lt;p&gt;Let's install &lt;em&gt;DotNet&lt;/em&gt; for starting your first indie video game.&lt;/p&gt;

&lt;h3&gt;
  
  
  .Net in Linux
&lt;/h3&gt;

&lt;p&gt;First step is to read the &lt;a href="https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux"&gt;Raylib Wiki&lt;/a&gt; for installing Raylib library on your Linux operating.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;build-essential git cmake libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download latest version of &lt;a href="https://github.com/raysan5/raylib.git"&gt;Raylib from github repository&lt;/a&gt; and build the shared version of Raylib library using &lt;em&gt;make&lt;/em&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linuxmint:~/raylib/raylib/src&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/raysan5/raylib.git raylib
&lt;span class="nb"&gt;cd &lt;/span&gt;raylib/src/
make &lt;span class="nv"&gt;PLATFORM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;PLATFORM_DESKTOP &lt;span class="nv"&gt;RAYLIB_LIBTYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;SHARED &lt;span class="c"&gt;# To make the dynamic shared version.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the library to the standard &lt;em&gt;usr/local/lib&lt;/em&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linuxmint:~/raylib/raylib/src&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;make &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;RAYLIB_LIBTYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;SHARED &lt;span class="c"&gt;# Dynamic shared version.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;sudo make install RAYLIB_LIBTYPE=SHARED # Dynamic shared version.&lt;/p&gt;

&lt;p&gt;Follow the &lt;a href="https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install"&gt;Manual installation for DotNet&lt;/a&gt;: use &lt;em&gt;wget&lt;/em&gt; command to download &lt;em&gt;dotnet-install.sh&lt;/em&gt; and execute it to complete the installation process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~&lt;span class="nv"&gt;$ &lt;/span&gt;wget https://dot.net/v1/dotnet-install.sh &lt;span class="nt"&gt;-O&lt;/span&gt; dotnet-install.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;That's all jolks&lt;/em&gt;, Raylib C# binding is installed in your Linux.&lt;/p&gt;

&lt;p&gt;Use &lt;em&gt;dotnet new&lt;/em&gt; command to create a new console C# project where your indie videogame single codebase will stand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~/raylib/first_game&lt;span class="nv"&gt;$ &lt;/span&gt;dotnet new console &lt;span class="nt"&gt;-n&lt;/span&gt; first_game
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add Raylib C# binding library using &lt;em&gt;nuget&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~/raylib/first_game&lt;span class="nv"&gt;$ &lt;/span&gt;dotnet add package Raylib-cs
user@linux:~/raylib/first_game&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-ltr&lt;/span&gt;
total 12
&lt;span class="nt"&gt;-rw-rw-r--&lt;/span&gt; 1 jdbc jdbc  105 dic  9 12:54 Program.cs
&lt;span class="nt"&gt;-rw-rw-r--&lt;/span&gt; 1 jdbc jdbc  342 dic  9 12:54 first_game.csproj
drwxrwxr-x 2 jdbc jdbc 4096 dic  9 12:54 obj
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Editing your video game
&lt;/h3&gt;

&lt;p&gt;It's time to write some C# code and execute some commands in the Linux terminal:&lt;/p&gt;

&lt;p&gt;You could use any text editor, but we will use &lt;em&gt;&lt;a href="https://www.vim.org"&gt;vim text editor&lt;/a&gt;&lt;/em&gt; to edit C# code.&lt;/p&gt;

&lt;p&gt;Execute the following command if you do need to install it in your Linux operating system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open up &lt;em&gt;Program.cs&lt;/em&gt; file with &lt;em&gt;vim&lt;/em&gt; text editor and replace everything with the following Raylib C# template for opening a window and drawing some text on the screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~/raylib/first_game&lt;span class="nv"&gt;$ &lt;/span&gt;vim Program.cs
using Raylib_cs&lt;span class="p"&gt;;&lt;/span&gt;
using System.Numerics&lt;span class="p"&gt;;&lt;/span&gt;
using System&lt;span class="p"&gt;;&lt;/span&gt;
using System.Text&lt;span class="p"&gt;;&lt;/span&gt;

namespace Company.FirstGame&lt;span class="p"&gt;;&lt;/span&gt;

public class MyFirstGame
&lt;span class="o"&gt;{&lt;/span&gt;
    public static int Main&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        const int screenWidth &lt;span class="o"&gt;=&lt;/span&gt; 800&lt;span class="p"&gt;;&lt;/span&gt;
        const int screenHeight &lt;span class="o"&gt;=&lt;/span&gt; 450&lt;span class="p"&gt;;&lt;/span&gt;

        Raylib.InitWindow&lt;span class="o"&gt;(&lt;/span&gt;screenWidth, screenHeight, &lt;span class="s2"&gt;"My First Game"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        // Main loop
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;Raylib.WindowShouldClose&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            Raylib.BeginDrawing&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            Raylib.ClearBackground&lt;span class="o"&gt;(&lt;/span&gt;Color.RAYWHITE&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            Raylib.DrawText&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Let's make an indie videogame!"&lt;/span&gt;, 190, 200, 20, Color.BLACK&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            Raylib.EndDrawing&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        Raylib.CloseWindow&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return &lt;/span&gt;0&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build and run your first video game using &lt;em&gt;dotnet build &amp;amp;&amp;amp; dotnet run&lt;/em&gt; commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;user@linux:~/raylib/first_game&lt;span class="nv"&gt;$ &lt;/span&gt;dotnet build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PtfbQmEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iis2uy3doyjambpi9lq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PtfbQmEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iis2uy3doyjambpi9lq8.png" alt="RayLib first game window" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it, your first game window appears.&lt;/p&gt;

</description>
      <category>raylib</category>
      <category>gamedev</category>
      <category>csharp</category>
      <category>indie</category>
    </item>
    <item>
      <title>Is it worth to use Unity Game Engine for Indie Game Developers?</title>
      <dc:creator>JDBC</dc:creator>
      <pubDate>Sun, 17 Sep 2023 12:20:14 +0000</pubDate>
      <link>https://dev.to/jdbcdev/is-it-worth-to-use-unity-game-engine-for-indie-game-developers-2g6h</link>
      <guid>https://dev.to/jdbcdev/is-it-worth-to-use-unity-game-engine-for-indie-game-developers-2g6h</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5mpG6Om0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jxyt2io3t0cri1qf10qq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5mpG6Om0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jxyt2io3t0cri1qf10qq.jpg" alt="Image by rawpixel.com on Freepik" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rules of Unity Engine have changed.&lt;/p&gt;

&lt;p&gt;On September 12, Unity announced a new &lt;a href="https://blog.unity.com/news/plan-pricing-and-packaging-updates"&gt;Runtime Fee&lt;/a&gt; based on above certain thresholds, annual revenue and game installs, starting January 1, 2024.&lt;/p&gt;

&lt;p&gt;For instance, if indie developers used the free Unity Personal plan, getting $200k in revenue and 200k downloads in the last 12 months, then Unity company would charge $0.20 for every install above the threshold.&lt;/p&gt;

&lt;p&gt;In fact with this announcement, Unity has becomes the enemy of indie game developers for many reasons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unity forum thread
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://forum.unity.com/threads/unity-plan-pricing-and-packaging-updates.1482750"&gt;official Unity Forum&lt;/a&gt; tries to explain common questions / answers as the following: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a user reinstalls/redownloads a game / changes their hardware, will that count as multiple installs?&lt;br&gt;
A: Yes. The creator will need to pay for all future installs. The reason is that Unity doesn’t receive end-player information, just aggregate data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Really?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's suppose the following scenario: a game is installed / uninstalled 10 times for every device of one single user, and will be counted as 10 installed games.&lt;/p&gt;

&lt;p&gt;In this case, Unity will charge 10 times for running the game but player has only paid once for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do we agree this scenario is not a good deal for you as an indie developer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is clear you should consider another game engine instead of Unity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developers reactions to Unity Runtime fee
&lt;/h2&gt;

&lt;p&gt;Game developers are angry and fuming for this new pricing model. It is insane, unfair and the worst, most devs do not trust Unity ever again.&lt;/p&gt;

&lt;p&gt;So many question are in the air:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What about pirated installs?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How Unity will track game installs?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have spent some time analyzing which game engine is best for making indie games. In my opinion Unity Game Engine is not a good choice to make indie video games regardless this new Runtime fee.&lt;/p&gt;

&lt;p&gt;Some reasons to avoid to choose Unity for making indie games:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Unity Engine is not open source, so you might wait for bug fixes until Unity decides in the best case. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unity pricing model can be changed at any moment... &lt;em&gt;just what they have done!&lt;/em&gt;. This is not a fair deal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unity provides a pretty good visual editor but experienced developers will prefer to write code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From my point of view, you should use Unity Engine for two reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Quick demos or testing a game design idea.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are planning to release the game the no-paid one.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Looking for Game Engine Alternatives
&lt;/h2&gt;

&lt;p&gt;This comment from official Unity Forum summarizes the lack of trust in Unity:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Question to the team: How are installs tracked on devices, I'm Not collecting any data from my players / clients and I don't plan to do so in the future. no data packages going out - Unity can't verify the numbers. Will the game be FORCED to do it? In that case I'll probably look at Godot for future projects, that's a big No for me.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most indie developers disagree with this new Runtime fee, with many unclear arguments for updating the Unity pricing model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How game installs will be tracked?&lt;/strong&gt; It is an unclear question that should be answered by Unity company.&lt;/p&gt;

&lt;p&gt;The way installs are counted is also outside of game developers' control. &lt;strong&gt;Is it enough to switch to another Game Engine?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's take a look at Game Engine based on C# programming language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Godot Game Engine
&lt;/h2&gt;

&lt;p&gt;I guess many Indie developers will switch from Unity to Godot, as the following comment extracted from the previous Unity Forum.&lt;/p&gt;

&lt;p&gt;This is because Godot is absolutely free.&lt;/p&gt;

&lt;p&gt;Godot provides a visual editor that is working on Windows, MacOS and Linux. The officially supported programming languages for Godot are C#, C++ and GDScript.&lt;/p&gt;

&lt;p&gt;Just visit the following Godot's FAQ to get answers to the following three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What can I do with Godot?&lt;/li&gt;
&lt;li&gt;How much does it cost?&lt;/li&gt;
&lt;li&gt;What are the license terms?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The short answer is you could develop exactly the same type of game using both engines Godot and Unity.&lt;/p&gt;

&lt;p&gt;Download &lt;a href="https://godotengine.org/download/windows/"&gt;Godot 4.1&lt;/a&gt; if you want to give it a try.&lt;/p&gt;

&lt;h2&gt;
  
  
  RayLib Library
&lt;/h2&gt;

&lt;p&gt;Actually, Raylib is not a game engine but that's an open-source, cross-platform, minimalistic, simple and easy-to-use library to build video games without visual helpers or specific editor, just coding with your favorite text editor.&lt;/p&gt;

&lt;p&gt;Raylib has received some awards from Google and Epic Games in the last years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ChrisDill/Raylib-cs"&gt;RayLib C# binding&lt;/a&gt; provides you the way to use C# with RayLib library, which is appropiated for senior experienced developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  MonoGame
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.monogame.net/index.html"&gt;MonoGame&lt;/a&gt; is also a open-source C# Game Framework that currently supports Windows, macOS, Linux, iOS, Android, PlayStation 4, PlayStation 5, Xbox and Nintendo Switch.&lt;/p&gt;

&lt;p&gt;It is a very interesting alternative to switch from Unity.&lt;/p&gt;

&lt;p&gt;MonoGame also &lt;a href="https://docs.monogame.net/articles/tools/tools.html"&gt;distributes tools&lt;/a&gt; to build content for your game.&lt;/p&gt;

&lt;p&gt;Too many another Game Engines is out there to switch from Unity.&lt;/p&gt;

&lt;p&gt;Let’s take a look at my story &lt;a href="https://dev.to/jdbcdev/becoming-an-indie-game-developer-with-gideros-studio-1o9h"&gt;Becoming an Indie Developer with Gideros Studio&lt;/a&gt; if you want to develop games with a Lua based and totally free game framework.&lt;/p&gt;

&lt;p&gt;Happy switching!&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>indie</category>
      <category>gamedev</category>
      <category>godotengine</category>
    </item>
    <item>
      <title>Gideros Project Template for your Indie Games</title>
      <dc:creator>JDBC</dc:creator>
      <pubDate>Sun, 14 Nov 2021 17:01:03 +0000</pubDate>
      <link>https://dev.to/jdbcdev/gideros-project-template-for-your-indie-games-2ih4</link>
      <guid>https://dev.to/jdbcdev/gideros-project-template-for-your-indie-games-2ih4</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SPAwVMco--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xvo9vexkvk8l1vdugwmg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SPAwVMco--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xvo9vexkvk8l1vdugwmg.jpg" alt="Main image" width="880" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Gideros Project Template for your Indie games
&lt;/h1&gt;

&lt;p&gt;This article will explain how to create a common &lt;strong&gt;&lt;a href="https://github.com/jdbcdev/gideros_template"&gt;Gideros Project Template&lt;/a&gt;&lt;/strong&gt; for all your Indie games developed using the amazing &lt;a href="https://wiki.giderosmobile.com/index.php/Gideros_Studio"&gt;Gideros Studio&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Game configuration
&lt;/h2&gt;

&lt;p&gt;The first step is to configure the game in the Gideros Studio editor.&lt;/p&gt;

&lt;p&gt;Click on the right button of the mouse to open Gideros project properties window where you will choose your game name:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2KC8n-xG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3j7o0jimkufjlrwrj5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2KC8n-xG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3j7o0jimkufjlrwrj5y.png" alt="Gideros Project Properties" width="880" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally the following properties can be set from this window:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Settings tab&lt;/em&gt;: current version of the game, build version, retina display and autorotation.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Window tab&lt;/em&gt;: scale mode (recommended letterbox), logical dimensions, window size, orientation (Portrait or Landscape) and FPS (30 or 60).&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Input tab&lt;/em&gt;: behaviour of mouse and touch events.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starting point file
&lt;/h2&gt;

&lt;p&gt;The &lt;em&gt;main.lua&lt;/em&gt; file is the entry point for your game. The following lines have been added to the beginning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setKeepAwake&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setOrientation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PORTRAIT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setBackgroundColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0xffffff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why these lines were added?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You will check from Gideros documentation for &lt;a href="https://wiki.gideros.rocks/index.php/Application"&gt;Application Class&lt;/a&gt; to answer to the previous question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;a href="https://wiki.giderosmobile.com/index.php/Application:setKeepAwake"&gt;Application:setKeepAwake&lt;/a&gt;&lt;/em&gt; keeps runnning your game when there is no touches for some period of time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;a href="https://wiki.giderosmobile.com/index.php/Application:setOrientation"&gt;Application:setOrientation&lt;/a&gt;&lt;/em&gt; sets the orientation of your game: PORTRAIT or LANDSCAPE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;a href="https://wiki.gideros.rocks/index.php/Application:setBackgroundColor"&gt;Application:setBackgroundColor&lt;/a&gt;&lt;/em&gt; sets the background color of your game in hexadecimal, by default &lt;em&gt;0xffffff&lt;/em&gt; is the white color. You could change it for another you want.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ISqgoUCR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h3np1i633fi7qnw73w0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ISqgoUCR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h3np1i633fi7qnw73w0.png" alt="Gideros Main File" width="880" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Game assets
&lt;/h3&gt;

&lt;p&gt;In this point you will need to store your game assets (images, music, sounds, fonts) in some specific folder.&lt;/p&gt;

&lt;p&gt;For this purpose the following folders within &lt;em&gt;Files&lt;/em&gt; are created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;images&lt;/strong&gt; folder where all your game graphics are placed.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;sounds&lt;/strong&gt; folder where music and sounds of your game are set.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;fonts&lt;/strong&gt; folder where all your game fonts are localized.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gideros Studio supports Bitmap and TrueType Fonts, I recommend to use TrueType Fonts (TTFonts).&lt;/p&gt;

&lt;p&gt;For example download the &lt;a href="https://fontesk.com/first-fun-font/"&gt;First Fun Font&lt;/a&gt; which is Free for commercial use and put into &lt;em&gt;fonts&lt;/em&gt; folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loading game
&lt;/h3&gt;

&lt;p&gt;Define one &lt;em&gt;draw_loading&lt;/em&gt; local function in the &lt;em&gt;main.lua&lt;/em&gt; file which will show the &lt;em&gt;Loading&lt;/em&gt; text message when your game begins.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Loading function&lt;/span&gt;
&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;draw_loading&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;loading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Sprite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;TTFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"fonts/firstfun.ttf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TextField&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Loading"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;posX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getLogicalWidth&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getWidth&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;posX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;280&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setTextColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x00ff11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;
    &lt;span class="n"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gideros Studio uses a &lt;em&gt;nodes hierarchy graph&lt;/em&gt; to draw something in the game screen and the &lt;em&gt;stage&lt;/em&gt; variable is the root node in the graph.&lt;/p&gt;

&lt;p&gt;This local function will use the &lt;em&gt;Sprite&lt;/em&gt; and &lt;em&gt;TTFont&lt;/em&gt; Gideros classes to do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a &lt;em&gt;loading&lt;/em&gt; Sprite object which must contain the &lt;em&gt;Loading&lt;/em&gt; text message.&lt;/li&gt;
&lt;li&gt;Defines a local &lt;em&gt;font&lt;/em&gt; variable which uses the &lt;em&gt;TTFont&lt;/em&gt; Gideros class to load &lt;em&gt;firstfun&lt;/em&gt; TrueType font with size 50.&lt;/li&gt;
&lt;li&gt;Creates a local &lt;em&gt;text&lt;/em&gt; variable which is a &lt;em&gt;TextField&lt;/em&gt; object with &lt;em&gt;Loading&lt;/em&gt; string text.&lt;/li&gt;
&lt;li&gt;Sets the X position and the text color of the &lt;em&gt;text&lt;/em&gt; variable.&lt;/li&gt;
&lt;li&gt;Adds the &lt;em&gt;text&lt;/em&gt; variable to the &lt;em&gt;loading&lt;/em&gt; Sprite object&lt;/li&gt;
&lt;li&gt;We wish to render &lt;em&gt;loading&lt;/em&gt; text in screen, so adds the &lt;em&gt;loading&lt;/em&gt; Sprite object to &lt;em&gt;stage&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detecting Platform
&lt;/h2&gt;

&lt;p&gt;Define two local variables &lt;em&gt;iOS&lt;/em&gt; and &lt;em&gt;android&lt;/em&gt; in the &lt;em&gt;main.lua&lt;/em&gt; file to know which is the native platform when game is running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;iOS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getDeviceInfo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"iOS"&lt;/span&gt;
&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;android&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getDeviceInfo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"Android"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both variables gives you the value &lt;em&gt;true&lt;/em&gt; when your game is running on iOS or Android device, so you can use them to write custom Lua code depending on the target device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scene Manager plugin
&lt;/h2&gt;

&lt;p&gt;The &lt;em&gt;SceneManager&lt;/em&gt; plugin allows you to manage all your game scenes.&lt;/p&gt;

&lt;p&gt;Go to &lt;em&gt;Plugins folder&lt;/em&gt;, click on right button to &lt;em&gt;Add Plugin&lt;/em&gt; and the list with all plugins will be shown:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hRj3KW_G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cs5hmd310f9qky3bmq1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRj3KW_G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cs5hmd310f9qky3bmq1r.png" alt="Gideros Scene Manager" width="880" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;em&gt;Scene Manager&lt;/em&gt; and &lt;em&gt;Easing&lt;/em&gt; plugins and click on &lt;em&gt;OK&lt;/em&gt; button to add both to your Gideros project.&lt;/p&gt;

&lt;p&gt;Go back to the beginning of the &lt;em&gt;main.lua&lt;/em&gt; file and use &lt;em&gt;require&lt;/em&gt; sentence to import these plugins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"scenemanager"&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"easing"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Game scenes
&lt;/h2&gt;

&lt;p&gt;Once you have added &lt;em&gt;Scene Manager&lt;/em&gt; and &lt;em&gt;Easing&lt;/em&gt; plugins, then &lt;strong&gt;Menu&lt;/strong&gt; and &lt;strong&gt;Game&lt;/strong&gt; scenes will be created in the Gideros project template.&lt;/p&gt;

&lt;p&gt;Gideros provides the &lt;a href="https://wiki.giderosmobile.com/index.php/Sprite"&gt;Sprite Class&lt;/a&gt; as the base class for your game scenes. A sprite object describes &lt;a href="https://archive.gamedev.net/archive/reference/programming/features/scenegraph/index.html"&gt;Scene Graph&lt;/a&gt; containing child nodes.&lt;/p&gt;

&lt;p&gt;Every game scene will extends &lt;em&gt;Sprite class&lt;/em&gt; following the oriented object programming approach.&lt;/p&gt;

&lt;h3&gt;
  
  
  Menu Scene
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;Menu scene&lt;/em&gt; should be the first scene shown in your game, this is where you show the different options of your game.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First a &lt;strong&gt;scenes&lt;/strong&gt; folder is created within &lt;em&gt;Files&lt;/em&gt;, this folder is where all game scenes are placed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second the &lt;em&gt;menu.lua&lt;/em&gt; file is created within &lt;em&gt;scenes&lt;/em&gt; folder with the following Lua code:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;MenuScene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Core&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sprite&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;-- Static setup&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;MenuScene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;-- Constructor&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MenuScene&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The static &lt;em&gt;setup()&lt;/em&gt; function allows to load all &lt;em&gt;MenuScene&lt;/em&gt; assets (images, music, sounds, fonts,...).&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;init&lt;/em&gt; function is the constructor for &lt;em&gt;MenuScene&lt;/em&gt; Sprite which is called for &lt;em&gt;sceneManager&lt;/em&gt; for creating the Menu scene. &lt;/p&gt;

&lt;h3&gt;
  
  
  Game Scene
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;Game scene&lt;/em&gt; is the core game loop of your game, where the magic happens.&lt;/p&gt;

&lt;p&gt;Just create a &lt;em&gt;game&lt;/em&gt; file within &lt;em&gt;scenes&lt;/em&gt; folder with the following Lua code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;GameScene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Core&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sprite&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;-- Static setup&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;GameScene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;-- Constructor&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;GameScene&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The static &lt;em&gt;setup()&lt;/em&gt; function allows to load all &lt;em&gt;GameScene&lt;/em&gt; assets.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;init&lt;/em&gt; function is the constructor for &lt;em&gt;GameScene&lt;/em&gt; Sprite which is called for &lt;em&gt;sceneManager&lt;/em&gt; to create the Game scene. &lt;/p&gt;

&lt;p&gt;For instance this is how it looks &lt;strong&gt;menu&lt;/strong&gt; scene in Gideros Studio editor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2m0lSTkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6t5qxncchk7q0w3qo7mk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2m0lSTkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6t5qxncchk7q0w3qo7mk.png" alt="Gideros Menu Scene" width="880" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using scenes
&lt;/h2&gt;

&lt;p&gt;Go back to &lt;em&gt;main.lua&lt;/em&gt; file and write some Lua code at the end of this file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;draw_loading&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ENTER_FRAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;preloader&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above Lua code will do the following two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invoke the local &lt;em&gt;draw_loading&lt;/em&gt; function.&lt;/li&gt;
&lt;li&gt;Add &lt;em&gt;ENTER_FRAME&lt;/em&gt; event listener to call the &lt;em&gt;preloader&lt;/em&gt; function the first time screen must be rendered. Click on &lt;a href="https://wiki.giderosmobile.com/index.php/Event.ENTER_FRAME"&gt;ENTER_FRAME event&lt;/a&gt; for specific info about this event.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we need to create the local &lt;em&gt;preloader&lt;/em&gt; function with the following Lua code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;preloader&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;removeEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ENTER_FRAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;preloader&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;-- Load all your assets here&lt;/span&gt;
    &lt;span class="n"&gt;MenuScene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;GameScene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;-- List of scenes&lt;/span&gt;
    &lt;span class="n"&gt;scenes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"menu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"game"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;sceneManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SceneManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"menu"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MenuScene&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"game"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GameScene&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sceneManager&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;-- MenuScene is the first scene to show&lt;/span&gt;
    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;currentScene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scenes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TIMER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                    &lt;span class="c1"&gt;-- Remove loading scene&lt;/span&gt;
                    &lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;removeChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;loading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
                    &lt;span class="n"&gt;sceneManager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;changeScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentScene&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;em&gt;preloader&lt;/em&gt; function must do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove the &lt;em&gt;ENTER_FRAME&lt;/em&gt; event listener. We only need to call the &lt;em&gt;preloader&lt;/em&gt; function once.&lt;/li&gt;
&lt;li&gt;Invoke &lt;em&gt;MenuScene.setup&lt;/em&gt; and &lt;em&gt;GameScene.setup&lt;/em&gt; functions to load the scenes assets.&lt;/li&gt;
&lt;li&gt;Define the game scene list that will be used by &lt;em&gt;sceneManager&lt;/em&gt; variable.&lt;/li&gt;
&lt;li&gt;The variable &lt;em&gt;currentScene&lt;/em&gt; defines the &lt;em&gt;MenuScene&lt;/em&gt; as the default game scene. &lt;/li&gt;
&lt;li&gt;Use Gideros &lt;a href="https://wiki.giderosmobile.com/index.php/Timer"&gt;Timer&lt;/a&gt; class to wait 2000 miliseconds until the &lt;em&gt;Menu&lt;/em&gt; scene is shown by &lt;em&gt;sceneManager&lt;/em&gt; variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally this &lt;strong&gt;&lt;a href="https://github.com/jdbcdev/gideros_template"&gt;Gideros Template Project&lt;/a&gt;&lt;/strong&gt; should be used as starting point to develop your upcoming hit Indie game. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://play.google.com/store/apps/developer?id=JDBC+Games"&gt;All my Android games published to Google Store&lt;/a&gt; has been developed using these template.&lt;/p&gt;

&lt;p&gt;Enjoy it and do not hesitate to leave some comment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TyNyJywh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ur06ove0sdlvqwdprlhf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TyNyJywh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ur06ove0sdlvqwdprlhf.png" alt="JDBC Games" width="480" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>programming</category>
      <category>tooling</category>
      <category>android</category>
    </item>
    <item>
      <title>Becoming an Indie Game Developer with Gideros Studio
</title>
      <dc:creator>JDBC</dc:creator>
      <pubDate>Sun, 18 Jul 2021 09:51:50 +0000</pubDate>
      <link>https://dev.to/jdbcdev/becoming-an-indie-game-developer-with-gideros-studio-1o9h</link>
      <guid>https://dev.to/jdbcdev/becoming-an-indie-game-developer-with-gideros-studio-1o9h</guid>
      <description>&lt;p&gt;If you are planning to becoming an indie game developer then you should give a try to &lt;a href="http://giderosmobile.com"&gt;Gideros Studio&lt;/a&gt; Studio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Choose Gideros Studio to build games?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These are the main reasons to start using Gideros for your next game:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gideros Studio is free and open-source. &lt;/li&gt;
&lt;li&gt;Cross-platform to publish your game to multiple platforms.&lt;/li&gt;
&lt;li&gt;Fully IDE to develop, test and publish your game.&lt;/li&gt;
&lt;li&gt;Easy and fast game development, ideal for prototyping.&lt;/li&gt;
&lt;li&gt;Object oriented programming is supported.&lt;/li&gt;
&lt;li&gt;Your game runs at Native speed in every published platform.&lt;/li&gt;
&lt;li&gt;Gideros Studio provides a Plugins system to extend it.&lt;/li&gt;
&lt;li&gt;Active &lt;a href="http://forum.giderosmobile.com/"&gt;Forum&lt;/a&gt; to resolve any question.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gideros Studio is free and open source
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gideros Studio is Free&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://giderosmobile.com"&gt;Gideros Studio&lt;/a&gt; is a &lt;em&gt;free&lt;/em&gt; and &lt;em&gt;open-source&lt;/em&gt; development environment to make cross-platform 2D games in a easy and quick way.&lt;/p&gt;

&lt;p&gt;Gideros Studio needs OpenGL 3.0 or better and at least 1Ghz and 1Gb RAM and runs on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows XP, Vista, 7, 8, 10&lt;/li&gt;
&lt;li&gt;Mac OS X Lion or later.&lt;/li&gt;
&lt;li&gt;Linux with Wine Emulator or compile from source code.&lt;/li&gt;
&lt;li&gt;Raspberry Pi 2 or 3, compiling compile from source code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can download the &lt;a href="http://giderosmobile.com/download"&gt;Last release of Gideros Studio&lt;/a&gt; without cost. Anyway you can also &lt;a href="http://giderosmobile.com/donate&amp;amp;download"&gt;Download and colaborate&lt;/a&gt; with this project to help to keep working on this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iz0b6Cho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8ltfjjnq7qyckszg04m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iz0b6Cho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8ltfjjnq7qyckszg04m.png" alt="Gideros Download"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gideros Studio is Open source&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Gideros Studio is also open source and available in the &lt;a href="https://github.com/gideros/gideros"&gt;Github repositories&lt;/a&gt;, so you can study how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cross-platform
&lt;/h2&gt;

&lt;p&gt;Cross-platform feature allows you to develop your game with only &lt;em&gt;one code base&lt;/em&gt;, and publish it to multiple platforms. &lt;/p&gt;

&lt;p&gt;The following is the list of supported platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Android&lt;/li&gt;
&lt;li&gt;iOS&lt;/li&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;MacOSX&lt;/li&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Native speed
&lt;/h2&gt;

&lt;p&gt;Gideros Studio is developed on top of C/C++ and OpenGL, so your game runs at native speed on every supported platform. &lt;/p&gt;

&lt;p&gt;Additionally Gideros allows to develop native code for one specific platform with the provided Plugins system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lua programming language
&lt;/h2&gt;

&lt;p&gt;Gideros Studio uses &lt;a href="https://www.lua.org"&gt;Lua programming language&lt;/a&gt; to help you to build your next 2D indie game.&lt;/p&gt;

&lt;p&gt;Lua is simple and powerful programming language, if you already know another programming language as Java, C# or Javascript then do not worry, you will learn Lua in just a few days or a week.&lt;/p&gt;

&lt;p&gt;In my opinion Lua is one of the easiest and powerfull programming language. Take a look to the &lt;a href="http://www.lua.org"&gt;official Lua web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For instance the following source code displays a PNG image at the position (100, 100)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;bmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Texture&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ball.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;setPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;addChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quite simple, isn't it? &lt;/p&gt;

&lt;p&gt;Furthermore you can read the &lt;a href="https://wiki.gideros.rocks/index.php/Lua_API"&gt;Gideros LUA API&lt;/a&gt; reference to know Lua modules and Enhancements provided by Gideros Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object Oriented Programming
&lt;/h2&gt;

&lt;p&gt;Gideros Studio provides a &lt;a href="https://wiki.gideros.rocks/index.php/Main_API"&gt;Set of classes&lt;/a&gt; to follow a clean &lt;a href="https://en.wikipedia.org/wiki/Object-oriented_programming"&gt;Object Oriented Programming&lt;/a&gt; approach when you build your games with Lua programming language.&lt;/p&gt;

&lt;p&gt;The above example uses two classes, &lt;a href="https://wiki.gideros.rocks/index.php/Bitmap"&gt;Bitmap&lt;/a&gt; and &lt;a href="https://wiki.gideros.rocks/index.php/Texture"&gt;Texture&lt;/a&gt; to display image to screen. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Texture&lt;/strong&gt; class loads PNG image to memory and &lt;strong&gt;Bitmap&lt;/strong&gt; displays the PNG to screen,write only &lt;strong&gt;3 lines of code&lt;/strong&gt; to display image to screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gideros Studio IDE
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://wiki.giderosmobile.com/index.php/Gideros_Studio"&gt;Gideros Studio&lt;/a&gt; provides a complete Integrated Development Environment (IDE) for quick developing and testing your indie games. &lt;/p&gt;

&lt;p&gt;Gideros Studio includes a code editor with &lt;em&gt;project files manager&lt;/em&gt;, &lt;em&gt;Lua syntax checking&lt;/em&gt; and &lt;em&gt;find/replace&lt;/em&gt; tools to build your game without another external editor. &lt;/p&gt;

&lt;p&gt;Create &lt;em&gt;main.lua&lt;/em&gt; file as the starting point of your next indie game.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q-UY7Kra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20rny78zegf1s0ktgieq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q-UY7Kra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20rny78zegf1s0ktgieq.png" alt="Gideros Studio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When finally you were ready to publish then Gideros Studio also allows you to export it to several platforms with no additional effort.&lt;/p&gt;

&lt;p&gt;I've just developed my own &lt;a href="https://play.google.com/store/apps/details?id=es.jdbc.arkamania"&gt;Arkamania Brick Breaker&lt;/a&gt; game in just one month, published for Android and iOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gideros Player
&lt;/h2&gt;

&lt;p&gt;For testing purposes you will use &lt;em&gt;Gideros Player&lt;/em&gt; with &lt;strong&gt;Hot Reloading&lt;/strong&gt; feature which speeds up game development.&lt;/p&gt;

&lt;p&gt;Change your Lua code in Gideros Studio, save and test your game instantly in Gideros Player. &lt;em&gt;Repeat&lt;/em&gt;, &lt;em&gt;repeat&lt;/em&gt; and &lt;em&gt;repeat&lt;/em&gt; this process and finish your game without realizing it.&lt;/p&gt;

&lt;p&gt;This is how looks my &lt;a href="https://play.google.com/store/apps/details?id=es.jdbc.flappy_creature"&gt;Flappy Creature&lt;/a&gt; game in Gideros Player:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tLGJ4gzf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht9wbs142ukzzw68adb0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tLGJ4gzf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht9wbs142ukzzw68adb0.png" alt="Gideros Player"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extending with Plugins
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://giderosmobile.com/DevCenter/index.php/Gideros_plugins"&gt;Gideros Studio Plugins&lt;/a&gt; is a feature which enable to develop a C/C++/Swift/Java/Kotlin library and call functions of this library from Lua code.&lt;/p&gt;

&lt;p&gt;This is really useful when you need to integrate third-party libraries (Google Play Services, Facebook, In-app billing, Ads…) to your game.&lt;/p&gt;

&lt;p&gt;Many plugins are already developed and available from &lt;a href="http://giderosmobile.com/labs"&gt;Gideros Labs&lt;/a&gt;, but you can develop your own in case you need it. Usually Plugins are developed in C/C++ for all platforms, Java/Kotlin for Android and Swift/Objective-C for iOS.&lt;/p&gt;

&lt;p&gt;You can read &lt;a href="http://appcodingeasy.com/Gideros-Mobile/Creating-plugins-for-Android-in-Gideros"&gt;Creating Plugins for Android&lt;/a&gt; article for more information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Awesome Gideros Resources
&lt;/h2&gt;

&lt;p&gt;¿Are you still reading this article?&lt;/p&gt;

&lt;p&gt;Let's check &lt;a href="https://learnpracticeandshare.com/awesome-gideros-mobile-massive-collection-of-resources"&gt;Awesome Gideros&lt;/a&gt; to know what Gideros Studio provides you to becoming an indie developer in record time and less effort you think.&lt;/p&gt;

</description>
      <category>lua</category>
      <category>gideros</category>
      <category>crossplatform</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
