Jump to content

Search the Community

Showing results for tags 'currentFrame'.

  • 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 2 results

  1. Hello, I've some problems with basics animation on phaser 2.2.2 : I created an animation : game.load.atlas('bodyPlayer', 'img/body.png', 'data/body.json');...player = game.add.group();player.health = 100;game.physics.arcade.enable(player);player.enableBody = true;bodyPlayer = player.create(140, GAME_HEIGHT - 255, 'bodyPlayer');bodyPlayer.animations.add('normal', [0,1]);bodyPlayer.animations.add('run', [2,3,4]);After in the update function : bodyPlayer.animations.play('run', 5);console.log(bodyPlayer.animations.name);console.log(bodyPlayer.animations.currentFrame.name);Here the result : main.js:190 runmain.js:191 003 - run1.pngmain.js:190 runmain.js:191 004 - run2.pngmain.js:190 runmain.js:191 005 - run3.pngmain.js:190 runmain.js:191 Uncaught TypeError: Cannot read property 'name' of undefined It made one loop, display correctly the names of all the frames of this animation, stop and show this error. I attach my Json File made with Texture packer (Json Array). Thank you for your answer and sorry for my english :/
  2. diex

    jump to frame

    Hi: I have a sprite loaded as atlasJSONArray. I can create serveral versions of the animation and start playing it back like this: for( var x = 0; x < 800; x = x+100){ for(var y = 0; y < 600; y = y+100){ var cat = game.add.sprite(x, y, 'cat'); cat.animations.add('run'); cat.animations.play('run', 30, true); } }what Im trying to achive now is let every instance to start at a random frame (to make all animations look different). i tried this but does not work: cat.animations.frame = Math.floor(Math.random() * cat.animations.frameTotal); how could this be done? I'm as3 coder so I used to do sprite.gotoAndPlay(someFrame);thks !
×
×
  • Create New...