src/scripts/tiles/fuel.js
// Randomly absorb a single neutron and spawn a random number of neutrons
Randomly absorb a single neutron and spawn a random number of neutrons
Randomly absorb a single neutron and spawn a random number of neutrons
onReact(n) {
        if (random(100) / 100 < CONFIG.fuelChance) {
            this.simulation.removeNeutron(n);
            var c = this.center();
            this.simulation.glow(c.x, c.y, this.color);
            var spawnCount = round(random(CONFIG.nSpawnMin,
                                          CONFIG.nSpawnMax));
            for (var i = 0; i < spawnCount; i++) {
                this.simulation.neutrons.push(new Neutron(c.x, c.y, this.simulation));
            }
            this.heat += CONFIG.fuelHeat;
            return true;
        }
    }
onReact ( n ) { if ( random ( 100 ) / 100 < CONFIG . fuelChance ) { this . simulation . removeNeutron ( n ) ; var c = this . center ( ) ; this . simulation . glow ( c . x , c . y , this . color ) ; var spawnCount = round ( random ( CONFIG . nSpawnMin , CONFIG . nSpawnMax ) ) ; for ( var i = 0 ; i < spawnCount ; i ++ ) { this . simulation . neutrons . push ( new Neutron ( c . x , c . y , this . simulation ) ) ; } this . heat += CONFIG . fuelHeat ; return true ; } }
Randomly absorb a single neutron and spawn a random number of neutrons
Randomly absorb a single neutron and spawn a random number of neutrons
// Glow // Spawn neutrons