Informacion para hacer highscore?

Hi Brent.

YES! that helps a lot!..

I’m just making this nice book, for Music Theory for kids, it’s going to be really nice, I think.

And I’m learning a lot, but I need a lot more.

Brent I have 1 questions to make my book really nice.

QUESTION 1 ---------  How do I make the – transition.to – show in the view ALL THE TIME?


----  MY CODE


local littleBees4 = display.newImage (“littleBees.png”)
    littleBees4.x = 410
    littleBees4.y = 220
    littleBees4:scale (.5, .5)
    transition.to(littleBees4, {x=429, y=130, time=7000})


----  I have some images that looks like little bees, and when I go to that “page” or file, the little bees move really nice

---- the FIRST TIME ONLY

---- When I go to another page and come back to the same one the second time

---- the little bees DO NOT MOVE

---- I have to relaunch the program, and then they move.


Thanks Brent for your help.

And I will make the book, and the in-App store purchase, I think I need a lot more to learn before I can make an app like that,

but will your help I’m sure I will be your best student, you’ll see.

Victor

If you’re using Storyboard, and you create the “bees” in the proper place (“createScene”, I would think), then they should appear and move every time you access that page. If they’re not, there is something wrong with your setup in Storyboard, for example, the bees are not being created in the correct area, or the transition is not being called at the proper time.

Brent

Okay Brent…

Here is the complete CODE in the file –


local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local widget = require “widget”
----------------------------------------------------------Buttons In The Page-----
local buttonWrong1
-----------------------------------------------------------1 Button = 1 Function–
local function buttonWrong1()
        storyboard.gotoScene( “level1Q1”, “crossFade”, 1000 )    
    return true
end
---------------------------------------------------------------CREATE SCENE--------
function scene:createScene( event )
    local group = self.view
----------------------------------------------------------ADD BACKGROUND------
    local background = display.newImage( “backgroundWrong1.png” )
    background.x = 225
    background.y = 155
    background:scale (.5, .5)
    
    local littleBees = display.newImage (“littleBees.png”)
    littleBees.x = 28
    littleBees.y = 30
    littleBees:scale (.5, .5)
    transition.to(littleBees, {x=167, y=37, time=6000})
    
    local littleBees1 = display.newImage (“littleBees.png”)
    littleBees1.x = 236
    littleBees1.y = 6
    littleBees1:scale (.5, .5)
    transition.to(littleBees1, {x=26, y=200, time=5000})
    
    local littleBees2 = display.newImage (“littleBees.png”)
    littleBees2.x = 173
    littleBees2.y = 65
    littleBees2:scale (.5, .5)
    transition.to(littleBees2, {x=325, y=210, time=3000})
    
    local littleBees4 = display.newImage (“littleBees.png”)
    littleBees4.x = 410
    littleBees4.y = 220
    littleBees4:scale (.5, .5)
    transition.to(littleBees4, {x=429, y=130, time=7000})
----------------------------------------------------------CREATE BUTTON--------
    buttonWrong1 = widget.newButton{
        defaultFile=“buttonWrong1release.png”,
        overFile=“buttonWrong1over.png”,
        onRelease = buttonWrong1
    }
    buttonWrong1.x = 410
    buttonWrong1.y = 280
    buttonWrong1:scale (.5, .5)
-------------------------------------------------------INSERT IN GROUP--------
    group:insert( background )
    group:insert( buttonWrong1)
    group:insert( littleBees )
    group:insert( littleBees1 )
    group:insert( littleBees2 )
    group:insert( littleBees4 )
end

function scene:enterScene( event )
    local group = self.view
end
function scene:exitScene( event )
    local group = self.view
end
-----------------------------------------------------------DESTROY SCENE-----------
function scene:destroyScene( event )
    local group = self.view    
    if buttonWrong1 then
        buttonWrong1:removeSelf()
        buttonWrong1 = nil
    end
end

scene:addEventListener( “createScene”, scene )
scene:addEventListener( “enterScene”, scene )
scene:addEventListener( “exitScene”, scene )
scene:addEventListener( “destroyScene”, scene )
return scene


Victor

Your transition is in createScene().  This means it only runs when the scene is created.  Once a scene is created, we keep it in memory unless either a) a low memory event is generated or b)  you explicitly purge the scene.   We do this because in many cases we assume you are going to come back to that scene and it’s more resource intensive and having the scene already cached helps performance.

So how do you get the transitions to run?  Move them to enterScene().  The createScene() happens before the scene transitions on screen anyway, so your transitions are starting before the scene becomes visible anyway.   Things that should happen every time you goto a scene that can wait until the scene is on the screen, should happen in enterScene().

