Jump to content

Search the Community

Showing results for tags 'phaser loop gravity delay'.

  • 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. Hey all, I'm building a little christmas game... I've attached a screenshot, got a set up of conveyer belts (sorta Donkey Kong-ish). I've created a group of sprites (giftgroup) hiding behind the pipe in the top right corner. My goal is to add gravity to each sprite over time, maybe 1 every half second so that gifts keep pouring out of the pipe. Should I be trying to do this in the update: function() or is there a way to add the gravity when creating the group but somehow delay the creation of each sprite? I'm a phaser newbie still and novice javascripter so any help with this is appreciated! buildGifts: function(){ this.giftgroup = this.add.group(); this.giftgroup.enableBody = true; for(var i=0; i<this.totalGifts; i++){ var g = this.giftgroup.create(1000, 80, 'blueGift', 0000); g.anchor.setTo(0.5,0.5); g.body.moves = true; g.animations.add('gifted', Phaser.Animation.generateFrameNames('gift', 0, 0, '', 4), 30, true); this.game.physics.arcade.enable(g); g.body.bounce.y = 0.2; // g.body.gravity.y = 1500; g.body.velocity.x = 0; g.inputEnabled = true; g.events.onInputDown.add(this.destroyGift, this); }
×
×
  • Create New...