So i currently have a “loading” screen for my game that i built a good while ago, but in reality all it is, is a screen that says loading and then changes director scenes to my level, and then it still has a black screen because it wasnt really loading my level at all during the “loading” screen. I have looked around and i cant seem to find how to get it to load my level while the loading screen plays ontop. Would i have to include my loading screen in my actual Level.lua file? If i did it this way, seems like it still would go to black screen to load my Level.lua before even displaying my loading screen. Any tips or ideas are appreciated thanks. [import]uid: 19620 topic_id: 8721 reply_id: 308721[/import]
I just used this set up in the game I’m working on and it seems to be running a lot smoother - http://developer.anscamobile.com/code/preloader
I’m having an error when I run it that I don’t know how to fix but it isn’t affecting the gameplay. This is what I’m getting:
Runtime error
…fRsa+Y19VU+++TI/-Tmp-/TemporaryItems/97/director.lua:118: attempt to call field ‘new’ (a nil value)
stack traceback:
[C]: in function ‘new’
…fRsa+Y19VU+++TI/-Tmp-/TemporaryItems/97/director.lua:118: in function ‘loadScene’
…fRsa+Y19VU+++TI/-Tmp-/TemporaryItems/97/director.lua:334: in function ‘changeScene’
…Rsa+Y19VU+++TI/-Tmp-/TemporaryItems/97/preloader.lua:10: in function ‘_listener’
?: in function <?:441>
?: in function <?:214> [import]uid: 14032 topic_id: 8721 reply_id: 31819[/import]
ok ill have a look at that for sure thanks [import]uid: 19620 topic_id: 8721 reply_id: 31826[/import]
You can make a loadlevel1.lua loadlevel2.lua ect or levelx.lua (what ever you want
to call it) and while you are in your loadlevel.lua you can display a image says
loading and code a Timer Perform With Delay and you put a certain amount of time
for example 5 secs so when the 5 secs are up director changes scene to the level
you intended to go. I believe in the GhostVsMonster Sample code you can see
for yourself how to do this.
~Best Of Luck from LeivaGames [import]uid: 30314 topic_id: 8721 reply_id: 32488[/import]
Are you using the newer audio api?
I know that question seems like a non-sequiter, but the reason I ask is that the main thing that would cause a pause for loading are large sound files like background music. The newer audio api has a loadStream command that is really fast (or rather, the stream loads in the background without pausing everything else.)
Graphics load pretty much instantly; I never experienced any loading times at all until I started implementing audio. [import]uid: 12108 topic_id: 8721 reply_id: 32492[/import]
umm honestly im not sure if i am. i havent added any sounds until just yesterday. (just trying some out) Could it be because im playing it on Android? i am a windows user, not sure if i mentioned that. as for sounds, i have been using media.playEventSound(). which seems to work ok. what is the new Audio API?
thanks [import]uid: 19620 topic_id: 8721 reply_id: 32493[/import]
That is the older audio api. Anything that starts “media” is the older api. The newer api is “audio”
http://developer.anscamobile.com/reference/audio [import]uid: 12108 topic_id: 8721 reply_id: 32500[/import]
perfect, as always thanks jhocking, hopefully this will work well for me [import]uid: 19620 topic_id: 8721 reply_id: 32505[/import]
I did not notice there is a new audio api lol does corona still
read media. or now just audio? Reason I asked my last game
which is in app store was made using media. since the new
api is audio If I try to update my app will media still work?
Or I need to change it to Audio? Also is the change from
media to audio anything else beside the name, does it performs
faster/better?
Thanks in Advance,
LeivaGames [import]uid: 30314 topic_id: 8721 reply_id: 32541[/import]
Check out the link that hocking gave, it gives some details that explain how Audio is better than using media. And from what i understand it does perform faster and better. check it out [import]uid: 19620 topic_id: 8721 reply_id: 32542[/import]
@ rxmarccall
Thanks I already checked it out But is a “work in progress” And my main
question is if I need to change media. to Audio. when I update
my game in next few days. Or media. still works fine? The link is great
to show you the new api but I just dont see anything there to answer
my question. Thanks in advance to anyone, If I dont have a specific
answer to my question once I update my app I will share my experience
so anyone who has or might have same question can learn from this thread.
Thank You,
LeivaGames [import]uid: 30314 topic_id: 8721 reply_id: 32544[/import]
You don’t have to switch from “media” to “audio” but you may want to because “audio” is so much better. I suspect that “work in progress” notice is just them not having updated the docs because it’s said that for as long as I’ve been using Corona. I use “audio” in my game and have hit exactly one minor bug with sound and that was pretty easy to overcome just by changing a sound file. [import]uid: 12108 topic_id: 8721 reply_id: 32548[/import]
So i just changed over to using Audio, and it seemed to work fine in the simulator, but building to device my app now crashes, so that would probly be why its a work in progress. Any other android users let me know how it goes for you [import]uid: 19620 topic_id: 8721 reply_id: 32552[/import]
oooh android right I keep forgetting about that [import]uid: 12108 topic_id: 8721 reply_id: 32556[/import]
Nevermind, its still crashing, something else going on in my code =p [import]uid: 19620 topic_id: 8721 reply_id: 32557[/import]
@ jhocking
Thanks for Response I guess that answers the “Work in progress” lol
I guess when I do the update ill try switching and see results hopefully
no crashes, but is still nice that media. still works. But if Audio is a lot
better then I guess is a much better choice.
[import]uid: 30314 topic_id: 8721 reply_id: 32566[/import]
Update: While working on my update I notice I been using
audio not media lol so I assume media. is older then when
I started programming. But this was an interesting thread [import]uid: 30314 topic_id: 8721 reply_id: 33170[/import]
Also, i am now using the latest build of corona sdk for windows and using Audio. seems to be working fine now. ill update in the future once i have alot more going on in my app with sound. seems to be working good for now! [import]uid: 19620 topic_id: 8721 reply_id: 33187[/import]