text: jQuery.redEnvelopesRain=function(d,a,c,k,f,h){if(a.time=="auto"){if($.isArray(a.prizes)){a.time=a.prizes.length}else{if(parseInt(a.prizes)>0){a.time=1}else{a.time=0}}}var i=new Phaser.Game(k.width,k.height,Phaser.AUTO,"canvas_prize1",{preload:g,create:e},true);d.vcc_canvas_prize1_click_hide.on("click",function(){d.redEnvelopesRain.hide()});d.vcc_click_show_redEnvelopesRain.click(function(){d.redEnvelopesRain.show();if(a.time<1||!a.prizes){h.prizeHintNo()}});function g(){i.load.spritesheet("jing_ling1",c.jing_ling1,100,123,3)}var b;var j;function e(){b=i.add.group();b.enableBody=true;b.createMultiple(a.rounds>0?a.rounds:10,"jing_ling1");b.setAll("anchor.y",1);b.setAll("outOfBoundsKill",true);b.setAll("checkWorldBounds",true);var m=function(){if(j=b.getFirstExists(false)){j.events.onInputDown.removeAll();j.angle=i.rnd.between(10,20);j.reset(i.rnd.between(1,k.width-100),0);j.body.velocity.x=i.rnd.integerInRange(1,50);j.body.velocity.y=i.rnd.between(400,600);j.inputEnabled=true;j.checkWorldBounds=true;j.outOfBoundsKill=true;j.events.onInputDown.add(l,i);j.animations.add("left",[0,1],2,true);j.play("left")}};var l=function(o){o.animations.add(2);o.play(2);o.kill();if(a.time>0){var n;if($.isArray(a.prizes)){if(!(n=f[a.prizes[a.time-1]-1])){n=f[i.rnd.between(0,a.time-1)]}}else{if(parseInt(a.prizes)>0){n=f[parseInt(a.prizes)-1]}}a.time--;if(n){h.prizeHint(n)}else{h.prizeHintNo()}}else{h.prizeHintNo()}};i.time.events.loop(500,m,this)}};