Jump to content

Search the Community

Showing results for tags 'loop animate'.

  • 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. hello! i'm trying to animate a group of clouds in the skyand i want to make it loop how can i do this here's my code so far <!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>clouds</title> <script type="text/javascript" src="phaser.min.js"></script></head><body> <div id="gameContainer"> </div> <script type="text/javascript"> var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update }); function preload() { game.load.image('background', 'assets/background.png'); game.load.image('plane', 'assets/plane.png'); game.load.image('cloud', 'assets/cloud.png'); } var plane; var clouds; function create() { game.add.image(0, 0, 'background'); game.physics.startSystem(Phaser.Physics.ARCADE); game.physics.arcade.gravity.y = 10; plane = game.add.sprite(100, 96, 'plane'); game.physics.enable(plane, Phaser.Physics.ARCADE); clouds = game.add.group(); for (var i = 0; i < 60; i++) { sprite = clouds.create(120 * i, game.world.randomY, 'cloud'); game.physics.enable(sprite, Phaser.Physics.ARCADE); sprite.body.allowGravity = false; sprite.body.velocity.x = -150; } } function update () { if (plane.outOfBoundsKill == true) game.state.restart(); } function restart () { } </script></body></html>
×
×
  • Create New...