Jump to content

Search the Community

Showing results for tags 'phaser random'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi all, I have a group where, I want 2 types of blocks to be generated from left to right or vice versa not really important, my randomization seems to work fine, but the problem is they only changes if I refresh the game, but if I run it as it is, it will always be the same kind of block until I refresh, any ideas? createOnebloque: function(){ this.bloquecs = ["bloqueSprite","bloquelSprite"]; //////Here are the 2 sprites this.bloquesr = this.bloquecs[Math.floor(Math.random()*2)]; ///Here I randomize but only works when I refresh. this.bloque = this.game.add.group(); this.bloque.createMultiple(5, this.bloquesr); this.bloque.setAll('anchor.x', 0.5); this.bloque.setAll('anchor.y', 0.5); this.bloque.setAll('outOfBoundsKill', true); this.bloque.setAll('checkWorldBounds', true); }, makeBloques: function(){ this.bloques = this.bloque.getFirstExists(false); if (this.bloques) { this.bloques.reset(1440, 1400); this.game.physics.arcade.enable(this.bloques); this.bloques.enableBody = true; this.bloques.body.immovable = true; this.bloques.body.velocity.x = -2000; } }, This below goes on the create funtion: this.game.physics.arcade.collide(this.bullets, this.bloque, this.collisionBulletBloque, null, this);
×
×
  • Create New...