Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Informacion para hacer highscore?
Started by Jonytexas Feb 17 2013 10:10 PM

46 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

helloworld2013d

[GLOBAL: userInfoPane.html]
helloworld2013d
  • Contributor

  • 664 posts
  • Corona SDK

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



[TOPIC: post.html]
#27

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

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



[TOPIC: post.html]
#28

helloworld2013d

[GLOBAL: userInfoPane.html]
helloworld2013d
  • Contributor

  • 664 posts
  • Corona SDK

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



[TOPIC: post.html]
#29

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

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



[TOPIC: post.html]
#30

helloworld2013d

[GLOBAL: userInfoPane.html]
helloworld2013d
  • Contributor

  • 664 posts
  • Corona SDK

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



[TOPIC: post.html]
#31

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

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().



[TOPIC: post.html]
#32

helloworld2013d

[GLOBAL: userInfoPane.html]
helloworld2013d
  • Contributor

  • 664 posts
  • Corona SDK

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



[TOPIC: post.html]
#33

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Hi paytopwn, I follow your instrutions and I have an error:

 

"attempt to compare number with table"

 

I am really sure about this error is using the librarie that you say... but I dont know how fix it... if you can give me some help I will really apreciate it...

 

Thx :)

Sorry for my english :P



[TOPIC: post.html]
#34

paytopwn

[GLOBAL: userInfoPane.html]
paytopwn
  • Enthusiast

  • 30 posts
  • Corona SDK

Hey jhsanchez,

 

Can you post your code so we can take a deeper look into it? 

 

Cheers! 



[TOPIC: post.html]
#35

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

SURE :D

 

On my game code:

 

game.lua :

 

 
 
-- Requerimientos
 
 
 
local physics = require "physics"
 
physics.start()
 
 
 
require "sprite"
 
 
 
local storyboard = require("storyboard")
 
 
local scene = storyboard.newScene()
 
 
local preference = preference -- cargamos fichero de preferencias
 
 
local score -- puntuacion actual del jugador
 
 
 
-- Fondo
 
 
 
function scene:createScene(event)
 
 
    local output = display.newText("0",0,0, native.systemFont, 20)
 
    output:setTextColor(255,255,255)
 
    output:setReferencePoint(display.BottomLeftReferencePoint)
 
    output.x = 430
 
    output.y = 300    
 
 
function PararReloj(esto)
    
 
    timer.cancel(tmr)
 
    transition.to( output, { time=3000, alpha=0 } )
 
 
 
    score = output
 
 
 
    maxScore = preference.getValue("highscore") -- guardamos la puntuación máxima en maxScore
 
    
 
      if score > maxScore then -- miramos si la puntuación que hemos realizado es superior al máximo guardado
 
              
 
        textoScore = display.newText("",240,175,"Helvetica",25)
 
        textoScore:setTextColor(255,255,255)
 
        textoScore:setReferencePoint(display.BottomLeftReferencePoint)
 
        textoScore.text="You have a NEW RECORD (secs): "..esto
 
        transition.to( textoScore, { time=3000, alpha=0 } )
 
            preference.save{ highscore=score}
 
 
 
      else
 
        textoScore = display.newText("",240,175,"Helvetica",25)
 
        textoScore:setTextColor(255,255,255)
 
        textoScore:setReferencePoint(display.BottomLeftReferencePoint)
 
        textoScore.text="Your time was (secs): "..esto
 
        transition.to( textoScore, { time=3000, alpha=0 } )
 
            preference.save{ highscore=score}
 
 
 
      end    
 
        
 
           
 
end
 
 
ON MY MAIN:
 
display.setStatusBar(display.HiddenStatusBar)
 
 
 
preference = require "preference"
 
 
 
preference.save{ highscore = 1} --preference highscore
 
 
local storyboard = require "storyboard"
 
storyboard.gotoScene("start")
 
-------------------------------
 
 
THANK U 4 YOUR HELP :D


[TOPIC: post.html]
#36

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

The error apears here:

 

 if score > maxScore then -- miramos si la puntuación que hemos realizado es superior al máximo guardado



[TOPIC: post.html]
#37

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

Here is the problem:

 

score = output
maxScore = preference.getValue("highscore")

 

What is "score"?   Score is a copy of a display object named output.  It is not a number.  Display objects are a table.  Most likely what you want is:

 

score = output.text



[TOPIC: post.html]
#38

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Hi Rob, thank you for your time... With that correctcion I have the error... "attempt to compare number with nil" :/



[TOPIC: post.html]
#39

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

You need to make sure that you are not overwriting output somewhere else that's not the display.newText() that you're creating a few lines above



[TOPIC: post.html]
#40

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Yeah! You have reason, thank you so much... Now I can save my local highscores :D... Now I will work on the global highscores with corona cloud... wish me luck :D!



[TOPIC: post.html]
#41

paytopwn

[GLOBAL: userInfoPane.html]
paytopwn
  • Enthusiast

  • 30 posts
  • Corona SDK

Good luck jhsanchez ;)

 

I'm glad you've already solved that ! 



[TOPIC: post.html]
#42

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Rob and paytopwn I have a problem with local records... the game save the records correctly when I use the app butttt... when I close the app and start over again the records has restarted... Exist some solution for this? Thank you so much for your help... Regards.



[TOPIC: post.html]
#43

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,801 posts
  • Enterprise

You need to save the data to a file in your app's file system space.  I don't know much about the library you are using to track the information, so I really can't help too much.   There are several saving data entries in the community code.



[TOPIC: post.html]
#44

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Oh :/...

I have all the day readding the docs for the library but I dont understand whats going on...

Paytopwn... I hope you can help me.

[TOPIC: post.html]
#45

paytopwn

[GLOBAL: userInfoPane.html]
paytopwn
  • Enthusiast

  • 30 posts
  • Corona SDK

If you've followed my original code you'll see that some of the data is saved as preferences - then it's possible that you're overwritting on every execution of your game all the values (in other words, every time you start your game you clear all your saved scores to the initial value you have in your code). 

 

preference.save{ highscore = 1} --preference highscore

If that's what you have in your main, you have no condition to check if there's a higher score saved, and a simple solution would make an if statement to check if that highscore is greater than 1 (meaning that you've have saved something before). 

 

What Rob says about using a file instead of a preference sounds better, even though using the way you have it would be easier. 

"Programar es como conducir, cada uno lo hace como quiere" 



[TOPIC: post.html]
#46

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

Si amigo, efectivamente ayer me di cuenta de ese terrible error y ya pude corregirlo :D! Muchas gracias bro, saludos :)



[TOPIC: post.html]
#47

helloworld2013d

[GLOBAL: userInfoPane.html]
helloworld2013d
  • Contributor

  • 664 posts
  • Corona SDK

Hi everyone

 

I start it this post back on February 2013, we are now in July 2013 and still I can not put a score in action.

 

anyone has a "very simple sample code in storyboard so I can see how to "hold a score in a variable"

or something that keeps track of the points, when I do something in the program?

 

thanks




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]