Appreciate It! [import]uid: 131412 topic_id: 20312 reply_id: 101160[/import]
Okay I got it, so in my text table, I was including the string inside of the table, which apparently is a no no. I was able to do every one of them! I’ll still take a look at your email though, as I’m sure it will be more efficient. Thank you so much for all of your help! [import]uid: 131412 topic_id: 20312 reply_id: 101167[/import]
Nice to see this getting resolved and of course to see people helping each other. (Good for you Sebitttas!)
Steve, give a shout if you have further issues - happy to see you get help before I even got here
[import]uid: 52491 topic_id: 20312 reply_id: 101180[/import]
Thank you Thank you! I have fully resolved my situation! And now I have a template complete with chapters and levels!!!
I would love to share it, but it’s a lot of code, and I’m not sure how exactly I would post it.
Maybe GitHub [import]uid: 131412 topic_id: 20312 reply_id: 101206[/import]
Oooh oooh, I got one! So, I can store my levels and track wether or not the next one is unlock able. no biggie…
How then can I check to see if the player has collected all three stars in a level in order to unlock bonus levels?
I imagine the process would be similar to unlocking the levels, but before I get to experimenting, any thoughts?
-Steve [import]uid: 131412 topic_id: 20312 reply_id: 101217[/import]
How are your bonus levels laid out? Is it like 1 per 10 levels, 1 per level, 1 at the end of the game, etc?
Will be much like doing levels but may have further advice if you can let me know
[import]uid: 52491 topic_id: 20312 reply_id: 101232[/import]
well, I have two thoughts, one for every 5 levels, so there’s be 4 bonus levels per chapter…or…1 for every chapter…maybe 2. I want it to be fair for the players…
I was thinking of having a separate screen for bonus levels, and as you earn them, they unlock…
Thanks! [import]uid: 131412 topic_id: 20312 reply_id: 101237[/import]
Well you could have a file for each bonus level. Let’s say that you want a bonus level every 5 levels, for example.
Save the total stars in a file between level 1 to level 5 - then if that total is 15 (3*5) then you know the bonus level should be unlocked.
They could still be on a separate screen 
Does that make sense? [import]uid: 52491 topic_id: 20312 reply_id: 101451[/import]
Yeah actually, that makes perfect sense!!!
Thanks Peach!!! [import]uid: 131412 topic_id: 20312 reply_id: 101455[/import]

Alright, I did it!!! This is insane! Now I want to just write files for everything!!! [import]uid: 131412 topic_id: 20312 reply_id: 101582[/import]
Hahaha, awesome! [import]uid: 52491 topic_id: 20312 reply_id: 101751[/import]
Hey Peach, so I’m running through my project, and I’ve got 4 working levels…go me! Only a billion and a half more to go. Here’s the situation…in my main.lua I’m using the following code to monitor memory…
[lua]local monitorMem = function()
collectgarbage()
print( "MemUsage: " … collectgarbage(“count”) )
local textMem = system.getInfo( “textureMemoryUsed” ) / 1000000
print( "TexMem: " … textMem )
end
Runtime:addEventListener( “enterFrame”, monitorMem )[/lua]
…and in my console, I’m seeing…
MemUsage: 350.0087890625
TexMem: 1.26912
Okay, now as I go through my levels, these numbers change…naturally. I’ve read through the director class threads and the memory management threads and am implementing everything that I’m reading, namely nil-ing out timers and event listeners and anything that doesn’t belong to my localGroup, since that gets cleaned up during scene transition using the director class.
Here’s my question, why does my memUsage continue to go up as I go further into my levels? Plus, when I go to play a previous level, it goes up even more.
I’ve tested out some stuff by toggling back and forth between certain scenes, and each time the memUsage will go up by 0.2/avg. As I go through the levels, it goes up significantly.
Also, I am using a lot of the same images for my levels so far, do you think modularizing them would be beneficial as far as memory is concerned?
Thanks Peach!
-Steve [import]uid: 131412 topic_id: 20312 reply_id: 102588[/import]
Hey Steve,
Yeah that’s quite high - uhm… audio, are you using much audio? If so, are you using audio.dispose? That may be playing a part here.
I know that’s a very short response to your post am just thinking of things worth trying before you go through tearing up your code 
Peach [import]uid: 52491 topic_id: 20312 reply_id: 102661[/import]
Great! So I got the memory stabilized. Exceeept…I am now using modules, and I have one module that contains two params. I have one timer for the whole module, and when I run both params on one level, the memory just goes up and up and up. If I remove either of the two params, leaving the other one all by it’s lonesome, then the leak disappears. Canceling the timer doesn’t seem to be working either…
Here’s the module…
[lua]function new( params )
local ow = audio.loadSound( “ow.mp3” )
local grr = audio.loadSound( “grrr.mp3” )
local wth = audio.loadSound( “wth.mp3” )
local soundTable = {ow, grr, wth}
local img
if params then
if params.type == “dip” then
img = {“images/fish_eye_open.png”, “images/fish_eye_quarter.png”, “images/fish_eye_half.png”, “images/fish_eye_three_quarter.png”, “images/fish_eye_close.png”}
elseif params.type == “kamikaze” then
img = {“images/kamikaze_fish_eye_open.png”, “images/kamikaze_fish_eye_quarter.png”, “images/kamikaze_fish_eye_three_quarter.png”, “images/kamikaze_fish_eye_closed.png”}
end
end
local fish = movieclip.newAnim(img, 24,24)
fish.x = 84
fish.y = 67
fish.isVisible = true
physics.addBody(fish, {bounce=0, friction=0, density=0, isBullet=true, filter=fishCollisionFilter})
local function fish_1_blink()
fish:play{startFrame=1, endFrame=5,loop=1}
fish:reverse{startFrame=5, endFrame=1,loop=1}
end
timerStash.blinkOne = timer.performWithDelay(math.random(1000,4000), fish_1_blink, 0)
function fish:touch( e )
if e.phase == “began” then
if params.type == “dip” then
audio.play( soundTable[math.random(1,3)] )
elseif params.type == “kamikaze” then
audio.play( soundTable[math.random(1,3)] )
end
end
end
fish:addEventListener( “touch”, fish )
return fish
end[/lua]
And here’s where I use it…
[lua]-- Dip
local fish = require “fish”
local dip = fish.new({type = “dip”})
localGroup:insert( dip )
– Kamikaze
local kamikaze = fish.new({type = “kamikaze”})
kamikaze.x = 280
kamikaze.y = 67
localGroup:insert( kamikaze )
-------------------------------------------------------------------------[/lua]
hmm…it’s a hairpuller…and I really don’t want to create individual timers, as the cleanup code now is very tidy…
-Thanks!
-Steve [import]uid: 131412 topic_id: 20312 reply_id: 103008[/import]
that would be a nice idea to post up the template to help out other developers.
peach, nice job on the ego. I just downloaded it and will give it a try [import]uid: 17701 topic_id: 20312 reply_id: 103299[/import]
that would be a nice idea to post up the template to help out other developers.
peach, nice job on the ego. I just downloaded it and will give it a try [import]uid: 17701 topic_id: 20312 reply_id: 103300[/import]