Hi Rob: Thanks it works!

----------THERE IS ONE LITTLE PROBLEM------------

function scene:enterScene( event )
    local group = self.view
    
    local littleBees = display.newImage (“littleBees.png”)
    littleBees.x = 28
    littleBees.y = 30
    littleBees:scale (.5, .5)
    transition.to(littleBees, {x=167, y=37, time=6000})

group:insert( littleBees )

end


I change the bees to enterScene and when I come back to the scene, it plays the transition FINE,

but the little bees are still there when I come back, now I have a DUPLICATE IMAGE of each bee on the enterScene.

I try this on the exitScene - — I was just trying to use logic

function scene:exitScene( event )
    local group = self.view
    
    if littleBees then
        littleBees:removeSelf()
        littleBees = nil
    end

end

-------------------------- but that did not work.  it seems to work only on BUTTONS, I don’t know why.

So how do I remove the little bees from that scene?

So when I come back to the same scene it will play the animation normally?

Thank you

Victor

Hola Victor, 

En cuanto a la música que comentas, si te fijas en el código, cada vez que aprietas una tecla vuelves a instanciar el sonido. Creo que una buena práctica sería realizar la carga de todos los ficheros de sonido al inicio y luego ir haciendo los “play” del sonido que necesites en cada momento.

¡Saludos!

Gracias paytopwn:

Tengo tantas cosas en la cabeza, es la primera vez que veo – n_n – ya lo habia visto an otros codigos, lo mismo que – for i = 1 y cosas asi, pero la verdad ES MUCHO!

Mi cabeza ya me duele…

Quiere de verdad entenderle, pero no se como. Lo que veo es que la forma de ensenar de todos es como pensando que yo ya se, o que la persona que va a leer la respuesta ya sabe, pero la verdad es que NO SE!

Por ejemplo, me dijiste que para hacer que la imagen se adapte, use esto –


bg = display.newImage(“images/background/vertical/background_v.png”, 0,0, true)
        bg:scale(display.contentWidth/bg.contentWidth, display.contentHeight/bg.contentHeight)
        bg.x = display.contentWidth/2
        bg.y = display.contentHeight/2
        exerciseGroup:insert( bg )

y obtengo el n_n


Pero no le entiendo nada!

Puse ese codigo en mi EDITOR y sale esto

Attempt to index global ‘exerciseGroup’ (a nil value)

espero que me sepa explicar lo que digo, cuando tengo una pregunta, leo respuestas y todas ASUMEN QUE YO YA SE, y me dicen solo poquito, pensando que con ese poquito yo ya debo de saber o entender la respuesta, PERO NO SE!

No se si sepas musica, yo se musica muy bien, si me preguntas que cual es la escala de Fa, te digo, o solo fijate en el cuarto grado, y listo ahi esta el bemol…

y si no sabes musica te quedaste igual…

Asi estoy YO.

Que no hay una explicacion desde el principio en video y poquito a poquito explicando todo, punto por punto.

Gracias por tu ayuda

Si vas a mi web-site y ves CORONA SDK tutorials, asi como eso quiero encontrar un lugar

mi we-site es xyapps.com

Victor

Hola Victor: 

Nadie nace aprendido, y hay cosas que cuestan mucho de aprender (¡Nadie dijo que la programación fuera fácil :slight_smile: ! ) 

Algo que hay que aprender es a saber distinguir los diferentes errores que nos “escupe” la consola: 

Attempt to index global 'exerciseGroup' (a nil value)

Aquí se queja de que no existe el grupo “exerciseGroup”. Es una buena práctica poner los conjuntos de objetos dentro de un grupo en cuanto se instancian en pantalla creando un grupo que los vaya conteniendo, así al cambiar de escena es muchísimo más fácil gestionar todos los objetos del grupo (por ejemplo descargándolos de memoria). 

Un ejemplo para crear un grupo sería:

    local exerciseGroup = display.newGroup()

Si me vas comentando tus dudas, intentaré resolverlas :) 

¡Hasta ahora! 

Hi paytopwn:

No se si puedas ver este lugar aqui estan 3 videos con las dudas y preguntas que tengo. Gracias

http://forums.coronalabs.com/topic/34188-how-to-change-scenes/

Hi Brent, Dr. Burton, Saer, And all my friends at Corona Forum

I am working now on my book finally!!!

See, I told you, I did not needed a lot of things to start working, it’s a simple book for children.

I have the storyboard working, I have so far 4 pages, the home and the main.

I can add pages, make simple animation, and I can add sound to the buttons.

So I’m really happy because now I can keep learning more, but start making my app now

Thank you for all your help, thanks Dr. Burton for your book.


One question, I think it’s very important…

