Jirka1111

Members
  • Content Count

    65
  • Joined

  • Last visited

About Jirka1111

  • Rank
    Advanced Member

Recent Profile Visitors

500 profile views
  1. That's it! Thank you Now I have to manage collision detection.
  2. Yes, and even enable body. But render just don't show body and, of course, collision doesn't work.
  3. No, bunnies creates as I wish, but I can't set them body (render of the body doesn't work). So for example collision is not working.
  4. this.groupOfBunnies = this.add.group(); this.groupOfBunnies.enableBody = true; this.groupOfBunnies.physicsBodyType = Phaser.Physics.ARCADE; addGroupOfBunnies: function(){ for(var i = 1; i < 10; i++){ this.pos = this.bunniesPos(); this.bunny = this.groupOfBunnies.create(this.game.world.centerX, this.game.world.centerY, "player"); this.bunny.name = 'bunny' + i; this.bunny.rotation = this.pos + Math.PI / 2; this.bunny.x = this.game.world.centerX + Math.cos( this.pos ) * ( this.radius + this.bunny.height / 2 ); this.bunny.y = this.game.world.centerY + Math.sin( this.pos ) * ( this.radius + this.bunny.height / 2 ); } }, bunniesPos: function(){ return this.game.rnd.pick([/*0, 0.314, 0.628, */0.942, 1.256, 1.57, 1.884, 2.198, 2.512, 2.826, 3.14, 3.454, 3.768, 4.082, 4.396, 4.71, 5.024, 5.338, 5.652, 5.966/*, 6.28*/]); },
  5. Up. It's full "game". Not just fragments.
  6. Hello, I am pretty desperate (yeah, again). Can you please look at this code and tell me, what I am doing wrong with function addGroupOfBunnies? I just want to generate bunch of sprites with body and then make a collision between player and each sprite from group. https://mega.co.nz/#!yVRzBAJI!WbRqInoZBF4zbeYoJbrz10fVZlh9NXW-tjtzo5OPo5Q
  7. Could someone rewrite example from GregP for Phaser 2.2 and with proper files (like Boot.js, Preloader.js, etc.)? This is the only solution which is working for me. This template could be very useful.
  8. Ok, so, expanding of bar is easy: Now I have to manage time... (I am writing this because of future users) EDIT: OK, I've got this. You need just add these two lines: this.progressBar.width += 100; this.tween = this.game.add.tween(this).to({barProgress: 0}, this.time + 300, null, true, 0, 0);
  9. In update function: platformsCreate: function() { // platform basic setup this.platforms = this.add.group(); this.platforms.enableBody = true; this.platforms.createMultiple( 10, 'pixel' ); // create the base platform, with buffer on either side so that the hero doesn't fall through// this.platformsCreateOne( -16, this.world.height - 16, this.world.width + 16 ); // create a batch of platforms that start to move up the level for( var i = 0; i < 9; i++ ) { this.platformsCreateOne( this.platformsPosition(), this.world.height - 150 - 150 * i, 50 ); } }platformsPosition: platformsPosition: function(){ return Phaser.Math.getRandom([56, 127, 198, 269, 340, 411]); },Other methods: platformsCreate: function() { // platform basic setup this.platforms = this.add.group(); this.platforms.enableBody = true; this.platforms.createMultiple( 10, 'pixel' ); // create the base platform, with buffer on either side so that the hero doesn't fall through// this.platformsCreateOne( -16, this.world.height - 16, this.world.width + 16 ); // create a batch of platforms that start to move up the level for( var i = 0; i < 9; i++ ) { this.platformsCreateOne( this.rnd.integerInRange( 0, this.world.width - 50 ), this.world.height - 150 - 150 * i, 50 ); } }, platformsCreateOne: function( x, y, width ) { // this is a helper function since writing all of this out can get verbose elsewhere var platform = this.platforms.getFirstDead(); platform.reset( x, y ); platform.scale.x = width; platform.scale.y = 16; platform.body.immovable = false; return platform; }, I had to generate platforms in some predefined x coordinates. But sometimes the platform just won't shows up.
  10. Lewster, how can I add an extra time? I want to code progress bar like in the Timber Man. One success (for example killing an enemy) and add 500 ms.
  11. So I've made few changes. Spikes are different, pause button was removed and added new splashscreen.
  12. I am using CocoonJS and my only problem with audio is that played with delay (it is about 0,5 s).
  13. Are you serious? Without any piece of code or description of error?
  14. And what about sounds and ads? Do they play right in time and ads are showing in game? Thank you for review, spikes really look bad and pause button is useless. I will fix it tomorrow