Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shaking(o : h2d.Object, t : Float)
- {
- var b = o.getBounds();
- event.waitUntil(function(dt : Float)
- {
- o.x = (Std.int(t / 0.01) % 2 == 0) ? b.x + Std.random(2)*5 : b.x - Std.random(2)*5;
- t -= dt;
- if(t <= 0) o.x = b.x;
- return (t <= 0) ? true : false;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement