1
0
forked from sent/waves
waves/public/assets/g/wbwwb/js/misc/Candlelight.js
2025-04-09 17:11:14 -05:00

25 lines
457 B
JavaScript

Game.addToManifest({
candlelight: "sprites/misc/candlelight.json"
});
function Candlelight(position){
var self = this;
var mc = MakeMovieClip("candlelight");
self.graphics = mc;
mc.anchor.x = 0.5;
mc.anchor.y = 0.5;
mc.x = position[0]-100; // HACK, LOL W/E
mc.y = position[1]-100; // HACK, LOL W/E
self.update = function(){
if(Math.random()<0.2){
var frame = Math.floor(Math.random()*mc.totalFrames);
mc.gotoAndStop(frame);
}
};
}