Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
How to "mix" Gideros and Eclipse codes?? - Gideros Forum

How to "mix" Gideros and Eclipse codes??

elcanuelcanu Member
edited February 2012 in General questions
Hi,
how i can "mix" the gideros code with my code in eclipse??

I have two questions..
I want to "get" a boolean variable from ""the game""(made with gideros) ant the end of the level, to make the rest of the game/app under eclipse.
How i can do this?

and

how i can "choose" the *.lua file (the level made under gideros) to launch the game engine (for example to do:
if (level1complete==false)
launchlevel(1)
, get/returns the "level1complete=true"

if (level1complete){
launchlevel(2);
};etc,etc.....??

I promise to buy a license before the launch =) !

Likes: gorkem

Regards from Spain.
Sorry for my English level.
+1 -1 (+1 / -0 ) Share on Facebook

Comments

  • So you want to interface your LUA code with your Android (Eclipse) code? Atm. there are no plugins possible for Android.
  • atilimatilim Maintainer
    Hi,

    As Mike said, we haven't support plugins for Android yet.

    But as far as I understand, in your case, you don't need to mix Android code and Lua code. For example, if you have a Game sprite that executes the main game logic, according to your level, create your Game sprite with the correct level within Lua.
  • I see that the language issue will give me more fuss to explain me =(

    well, when i export the project for eclipse,i get a entire folder with the "eclipse project part"(package com.giderosmobile.android + ""LabolitaActivity"" + the gideros project in assets folder)

    When the game starts (In the device or Android emu), it "calls" LabolitaActivity.

    i've made a "wellcome" layout, and a wellcome activity (wellcome.java) in package com.knu.labolita, added the activity in the manifest and set the .Wellcome activity with the launch option.

    i add a "launch button" in the wellcome activity:

    botonlaunch=(Button)findViewById(R.id.botonlaunch);
    botonlaunch.setOnClickListener(new OnClickListener() {
    private Intent showMedia;

    public void onClick(View arg0) {
    showMedia = new Intent(Wellcome.this, LabolitaActivity.class);
    startActivity(showMedia);
    }
    });
    ---

    I can "launch" the gideros part using this button, but i can't "choose" the *.lua(level) to load. How i can add a parameter to change the lua to load?

    and then, is impossible to "return" any variable from the Gideros part, and return to WellcomeActivity?

    Regards from Spain.
    Sorry for my English level.
  • @elcanu: I repeat myself here. At the moment, you can not call lua code from your Android code. Same goes for the opposite direction. All your logic has to be done inside LUA.
    Just out of curiousity. Why do you want to control loading a level from inside the android code?
  • Because:

    -I "know" Eclipse, i can made the app that is in my mind,in gideros i made the first level "easily", but in a week and two days the game is "stoped", i don't know how to make th ethings in thinking. For example; Change levels (u.U), save and read preferences to "know" the completed levels and make a menu....and so much things.

    -Screenresolutions: for me, is more easy make a game and "auto-fit it" with the weight variables in my layouts.

    Well,.... the truth is that I lost "the illusion" that had the early days, I'm glad did not buy the license prematurely, now re-shuffle esotoy ways of working.

    Taking 2dbox under eclipse ..... that I can solve quite a few doubts in this forum, unfortunately, no one can / know how to answer
    Regards from Spain.
    Sorry for my English level.
  • atilimatilim Maintainer
    edited February 2012
    I'm sorry to hear that.

    As you know we haven't introduce the plugin system for Android yet. On the other hand, I'm not sure if plugins will solve your problems.

    Lua provides a simple but powerful file IO system that you can use within Gideros: http://www.lua.org/pil/21.2.html So that you can save the state of your game and then load later. Also loading and saving tables is a great way to persist your state: https://github.com/gideros/table.save

    Also using box2d within Gderos is easy. I'm sure it's much more easier than using it in eclipse/java. You can look at the examples coming at Examples/Physics folder.

    Anyway, our product doesn't (cannot) fit everybody's needs at the same time. Hoping that you will continue to use Gideros.

    best,
  • elcanuelcanu Member
    edited February 2012
    Yes, is easier because the game engine is "maded", but the problem i have is i don't know nothing about LUA; i'm making android apps since august of past year, and i learn the Android SDK (Not fully =( ) without anyone help, reading and reading stack overflow for hours and triying to implement new functions.......that's my learning process.

    With Gideros, the same.......but isn't the same look for "eclipse/java" info thank look for gideros problems,forums and/or questions and responses.


    Gideros seems to be a good SDK with a great future, but for now, is not so easy for a amateur triying to make his first game under a SDK like this.

    Programming is not impossible for anyone.....but i'm viewing that my "level" isn't enough to made "nothing famous and well done".

    for now, i'm condemned to make wallpapers apps =(
    Regards from Spain.
    Sorry for my English level.
  • @elcanu - I have the same frustration, that I am confident in Objective C for the iPhone - also self-taught, but I am not yet good at Lua.

    You should look at The Ultimate Guide to Gideros Studio:

    http://giderosmobile.com/DevCenter/index.php?title=Ultimate_Guide_to_Gideros_Studio

    There is good information in chapter 3, although it is not yet complete.

    Also, the Wikipedia article on Lua programming is a good summary.

    I think it does take a while to become fluent in a language, though, and takes a lot of practice. My belief is that for me it is worth putting the time in now, for future time saving.

    If it were easy, everybody would be doing it :).
    +1 -1 (+2 / -0 ) Share on Facebook
  • If it were easy, everybody would be doing it :).
    =D>
  • :)>-
    Regards from Spain.
    Sorry for my English level.
Sign In or Register to comment.