@Rodolphe, in addition to what luatee suggested, try running through your for loops backwards.
@Rodolphe, now that I have my TestFlight issues sorted out, i’d love to test it if you still have spots open
I’d also be interested in seeing your page easing code, as Zoyt said it looks awfully close to the native one
My easing function is a huge, nasty, mess but here it is:
-- Springboard
if menuP == 0 and CurrentTouch.state == 2 and hScrolling >= -WIDTH/4 and hScrolling <= 0 then
trans = trans+1
springB = outCubic(trans,0,-hScrolling,30)
menuPp = 0
end
if menuP == 0 and CurrentTouch.state == 2 and hScrolling >= 0 then
trans = trans+1
springB = outCubic(trans,0,-hScrolling,30)
menuPp = 0
end
if menuP == 0 and CurrentTouch.state == 2 and hScrolling < -WIDTH/4 then
trans = trans+1
springB = outCubic(trans,0,(-hScrolling-WIDTH),30)
menuPp = 1
end
if menuP == 1 and CurrentTouch.state == 2 and hScrolling <= -WIDTH+WIDTH/4 then
trans = trans+1
springB = outCubic(trans,0,-hScrolling-WIDTH,30)
menuPp = 1
end
if menuP == 1 and CurrentTouch.state == 2 and hScrolling > -WIDTH+WIDTH/4 then
trans = trans+1
springB = outCubic(trans,0,-hScrolling,30)
menuPp = 0
end
hScrolling is incremented with touch.deltaX
outCubic is this:
function outCubic(t,b,c,d) -- t: current time, b: beginning value, c: change in value, d: duration
t = t / d - 1
return -c * (math.pow(t, 3) - 1) + b
@Rodolphe, interesting. A couple questions:
-
Is
springB
the variable you translate by? -
What is
menuPp
? -
Do
trans
andhScrolling
ever get reset? -
Does
menuP
ever change?
Oh sorry,
SpringB is what I move the menu texts by, for instance:
sprite(titre2,0+hScrolling+springB,0+math.sin(sai/40)*10,WIDTH*.95,(WIDTH*.95)/7.1234567)
MenuPp is a temp variable for when changing menus. When the menu has arrived in place, MenuPp gives its velue to MenuP (0 for the first page, and 1 for the second one):
if menuPp == 0 then
if math.abs(hScrolling+springB) <= .1 then
springB = 0
trans = 0
hScrolling = 0
menuP = 0
end
end
if menuPp == 1 then
if math.abs((WIDTH+hScrolling)+springB) <= .1 then
springB = 0
trans = 0
hScrolling = -WIDTH
menuP = 1
end
end
Hard to believe, by my code is so messy that I have a hard time understanding it myself
@Rodolphe, thanks for sharing! Using your code as a guide, I have created a class that mimics the behavior as closely as I could, but which allows for as many pages as you want.
https://gist.github.com/JakAttak/5f5f4939ffef4eb13380
I will also likely extend it to allow for touches in these pages
Oh great… great… Thanks so much !
@Rodolphe, I’ve now also added touch and class support so it is more capable. Thanks again for sharing your version!
High score 44931
ooooooook, I need to adjust difficulty
(did you cheat? :D)
Hi everybody! I was busy working on my bloody thesis, but I finally have a new build ready to test. I added the previous beta testers on the new apple owned test flight, please let me know if you don’t want to be bothered with it, I’ll remove it. Don’t feel like you should test it either, although I’d really appreciate it! (you’ll receive an email from apple as soon as they allow the build to be distributed)
In short, I don’t have enough time to build In Churning Seas up to my previous ambitions, so I’m making it really straight forward, and will add features as time allows…
Cheers!
Sure! Please send me your email address through a private message…
In Churning Seas is currently number 6 in Touch Arcade’s “Hot new apps” (based on forum activity I think), has a 4.5/5 average rating from TA users! Well done @Rodolphe !
Thanks! this is indeed amazing. It has been oscillating between 6th and 4th rank since was released on iPhone (2 or three days ago). It’s not showing in sales (…), but it’s thrilling nonetheless!!!
Codea and its amazing community made me do it Cheers guys.
whizzo, as if a bit profound