Once I finish my book which it’s for the iPad ONLY, and I can see the final book in the Corona Simulator in my Mac…

what I see in my computer will be the same, and it will look and behave exactly the same as in a REAL iPAD?


And one more…

About money – I have to pay $99.00 per year to Apple for the developer program to upload my app to the app store

to see if they accept it, right?

And how much money do I have to pay to Corona for using the program?

Is there any more fees or money involved?


Thank you for everything.

Let’s see how long it takes me to write my book

Victor

Hey Victor, 

Pretty much you get the same output in the simulator and in the real device - I’ve had little trouble with that.

About the Apple developer program, that’s needed even to compile for the device with Corona SDK, if I am right, and to publish on the app store. 

I am looking at the pricing of Corona SDK and I’m confused right now : http://coronalabs.com/products/corona-sdk/faqs/#subscriptions . We paid like 349$ for the license to be able to publish on android and iOS. It seems that they have changed that now :S.

Cheers! 

Let’s see…

$349.00 ONE TIME ONLY FOR LIFE?

$349.00 per year? per month?

If you want iOS and Android, but if you want only iPad?

I hope someone knows…

Victor

349$ per year, but it seems that it has changed now… 

They used to have a 179$ license to build for either iOS or android - if you want to build for iPad you’re gonna need to build for iOS :slight_smile: (and your app will probably be compatible with iphones too!) 

I hope someone else knows how it works now! 

Cheers! 

Hi Victor, @paytopwn,

The pricing change was announced about a month ago (April 4). Here’s the full link:

http://www.coronalabs.com/blog/2013/04/04/state-of-corona-new-public-release-free-re-imagining-pro/

To summarize, “Corona Starter” is now free. This applies to you, Victor… basically, you can develop and publish your book app(s) using Corona for free, for as long as you want. Before, it was free to “develop” but $199 or $349 per year to publish to the marketplaces (iOS or Android: $199 for one or $349 for both). Now with Corona Starter, that is free. You can also include your own custom launch/splash screen for your company/studio, which is a restriction on most other “free” platforms.

On the other side is “Corona Pro”. This applies to you, @paytopwn. Since you are already a Pro subscriber, and were before this past Wednesday (May 1), your price does *not* increase beyond $349 annually for up to 2 full years. New users who subscribe now, or in the future, will pay $599 annually. What Pro offers over Starter is, most notably: Plugins (to expand the core Corona functionality and features), In-App Purchases, Analytics, access to Daily Builds and prereleases, and full access to the upcoming Open GL 2.0 ES graphics features.

The blog post I linked describes this all in greater detail, but I hope this summarizes it.

Best regards,

Brent Sorrentino

Hi Brent

Let me see if I understand VERY CLEAR!

– --------------------------They said this --------------

Now, of course, not everything is free — we’ve got a business to run after all!

If you want to access certain specific features like in-app purchase
and analytics, you’ll need to subscribe to a paid plan. You can still
build with those features on your own device, but you can’t publish apps
to the store if they use those premium features. Daily builds are also
only available to paying subscribers.


– features like in-app purchase  – So I can, or I can NOT put my book (App) in the Apple Store? yes or no?

– and analytics, – This is just to see who gets your app or from where same as google analytics right?

---------------------HERE IT SAID THAT I CAN USE THOSE FUTURES (in-app and analytics)----------------

You can still build with those features on your own device – I REALLY DID NOT GET THIS PART

---------------------BUT HERE IT SAID THAT IF I USED THOSE FEATURES, I CAN NOT PUBLISH TO THE APP STORE ------

but you can’t publish apps to the store if they use those premium features – See it sais that I can’t publish apps

------------What are daily builds?----------------------

Daily builds are also only available to paying subscribers.

Please can you explain this a little bit better, my English may not be that great.

Thank you

Brent

P.S.

I’m on page 9 of the book

Hi Victor,

With the Corona Starter plan (free):

  1. Yes, you can publish your books in the Apple App Store (and Google Play, Amazon, or Nook markets). Again, this is free.

  2. You still  must pay for an Apple developer account. This is a requirement of Apple, not Corona. The price is $99 per year.

And with Corona Pro, you get:

  1. Analytics. These are basically as you say: information about your app users (location, which devices used, etc.)

  2. In-App Purchases: this allows users to purchase items from within your app (additions, extra features, etc.)

  3. Daily Builds: this allows you to use the most current (daily/weekly) additions and improvements to Corona.

  4. Plugins and the upcoming graphics improvements… you probably don’t need these at this time.

To summarize, you are fine with Corona Starter at this time. Learn Corona, develop some of your books, put them into the App Store, and then later you can decide if you want the additional features of Corona Pro.

