

I understand that we access class variables and class methods with self word but I am not so sure why we need to pass another self to self:addEventListener function (if you know let me know in comments, I am still learning). The code is pretty much copy/paste from or previous ball example except that we access variables and methods with self (it is also used instead of word ball). Now lets take the code from previous tutorial and turn it into what we learned today. In above example we put all the code in a but we could take all the (class,methods.) code (line 1-18) and put it in a file and the rest we would leave in a. NewPlayer = Player.new() -create new Player instanceĪnotherPlayer = Player.new() -another Player instanceĪs you can see, in the and it looks similar to OO in other languages. Print("Player Walking - health:", self.health) this is a Walk method of a Player class do the initialization of Player instance,we set custom variables init() function is called automatically when we create(instantiate) new Player Player = Core.class(Sprite) - we create our own player class, inherited from the Gideros Sprite core class Keyword self is the equivalent of the this pointer in C++ and it is a reference to the table which is created as part of the Class.new() command. We can inherit from Sprite, EventDispatcher and so on. We use the Core.class function to create our own classes through inheritance. Then we put these classes into their own files and Gideros will load them automatically. It is through the inheritance that we can “emulate” the classes just like in other languages – they will have variables, methods etc. In Lua, each object can define its own behavior through metatables so in a way we emulate OO programming and classes in Lua.Ĭreating instances is easy through a new function: local sprite = Sprite.new() It has roots from prototype-based languages. I will not go into details about Lua language but in short, Lua does not support classes the way that languages like C++, Java and ActionScript do.
#GIDEROS APPS HOW TO#
How to avoid this and make it more universal, more reusable? Classes & Instances Even the functions are written in a way that they call “ball” methods directly. In previous example if we wanted to add more balls we would have to add several lines of code for every ball we add – like creating new bitmap, setting new position, anchor etc.

We’re working hard to provide a consistent user interface experience, and committed to supporting more and more devices in the near future, together with Flash export and OpenGL export, in order to run the application on a browser also.So far we put all the code in one file. Gideros Studio provides a free-to-use IDE and SDK, so developers can write once and deploy it on a variety of devices using a Flash-like interface.
#GIDEROS APPS PORTABLE#
Gideros Mobile is for mobile developers who want to build graphically rich, native and portable applications and games with 2D acceleration. The screen of the device with high performance, building code whichĮxecutes in the native machine format of the target processor (e.g iPhone, iPad and Android) Who is it for? Gideros Studio allows programmers directly interact with It allows developers easily build, test and deploy their mobile applications to a variety of devices.
#GIDEROS APPS SOFTWARE#
Gideros Studio is a mobile software development environment.
