Any idea when v1.2 might come out?

Hi Ricardo,

Just a quick question on when you might be releasing the next big upgrade rolling in all the fixes that has been discussed on the forums. Hardly can wait!

Thanks for all your hard work. I would be very happy to pay for Director should you choose to turn it into a commercial product eventually.

Cheers [import]uid: 11904 topic_id: 5872 reply_id: 305872[/import]

Hi there,

Man, I really want to release it as soon as possible but I’m out of time with my main job, my projects and helping people with Director. My first game with Corona is at the final stage finding little bugs and then I will work on an app that uses swipe like some magazines at the app store.

Here is a little preview of the book feature:

director:newBook( { "page1", "page2", ... , "pageN" } )  

At the pageN.lua files you will just need to put this code:

local background = display.newImage("background.png")  
background:addEventListener( "touch" , director.bookEvent )  

And that’s it! [import]uid: 8556 topic_id: 5872 reply_id: 20119[/import]

Hear you loud & clear. All the best with the challenges ahead. Thanks for all that you are doing for this community. The new capabilities sound awesome. Can’t wait. [import]uid: 11904 topic_id: 5872 reply_id: 20526[/import]

Any news? [import]uid: 9371 topic_id: 5872 reply_id: 22327[/import]

I’m having a lot of problems with it and doing a hard work on it. I’m thinking on releasing it only with the bug fixes and postpone the book feature. What do you think about it? [import]uid: 8556 topic_id: 5872 reply_id: 22663[/import]

Hi Ricardo, sorry to hear about the trouble but I know how it goes. I think releasing a bug fix update that covers all the stuff that you’ve been fixing along the way and leaving the book feature for later is an excellent idea! Hope you can make it happen. Thanks much! [import]uid: 11904 topic_id: 5872 reply_id: 22664[/import]

+1 [import]uid: 9371 topic_id: 5872 reply_id: 22667[/import]

Done!

http://developer.anscamobile.com/code/director-class-10 [import]uid: 8556 topic_id: 5872 reply_id: 22680[/import]

Thanks Ricardo :slight_smile: [import]uid: 6981 topic_id: 5872 reply_id: 22685[/import]

Amazing!!! Thats was real quick! Thanks much. Getting it now. [import]uid: 11904 topic_id: 5872 reply_id: 22686[/import]

Please let me know if you find any issue. [import]uid: 8556 topic_id: 5872 reply_id: 22689[/import]

Please let me know if you find any issue. [import]uid: 8556 topic_id: 5872 reply_id: 22690[/import]

Many thx for the release.

Sorry, but I haven’t found the release infos, to see what you have changed.

I have also noticed big changes in your samples codes (main, screens and template) : could you explain thoses ? [import]uid: 9328 topic_id: 5872 reply_id: 22736[/import]

All the major updates were at the memory management and cleaning scenes.

1 - Now you don’t need to modify Director to use the clean function, Director will search for it and if it find then will execute it.

2 - Cleaning scenes are divided in 3 steps:
2.1 - Execute the clean() function if it exists
2.2 - Remove all display objects inserted into the localGroup
2.3 - Unload the module and call the garbage collector

3 - I added a “safe time delay” to start transitions without crashing.

4 - You can change the effects time and safe delay via programming.

5 - There are 3 new transitions on changeScene:
5.1 - moveFromTop
5.2 - moveFromBottom
5.3 - crossfade

6 - A lot of people asked me about changing scenes like a book. I tryed to do it on this version but it is very hard to do. So, I put on the sample a little slider to see how to use moveFromLeft and moveFromRight to feel like a book.

7 - All the files on the sample are better structured and have the initVars() function to show how to start your variables values and use it on a pause or restart function.

8 - There is a boolean variable to prevent change scenes while it’s still changing a scene. [import]uid: 8556 topic_id: 5872 reply_id: 22751[/import]

Thx for the answer.
Looking at your template.lua :

  • I don’t see anymore the “–Put your code here–” : your new organisation let us put page code anywhere ?
    [import]uid: 9328 topic_id: 5872 reply_id: 22762[/import]

You can follow the comments! The only things that you have to do is a new() function returning a localGroup and insert all your display objects into this localGroup.

