You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<divid="container"></div><scriptsrc="/js/proton.js"></script><scriptsrc="https://unpkg.com/spritejs/dist/spritejs.min.js"></script><scriptsrc="https://unpkg.com/sprite-extend-proton/dist/sprite-extend-proton.js"></script><script>const{Scene, ProtonRenderer}=spritejsconstcontainer=document.getElementById('container');constscene=newScene({
container,width: 600,height: 600,})constlayer=scene.layer('fglayer')constproton=newProton()constemitter=newProton.Emitter()// set Rateemitter.rate=newProton.Rate(Proton.getSpan(10,20),0.1)// add Initializeemitter.addInitialize(newProton.Radius(1,12))emitter.addInitialize(newProton.Life(2,4))emitter.addInitialize(newProton.Velocity(3,Proton.getSpan(0,360),'polar'))// add Behaviouremitter.addBehaviour(newProton.Color('#ff0000','random'))emitter.addBehaviour(newProton.Alpha(1,0))// set emitter positionemitter.p.x=layer.canvas.width/2emitter.p.y=layer.canvas.height/2emitter.emit(5)// add emitter to the protonproton.addEmitter(emitter)// add canvas rendererconstrenderer=newProtonRenderer(layer)proton.addRenderer(renderer)// use Euler integration calculation is more accurate (default false)Proton.USE_CLOCK=false// proton.update()functiontick(){requestAnimationFrame(tick)proton.update()}tick()</script>