Level director tutorials

Ah, sorry, I think you’re using the wrong export type, change it to ‘From Template’ and locate the ‘Corona_templateG2.lua’ file from the Level Director installation folder under templates.

I think this will resolve all your issues  :slight_smile:

Can’t seem to find that file.

I’ll take a look again, I’ll be back in about 2 hours, I’ll let you know :slight_smile:

Thanks for the help so far, pal!

I must be some kind of an idiot, I can’t find that file

The only thing I see in the LD Installation folder is the " Examples " folder…

I finally found it, hehe. Thanks

Excellent, let me know how you get on.

Is there a way to let a player draw a bezier ? 

Do you mean via the app i.e. outside of Level Director?

In theory you could let the player plots points and then create the Bezier via the createobject function, passing in the correct params.

I mean if I make a game, were the objective is for the player to draw a line so the ball can get to the " finish line etc " 

Just a example

 

Hi

I’m just fooling around with LD and Corona.

I got one question, I’m just trying to get a BG picture to show up on the Corona Simulator.
But I can’t get it to work, going insane!

Here’s my main.lua code : 

 

display.setStatusBar( display.HiddenStatusBar ) local LD = require ("lib.LD\_LoaderG2") local myLevel = {} myLevel = LD:loadLevel("Level01")

Here’s my Config.Lua code : 

 

application = { content = { fps = 60, width = 320, height = 480, scale = "zoomStretch" }, LevelDirectorSettings = { imagesSubFolder = "images", levelsSubFolder = "levels", } }

I’m getting this LONG list of errors, when I try to open it in the SIM.

Do you have any idea why ? 

Hi, 

Please email me your project and I’ll take a look for you.

What errors are you getting?

Also a quick check list (based on your config file);

  1. Export type = ‘From Template’ and you have specified the ‘Corona_templateG2.lua’ as the template
  2. Your images exist in the ‘images’ sub folder of your project e.g. myProject/images
  3. In project settings your export folder is set to ‘levels’

Also I created a quick start guide which may help;

http://www.retrofitproductions.com/level-director/quick-start-guide/

This is so basic, and yet I can’t figure it out

I’ve made a Project folder called " Test " and in the test folder I have these files / folders 

Images
Levels
Lib
Config.Lua
Level01.LDF
Main.Lua

904y2g.png

You haven’t started physics.

Add these 2 lines at the top of your code

local physics = require ("physics") physics.start()  

It should then work.

Yes, thank you.

Only thing is that the SIM doesn’t go in Landscape mode.
I’m sure I’ll figure it out, I don’t want to bother you with everything.

Thanks mate!

2 more question’s

I’m trying to make something myself of the " PottyBird " Project.

I see when I’m looking trough the PottyBird project, that the “Crabs” are in the object class Enemie.
How do you make a object class ? 

I also tried adding the bird in my project, all the pictures and the XML are in my /Images folder.
But when I try it in the simulator the bird doesn’t appear ?

I’m feeling I’m getting a hang of this, only got these questions.

Thanks again!

To setup class names, go to tools->options->project

Here you will see a grid where you can type your class names.

Against the asset properties you will then see a dropdown list containing your newly added class names.

Each instance of an object will then inherit this class, you can override it though.

The bird was created using Texturepacker, did you import it via the xml file and placed the first frame on the canvas?

Yes, I imported it via the XML file, and I placed the bird on the screen.

Edit:

Got it to work!

Excellent, what was the problem?

I don’t know what the problem was.

I simply just deleted the bird, and placed it on the canvas again!

I’m also trying to get the screen to scroll as on the " PottyBird " example.

I’m guessing this is the code : 
 

local function move (event)

   myLevel:move(3.0,0)

   end

   

   Runtime:addEventListener( “enterFrame”, move )

When I write that in Main.Lua nothing really happens ? 

and one more question, If I want something like " flappybird " when I tap the screen the bird goes up.

Do I write code in " Level01.lua" or do I write the code in Main.lua ? 

Thanks

For scrolling, you need to enable it first on the level.

Click on the level (grey margins) to see the level properties and set ‘ParallaxEnabled’ = true

Then click on the layers you want to scroll and set the Parallax speeds e.g. 1.0

Once exported the move function should work.

Also note if you want the layers/objects to wrap you must have images across at least 2 screen widths so they can wrap onto the offscreen portion.

Load the PottyBird example in LD to see how it was done.

All your user coding should go in main.lua or sub modules, not your exported LD file as this is always replaced when exported.

To add a tap listener, simply get a local copy of your bird and add the listener e.g.

local bird = myLevel:getLayerObject("layer1","bird").view local function moveBird(event) end

Runtime:addEventListener(“tap”, moveBird)

You just need to add code in the moveBird function based on the event.x and y values.

Hope this helps.

I’ve been trying to do this " tap " function, I don’t really understand.

 

local bird = myLevel:getLayerObject("layer1","bird").view

“layer1”   I’m guessing I have to change that, because my bird is in a layer called " bird " ?

 

local function moveBird(event) myLevel:moveBird(x.y) end Runtime:addEventListener("tap",moveBird)

am I on the wrong track here or ?