Corona SDK Easing outBounce - lua

I'm having a bit of trouble with Corona's transitions with easing.
Here is my code:
transitionTime = 120
transition.to( newDot, { time = transitionTime, y = newDot.destination_y, transition=easing.outBounce } )
Unfortunately, it's not actually bouncing at all. It just seems to be moving normally. I'm not sure if I'm doing something wrong or if something else needs to be done before the easing transition will display.
Any help would be greatly appreciated!
Thank you!

I'm pretty sure that transition API never worked properly. What I always would do is make 2 transitions with one having a slight delay like so:
transition.to(newDot, {time=80,y = newDot.destination_y - 50})
transition.to(newDot, {delay=80, time=40, y=newDot.destination_y})
Just work with something like that so just change up the numbers to your liking. Hope this helps.

I think you are using old corona version.The easing properties inBounce, outBounce, inOutBounce, outInBounce are applied only in new versions of corona. These properties will not work in old one.

Related

Roblox part not colliding correctly when using a spinning block script

My problem is currently beyond my knowledge and I don't know how to fix it. Here is my code for the spinning part.
while true do
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromRulerAnglesXYZ(0.1,0.1,0.1)
end
The code works perfect, but the block does not collide with the players how it should. Any idea how to fix this?
PS: I am using a custom StarterCharacter, but it collides with everything else just fine if that helps.

swift 3 - reverse scrolling. can it be done?

I have tried several options in order to implement reverse scrolling, but nothing seems to work.
The best example for what I am trying to do can be found in this link:
https://codepen.io/patrikhjelm/pen/klcnj
$(document).ready(function(){
$(window).scroll(function(){
$('.right').css('transform', 'translate3d(0,' + $(this).scrollTop()*2 + 'px, 0)');
}).scroll();
});
(I would explain with words but the visual in this case is much more expressive..)
I have already tried programming in JS while using UIWebView and WKWebView - but the scroll seems really choppy (I mean like really really choppy)
I was looking into SpriteKit before I decided to write here cause things just were not adding up. Has anyone had this particular demand and managed to solve it?
Thank - you
problem solved!
Just use view.frame.origin.y = scrollView.contentOffset.y * 2
works like a charm.

Temporary disable physics from CCSprite

I'm currently discovering Cocos2D in combination with SpriteBuilder and I'm making stuff bounce around.
It's quite fun :)
What I'm trying to figure out is the following :
- On SpriteBuilder, I create a CCSprite, and I enable physics for this one.
- I can invoke it in XCode, and do whatever I want with it. Plus, the sprite is reacting accordingly to the physics settings applied to it. Great.
Now, what I would like to do is to disable the physics from this sprite in the code. I don't find a method in the Cocos2D API that would do the trick.
Can you help me out ?
Thank you for your time and help ;)
I write the correct answer then:
sprite.physicsBody.sensor = TRUE;

How can I make the motion smoother?

I'am programming my first game for Ipad. I have a little problem on an animation. In this game I have a ball bouncing around the screen. I move the ball in this way
CGRect frameRect = ball.frame;
frameRect.origin.x += ballMovement.x;
frameRect.origin.y += ballMovement.y;
ball.frame=frameRect;
The ball moves but the animation is sometimes not very smooth... The strange thing is that while I was testing my app on my ipad I discovered that if I close the app and reopen it from the multitasking bar the ball moves way way better! The animation is smoother and faster...
Can somebody explain why is happening this thing?
Thank you!! Daniel from Italy
If reopening the application makes it smooth, then most likely something has been cached the second time that was not cached the first time. There's nothing in the 4 lines of code you posted that could explain the lack of smoothness. Maybe posting more of the code would help.

IOS 3.2 MPMoviePlayerControler Controls do no disapear as advertised

i was having problems to make the MPMoviePlayerController controls disappear.
I tried to do it via:
...
MPMoviePlayerController *mplayer;
[mplayer setControlStyle:MPMovieControlStyleNone];
...
The problem is however that the controls appear for a brief second. I don't want to make my app look unprofessional so making them disappear completely is what i aim for.
There is a suggestion for a solution to this problem, but i in my tests it didn't work. I also tried the old var for solving this but no effect in this case either
mplayer.movieControlMode = MPMovieControlModeHidden; // old var
If anyone can give me hint on how to solve this it would be much appreciated!
Thanks in advance!
Best regards,
zhengtonic
If anyone is interested you can solve this by NOT using the MPMoviePlayerViewController.
Just use the MPMoviePlayerController and it works. Don't know why ...
Much thanks to the ppl on #iphonedev who gave me the tip.
Best regards,
zhengtonic.

Resources