Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Suggestion for pre-Gideros — Gideros Forum

Suggestion for pre-Gideros

PACPAC Member
edited September 2014 in General questions
I've been trying to learn Gideros using the Reference Manual and this friendly and generous group, but I'm not gettin' it. My only experience has been writing games in Basic (AMOS on the Amiga, then Blitz3D on PC). But Events, EventDispatchers, Classes. One variable that can equal multiple tables, functions, .self ????
Kudos to all you people that learned Gideros ... any suggestions for a pre-language to learn before Gideros?
Thanks!


Comments

  • eezingeezing Member
    edited September 2014
    @PAC

    - It's probably a good idea to understand the basics of Lua. Here's some links to get you started:

    Lua wiki tutorial: http://lua-users.org/wiki/TutorialDirectory

    Official learning book: http://www.lua.org/pil/contents.html

    Official 'getting started' page: http://www.lua.org/start.html

    - A basic understanding of the object-oriented programing will help:
    http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/oop.html#what_is_object


  • MellsMells Guru
    edited September 2014
    And then check out :

    1. http://www.gamasutra.com/blogs/ArtursSosins/20131129/205956/Learning_Gideros_in_10_easy_steps.php

    2. Gideros Mobile Game Development book by Arturs Sosins (aka @ar2rsawseen). [recommended]
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • Some of us have come from other languages. my self. Pascal, Foxpro, PHP, and a few others, what I can say is they are all pretty much the same, with a some minor differences. doing the Animation stuff, and the Tweening, these other aspects that are in a Game Engine like Gideros are just Functions and Procedure calls, and emulate objects.
    The basic concepts you might want to understand is multi-Threading, where you can start up a routine to run on its own while you run through your code, think of a Trung and branch, running side by side.
    As for learning, as mentioned above, basic LUA is not harder or easier than Basic, Pascal, PHP, but much easier than Java, C++, C.
    Best way to learn a language, is start with a simple Task, usually Hello World, and then you add things, one by one, till you your app evolves to somthing, mabe not as planned, but that is how many games are developed. I started one game I call bird lander, ends up being bird climber. lol...
    REAL programmers type copy con filename.exe
    ---------------------------------------
  • As @Cyberience says, that's the best way to learn in my opinion. Set a very simple game as a goal. Then grow on complexity as you learn more. Make a Flappy Bird or something like that, and then move on to a Flappy Eagle.

    I don't know a lot of languages. I come from AS3 in Flash and Lua suited me very well because it's kind of the same structure but simpler (in fact I came across Gideros and began using it for this article http://blog.giderosmobile.com/post/52707133103/port-your-flash-game-to-ios-android). And I think you'll find much more info and tutorials for AS3. Though I think you'd be learning a lot of stuff you won't need in the end.

    Also, something that helps is taking a look and messing around with the examples that come with Gideros (which cover many topics) or any other stuff you can get your hands on, like Nebula Retro's code, or even the projects other people post on the forums asking for help, which normally are short and you can dissect them and try to understand each part.
  • As I love Ruby: Maybe you try Ruby and RubyMotion? Sounds interesting, but I didn't try it out yet.

    http://www.rubymotion.com

    RubyMotion right now is for iOS and MacOSX only.
  • OK, thanks everyone, these tips will give me some needed direction. Reading lua docs has been easy compared to the Gideros samples.
    The sample codes and small apps should be helpful but for the most part the help notes aren't extensive enough for this guy.
    If I could ask you one specific question: what is self. ?

    Function Bird:init(frameList)
    self.frames = {}

    Thanks again !!

  • Hi @PAC, I also didn't know it. Simple example of @ar2rsawseen :)>- :
     
    function MyClass:init()
        local variable = 1
        self.variable = 2
     
        self:printVariable()
    end
     
    function MyClass:printVariable()
        print(variable) -- prints nil (variable does not exist)
        print(self.variable) --prints 2 (works as expected)
    end
  • "self" refers to the class you're into. It basically says that you're managing a variable (or function) from that class and not a global one, and also keeps it stored (which doesn't happen for "local" variables, which only work into the same function inside the class). For instance if you created "self.variable = 2", then you can later use it and write "self.variable = self.variable + 10". If you only wrote "variable = 2" even inside the class it would look up for a global variable called "variable", not one pertaining to the class.

    Like @yubaro's quoted example the class is MyClass, the local variable no longer exists in the other function, while self.variable is still there.
  • @PAC,
    What kind of app are you making with Gideros?
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • Just to save time, the incorrect answer is 'I haven't actually started making anything specific yet. I'm just trying to get my head around the language first'.

    Forgive me if I am stating the obvious, but, in my opinion, the best way to learn a programming language is to passionately want to make a particular app, then try to make it. Each time you need to know something specific, you look up that particular thing, copy and paste the code and continue (whilst trying very hard not to get side-tracked by other interesting code snippets seen nearby). Maintain focus on making your app.

    This method also provides small, regular moments of excitement, satisfaction and pride while you watch your creation gradually materialise.

    Likes: Disciple

    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
    +1 -1 (+1 / -0 )Share on Facebook
  • How about learning to code by playing games.
    Seems Lua is also available now
    http://codecombat.com/
  • john26john26 Maintainer
    The declaration
    function Bird:init(frameList)
    is syntactic sugar for
    Bird.init=function (self,framelist)
    where "self" is just a parameter that is passed in. So Bird is a table one of whose members is "init" (a function which takes two arguments)

    When you call this function using
    Bird:init(framelist)
    this is syntactic sugar for the call
    Bird.init(Bird,framelist)
    So "self", in this case just maps to "Bird". So the function then has access to the Bird object which is very useful. When you call a function (which is a member of a table) using the colon operator, it just passes in the thing immediately to the left of the colon.

    Lua is not an object oriented language. Gideros has an OO layer on top which you can use if you want but do not have to. You can program in Lua just as you would in Basic if you like.

    If you look at my open source game, http://giderosmobile.com/nebula, you will see it is not written in OO style, the structure of the game is like a C program. You might find it easier to understand.

    Likes: ar2rsawseen

    +1 -1 (+1 / -0 )Share on Facebook
  • Platypus, I agree as well, the passion we have for making games becomes our enthusiasm. I reviewed a number of languages before deciding to try Gideros. But my Basic only background hadn't prepared very well. First, I'm only accustomed to code that reads/runs in a continuous loop. I'm still unsure how Gideros works, but I think the only code that continuously gets read and updated is an event with event listeners. ???

    john26, thanks for the explanation of the colon, it helped, and the source for Nebula which will helpful in the future. Played the game today, fun, very challenging, and nicely done.

    ... and Disciple, thanks for the explanation of self (now I get it)
  • By the way, my answer to your initial question (a language similar to Lua & Gideros) would be JavaScript. http://www.w3schools.com/js/default.asp

    What kind of game/app are you making (or is it secret)?
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • Lua in Gideros:

    Your programme will only spontaneously, automatically be read once (from beginning to end). Any bare code will be executed automatically and immediately, and then forgotten. On the other hand, any code encapsulated within functions (i.e. any code between a corresponding pair of the words 'function' and 'end') will be saved to memory (instead of necessarily being executed immediately).

    Any given function will be executed only when its conditions (as specified by you) are met; and a function can be executed whenever you need it, as many times as you like.

    The condition for a function to be executed is often the occurrence of an event, which is why it is handy to only have your desired event listeners running constantly (as you mentioned above), instead of the whole programme looping constantly. The convenient/efficient aspect is that you can turn a listener on only when it is needed. For example, a 'mouse up' event can never occur unless preceded by a 'mouse down' event; so, even in a situation where you want to monitor ('listen' for) both events, you might as well only have the 'mouse down' listener running at all times, and only add the 'mouse up' listener in your mouse-down function (and then remove it again in your mouse-up function).

    Likes: ar2rsawseen

    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
    +1 -1 (+1 / -0 )Share on Facebook
  • Platypus, thanks for this explanation.

    I made PC games for friends/family for years with Blitz3D. But Blitz3D doesn't work with Windows 7-64bit so my hobby ceased a while ago. I usually only have time in the winter to write games, so I'm testing out some new languages for this coming season. Mobile apps are also new to me so I'm started new directions. I have some unique match-3 games that I thought would be fun to adapt to Android. I suspect that new ideas will develop as I learn a new language (that's the fun).
    What are you making with Gideros?
  • john26john26 Maintainer
    What @platypus says is correct but just to add a bit more description... When running, Gideros constantly goes round a main loop in which everything on screen is redrawn and then the ENTER_FRAME events are fired. There is constant alternation between these two tasks. This happens every 60th of a second normally. In parallel to this Gideros constantly checks to see if any other events are happening, such as MOUSE_DOWN events. If so it executes these immediately, which causes a tiny slowdown in the drawing loop.

    So you do not need to write the main loop yourself, everything happens in your listener functions (written in Lua). Any code in your program outside of these functions is executed on start up and is normally used to set global variables to initialize resources. Also, you need to register (some of) the listeners in global scope using addEventListener.

    Thanks for your kind words about Nebula Retro, I hope it helps you to learn more.
  • PlatypusPlatypus Member
    edited September 2014
    @PAC,
    I'm working on an e-book/comic, but...
    despite what I preached above, I keep getting distracted by other possibilities!

    I'm intrigued by the word 'unique' in the description of your games (above). Can't wait to play them!
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • Mells said this already, but you really need to get
    Gideros Mobile Game Development book by Arturs Sosins

    Not only the book is great and will jump start your game development (it comes with game framework), but also to support our awesome ar2rsawseen whose name you will see in pretty much every thread and he will be normally the first one here to help you out :)

    As for Lua, this is a nice short tutorial I really enjoyed and which will make you learn more about Lua:
    LUA: really for Beginners
    http://lua.gts-stolberg.de/en/?uml=1

    Likes: Platypus

    +1 -1 (+1 / -0 )Share on Facebook
  • PlatypusPlatypus Member
    edited September 2014
    I (and everyone else on this forum, I'm sure) agree with @boriskey!
    Please support @ar2rsawseen!

    I also highly recommend @WauloK's book. It's great:
    http://bluebilby.com/gideros-mobile-for-beginners-book/
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
Sign In or Register to comment.