With this new template, I’m suggesting a good structure to code your games. If you don’t want all those comments, you can cut them off without any problem. This is a common practice at big enterprises to have a clean code that anyone can see and understand easily. [import]uid: 8556 topic_id: 5872 reply_id: 22807[/import]

EDIT: Never mind. I hadn’t clicked your link yet, so didn’t realize you were updating the official Director page.

Hi! Any way for you to create a “sticky” forum topic so that we can go to one topic at the top to find your latest update (or find any “official” comments you’ve made about your great product)?

Thanks for all your hard work! [import]uid: 25480 topic_id: 5872 reply_id: 22827[/import]

I’m thinking on doing other video with some tricks to build an app with Director, any suggestions? [import]uid: 8556 topic_id: 5872 reply_id: 22921[/import]

This is a common practice at big enterprises to have a clean code that anyone can see and understand easily.>

It’s exactly because of this, that I want to understand your template.lua :slight_smile:

Your experience is a gem, and I’d really like to understand and follow the code structure you - so kindly- hint.

Moreover, director class deals with scene management, aka page organisation, aka code structure !
Therefore, I really think following your advice is a good thing.

Though, I must admit that the new template.lua is harder to understand than the previous. I guess I’ll have to test/sample code to better understand initvars stuff and other things (like the listeners at the beginning of the code page).

Anyway, thx for your work ! (I’m one of those who would pay for this class :slight_smile: [import]uid: 9328 topic_id: 5872 reply_id: 22998[/import]

Thanks Antheor!

The new template is not so different of the other, it’s just separated in “blocks”. Let’s go block-by-block.

1 - GROUPS

Here you can declare all groups that you will be using on the scene. Imagine if you have a game scene and you have a pause screen. You can divide them into 2 groups. All objects of the game you have to insert into the gameGroup and the objects of the pause menu into the pauseGroup. Also, these new groups must be inserted into the localGroup.

---------------------------------------------------------------  
-- GROUPS  
---------------------------------------------------------------  
  
local localGroup = display.newGroup()  
local gameGroup = display.newGroup()  
local pauseGroup = display.newGroup()  

2 - DISPLAY OBJECTS

Here you can declare all your images, animations, buttons and vectors. Why declaring them here? Just because we will declare our functions after this and with this prevent referencing null pointers. This is what happen when you declare a function before the variable, Corona will not recognize the variable because it doesn’t exists when the function was created.

---------------------------------------------------------------  
-- DISPLAY OBJECTS  
---------------------------------------------------------------  
  
local background = display.newRect(0,0,320,480)  
local player = display.newImage("player.png")  

3 - LISTENERS

This is just where I put all my functions that will be added to graphics as listeners using the command addEventListener. Just remember to put the functions in order to prevent null pointers as I told in the section 2 here.

---------------------------------------------------------------  
-- LISTENERS  
---------------------------------------------------------------  
  
local function touched ( event )  
 if event.phase == "ended" then  
 local showFx = transition.to ( player, {x=event.x, y=event.y, time=500} )  
 end  
end  

4 - INIT VARS

This is just to organize everything on the screen, setup colors and add/remove the listeners to begin the level. When you want to restart a game, you want to everything be as when you load the scene, ok? That’s is what this function have to do.

---------------------------------------------------------------  
-- INIT VARS  
---------------------------------------------------------------  
  
local function initVars ()  
  
 -----------------------------------  
 -- Inserts  
 -----------------------------------  
  
 gameGroup(background)  
 localGroup:insert(gameGroup)  

5 - CLEAN

Here you can stop timers, remove listeners and all other things you want to do before changing the scene to prevent errors. You don’t need this but if you have, Director will call it from the changeScene function.

---------------------------------------------------------------  
-- CLEAN  
---------------------------------------------------------------  
  
function clean ( event )  
 Runtime:removeEventListener ( "enterFrame" , gameTime )  
end  

6 - NEW

Well, I don’t have to say anything about this function, you all know what it is and how to use it. Just never forget to return the localGroup.

[code]


– NEW

function new()


– Initiate variables

initVars()


– MUST return a display.newGroup()

return localGroup

end
[/code] [import]uid: 8556 topic_id: 5872 reply_id: 23004[/import]