Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Quick questions about Gideros&Lua - Page 11 — Gideros Forum

Quick questions about Gideros&Lua

189111314

Comments

  • antix said:

    Lua really needs a decent IDE like Visual Studio with drag and drop GUI creation.

    @antix aren't you satisfied with Widget Candy?
    It looks like really great solution.
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • antixantix Member
    edited September 2018
    @Apollo14 No file requester and no decent keyoard input are the issues here. Of course this isn't any flaw in Gideros since it is focussed on mobile development and doesn't need to include any such things by default :)

    Widget Candy is also around 9000 lines of code and is kind of clunky IMHO.
  • Apollo14Apollo14 Member
    edited September 2018
    Guys, sometimes I create classes not for reusability, but for readability only. How to do it right?

    For example it's a popular practice to create class like 'Enemy.lua'
    And then create many instances, like:
    local enemy1=Enemy.new()
    local enemy2=Enemy.new()
    etc.

    But it's convenient to also have separate class 'Boss.lua'
    though Boss will appear only once, and definitely it's more correct practice to make it a local object, not a global class
    but it's very convenient to edit its logic in a separate lua file

    Can 'require' method help somehow?
    If we create file 'includedStuff.lua', and exclude it from execution.

    Then we can
    require "includedStuff"
    but we can't access local variables that were declared inside 'includedStuff.lua'
    we can access only global variables that were declared there
    But these variables become local to current scene, they are not global at all.

    Is it better to include such files instead of creating global classes whenever possible?
    what are the pitfalls?
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • you can simply create a function instead of a class
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • oleg said:

    you can simply create a function instead of a class

    yes, but this function will be global

    we should avoid globals whenever we can, shouldn't we?
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • totebototebo Member
    edited September 2018
    In OOP it's cool creating a class for boss, even if it's just used once. If it, however, has similar properties to the enemy, one option is to create a base class for enemy and boss, and extend enemy and boss from the base class. OOP lovers rejoice!

    About the "includedStuff.lua", yeah that would probably be a little faster. But the difference would come down to accessing self variables vs. global. I don't think there is much in it.

    Likes: Apollo14

    My Gideros games: www.totebo.com
    +1 -1 (+1 / -0 )Share on Facebook
  • In most cases people go overkill on classes - the best thing to do is keep things simple...

    In an arcade game just have all your intelligent (enemy) sprites in the same pot. Loop through to do all the collision, etc - when it gets to their 'type' have a brain variable that if not null is the pointer to the function that calls their brain - call it with the pointer to the current sprite, so each sprite is basically the same, including bosses.

    In each 'brain' generate a joypad bitmap, this can be processed in the next stage of the main sprite loop (along with animation, debounce, etc - anything that is common).

    If you have enemies that are quite complex and have special moves (all mapped to it's own bit in the joypad bitmap), just have a second variable that points to a second function that's called if not nil - that can be 'action', it follows the brain call. It looks at the joypad bitmap and does whatever special action the 'brain' has told it to do,

    That way you can replace the 'brain' function with a different function that just gets the controller bitmap from a real joypad controller - instantly making it easier to test or add multiplayer.

    Likes: Apollo14

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Google console told me that I wrong set up the "achievements"

    I do not use achievements how to turn them off ??


    image.png
    382 x 256 - 21K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • You do all that on the google play console, not in Gideros.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • You do all that on the google play console, not in Gideros.

    No, the problem is issuing an apk file, not a console

    this error occurs when I enable ads and gaming plugins
    in my console I have game services turned off !!
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • @oleg probably you should export project for Android Studio and check logcat.

    I also can't make google gaming services work, not even auth (though it was working before). During last few days google's console has been pissing me off. I'm almost ready to give up on google's gayming services.

    Tomorrow I'll see what is happening there in logcat.
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)

  • @Apollo14 я мабуть неправильно написав англійською, в мене немає помилки в logcat

    в мене показує сповіщення в консолі що в файлі apk, у мене включені "досягнення"-я думаю це десь у плагіні прописано, мені потрібно їх виключити..
    22222.PNG
    974 x 235 - 26K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • @oleg I also had conflict when 'Ads'+'Gaming' plugins were together in project, it was in previous version of Gideros.
    Now I don't have this conflict, cause I can't even authorize :smiley:

    @oleg you can add in google's console one dummy achievement just for this case, and never use it in game.

    In my test projects I have dummy achievements, there's no such error in console.
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • I have projects with no achievements - but they work fine - no error.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • But, I realised I haven't submitted since the gaming plugin update - maybe something crept in? @hgy29 may know more.

    Likes: oleg

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Not much different in new gaming plugin except it now handles features previously only available in googleplay plugin, and it was updated to newest google apis

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • olegoleg Member
    edited September 2018
    @hgy29
    Previously, there was such a mistake, but I could turn off the "gaming " plugin and use only the plugin "ads"

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    But you still can disable gaming plugin, can’t you ? If you can’t, I mean if ads don’t work when gaming isn’t enabled, then it is an issue with ads plugin instead.
  • @hgy29 when I turn off "gaming", then "ads" causes an error when compiling in apk
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    I suppose it is specifically admob then, as it uses googleplay libs. Can you share the error it gives ?
  • hgy29 said:

    I suppose it is specifically admob then, as it uses googleplay libs. Can you share the error it gives ?

    oleg said:

    ads plugin shows error
    in the old version of Gideros there is no error
    what's the reason ??


    EDIT: "ADS" does not work without a "gaming" plugin

    C:\212121\mimimi Cat\07_09_18\mimimi Cat\tmp\app\src\main\java\com\giderosmobile\android\plugins\ads\frameworks\AdsAdmob.java:432: error:
     method does not override or implement a method from a supertype
    <a href="https://forum.gideros.rocks/profile/Override" rel="nofollow">@Override</a>
    ^
    Note: C:\212121\mimimi Cat\07_09_18\mimimi Cat\tmp\app\src\main\java\com\giderosmobile\android\plugins\ads\Ads.java
     uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
     
    FAILURE: Build failed with an exception.
     
    * What went wrong:
    Execution failed for task ':app:compileReleaseJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.
     
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
     
    * Get more help at <a href="https://help.gradle.org" rel="nofollow">https://help.gradle.org</a>
     
    BUILD FAILED in 10s
    Exec returned: 1
    Export failed! See details above.
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    @oleg, the issue you see has nothing to do with gaming plugin being enabled or not, it has to do with you trying to use an obsolete version of google play services in ads plugin. Try to use 12.0.1 or better

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • olegoleg Member
    edited October 2018
    @hgy29 - I am using 12.0.1



    21212.PNG
    739 x 186 - 32K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • Is there no application id ?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • edited October 2018
    As I see there is a commit here
    https://github.com/gideros/gideros/commit/d688638f70b33ac6fd891b0d2813acdf1370fc0d

    Recently, AdMob add one more function: onRewardedVideoCompleted that need to be implemented (@Override)

    I hope that is the main cause of the problem and then we will find out if AdsAdmob.java is up to date

    Likes: oleg

    Coming soon
    +1 -1 (+1 / -0 )Share on Facebook
  • olegoleg Member
    edited October 2018

    Is there no application id ?

    no

    and what should I write there?
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • SinisterSoftSinisterSoft Maintainer
    edited October 2018
    It's from google's game services (a link in the google play panel)...



    2018-10-01_16-20-28.png
    1389 x 693 - 125K

    Likes: oleg, antix

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+2 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Just had a try and admob compiles fine for me, even without google play enabled in gaming plugin
  • It's from google's game services (a link in the google play panel)...



    I have excluded gaming services in the Google console, so there's no ID

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    Could it be that you have googleplay plugin enabled too ? There are three plugins in which to set up google play services: gaming, googleplay (which should no longer be used), and ads (and firebase for those who have it). All these plugins must ask the same version of google services
Sign In or Register to comment.