Jump to content

qubedozzer

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by qubedozzer

  1. how can I set the background sprite at the "bottom" of the game?
  2. Thanks for your code!! with if(player.body.blocked.up || player.body.blocked.down || player.body.blocked.left || player.body.blocked.right) { console.log('play sound <.:| ');}works fine... at the next, I look at the velocity of "player" and set the volume of sound like a table tennis ball
  3. hmm - this not work... ...game = new Phaser.Game(320,480,Phaser.CANVAS,"playground",{preload:onPreload, create:onCreate, update:onUpdate}, true); ...player = game.add.sprite(160,240,"player");...function onUpdate() { game.physics.arcade.collide(player, game); game.physics.arcade.overlap(player, game, playBouncedSound, null, this); function playBouncedSound(player, game) { console.log('play sound...'); } }
  4. I used this solution http://www.html5gamedevs.com/topic/6053-dynamic-load-image/#entry36772 and works fine BUT the new sprite is loaded at top - I just try to set background image at bottom var bgLayer = game.add.group(); bgLayer.z = 0; var bg = game.add.tileSprite(0, 0, 1024, 768, 'background'); bgLayer.add(bg);or set my "player" on top // Create the player layer var playerLayer = game.add.group(); playerLayer.z = 10; // adding the player on stage player = game.add.sprite(160,240,"player");hmm.... don´t works at this time, I have a second canvas behind the phaser canvas als "background"
  5. Hi, I have a small ARCADE game game.physics.startSystem(Phaser.Physics.ARCADE); and if a sprite bouncing the world should play a sound... player.body.collideWorldBounds = true; how can I use this?
  6. Hi, I work at a small game - at this can user choose your own background image. I have any problems to change the backgound image after the game start. my dev site http://www.zwischenstation-mobile.de/spiel.html I set a global var game and initalisize the game var game;window.onload = function() {...game = new Phaser.Game(320,480,Phaser.CANVAS,"playground",{preload:onPreload, create:onCreate, update:onUpdate}, true);...}after this, I´ll update the background with (function($) { $( window ).load(function() { game.load.image("background", "/files/springende-punkt/content/games/gyro-sp/koala.jpg"); game.add.tileSprite(0, 0, 320, 480, 'background'); });})(jQuery);as test but the goal is to load a local file with <input name="picOneUpload" type="file" accept="image/*">Have anybody a idea?!?
×
×
  • Create New...