mirror of
https://github.com/wassname/phaser.git
synced 2026-07-14 01:10:16 +08:00
RandomDataGenerator.integerInRange(min, max) now includes both min and max within its range (#501)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
var sprite;
|
||||
|
||||
function create() {
|
||||
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
var x = game.rnd.integerInRange(10, 20);
|
||||
|
||||
if (x === 20)
|
||||
{
|
||||
console.log('>>>', x);
|
||||
}
|
||||
else if (x === 10)
|
||||
{
|
||||
console.log('---', x);
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log(x);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user