Does that help?

Brent

Hi Brent.

YES! that helps a lot!..

I’m just making this nice book, for Music Theory for kids, it’s going to be really nice, I think.

And I’m learning a lot, but I need a lot more.

Brent I have 1 questions to make my book really nice.

QUESTION 1 ---------  How do I make the – transition.to – show in the view ALL THE TIME?


----  MY CODE


local littleBees4 = display.newImage (“littleBees.png”)
    littleBees4.x = 410
    littleBees4.y = 220
    littleBees4:scale (.5, .5)
    transition.to(littleBees4, {x=429, y=130, time=7000})


----  I have some images that looks like little bees, and when I go to that “page” or file, the little bees move really nice

---- the FIRST TIME ONLY

---- When I go to another page and come back to the same one the second time

---- the little bees DO NOT MOVE

---- I have to relaunch the program, and then they move.


Thanks Brent for your help.

And I will make the book, and the in-App store purchase, I think I need a lot more to learn before I can make an app like that,

but will your help I’m sure I will be your best student, you’ll see.

Victor

If you’re using Storyboard, and you create the “bees” in the proper place (“createScene”, I would think), then they should appear and move every time you access that page. If they’re not, there is something wrong with your setup in Storyboard, for example, the bees are not being created in the correct area, or the transition is not being called at the proper time.

Brent

Okay Brent…

Here is the complete CODE in the file –


local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local widget = require “widget”
----------------------------------------------------------Buttons In The Page-----
local buttonWrong1
-----------------------------------------------------------1 Button = 1 Function–
local function buttonWrong1()
        storyboard.gotoScene( “level1Q1”, “crossFade”, 1000 )    
    return true
end
---------------------------------------------------------------CREATE SCENE--------
function scene:createScene( event )
    local group = self.view
----------------------------------------------------------ADD BACKGROUND------
    local background = display.newImage( “backgroundWrong1.png” )
    background.x = 225
    background.y = 155
    background:scale (.5, .5)
    
    local littleBees = display.newImage (“littleBees.png”)
    littleBees.x = 28
    littleBees.y = 30
    littleBees:scale (.5, .5)
    transition.to(littleBees, {x=167, y=37, time=6000})
    
    local littleBees1 = display.newImage (“littleBees.png”)
    littleBees1.x = 236
    littleBees1.y = 6
    littleBees1:scale (.5, .5)
    transition.to(littleBees1, {x=26, y=200, time=5000})
    
    local littleBees2 = display.newImage (“littleBees.png”)
    littleBees2.x = 173
    littleBees2.y = 65
    littleBees2:scale (.5, .5)
    transition.to(littleBees2, {x=325, y=210, time=3000})
    
    local littleBees4 = display.newImage (“littleBees.png”)
    littleBees4.x = 410
    littleBees4.y = 220
    littleBees4:scale (.5, .5)
    transition.to(littleBees4, {x=429, y=130, time=7000})
----------------------------------------------------------CREATE BUTTON--------
    buttonWrong1 = widget.newButton{
        defaultFile=“buttonWrong1release.png”,
        overFile=“buttonWrong1over.png”,
        onRelease = buttonWrong1
    }
    buttonWrong1.x = 410
    buttonWrong1.y = 280
    buttonWrong1:scale (.5, .5)
-------------------------------------------------------INSERT IN GROUP--------
    group:insert( background )
    group:insert( buttonWrong1)
    group:insert( littleBees )
    group:insert( littleBees1 )
    group:insert( littleBees2 )
    group:insert( littleBees4 )
end

function scene:enterScene( event )
    local group = self.view
end
function scene:exitScene( event )
    local group = self.view
end
-----------------------------------------------------------DESTROY SCENE-----------
function scene:destroyScene( event )
    local group = self.view    
    if buttonWrong1 then
        buttonWrong1:removeSelf()
        buttonWrong1 = nil
    end
end

scene:addEventListener( “createScene”, scene )
scene:addEventListener( “enterScene”, scene )
scene:addEventListener( “exitScene”, scene )
scene:addEventListener( “destroyScene”, scene )
return scene


Victor

Your transition is in createScene().  This means it only runs when the scene is created.  Once a scene is created, we keep it in memory unless either a) a low memory event is generated or b)  you explicitly purge the scene.   We do this because in many cases we assume you are going to come back to that scene and it’s more resource intensive and having the scene already cached helps performance.

So how do you get the transitions to run?  Move them to enterScene().  The createScene() happens before the scene transitions on screen anyway, so your transitions are starting before the scene becomes visible anyway.   Things that should happen every time you goto a scene that can wait until the scene is on the screen, should happen in enterScene().