Jump to content

N00B question


Recommended Posts


What first comes to mind:

myObject.y = 50;

But, really, there's many answers to this question. Perhaps you want 50px from the original spot rather than "50 px along the y axis", in that case you might prefer:

myObject.y += 50;

// or

myObject.y -= 50;

Or, maybe you have something else in mind. I think this link will be helpful:


Link to comment
Share on other sites

So Im trying to create a football game. I m just trying to see if I can get the guys moving on the field.  my goal is to try to get all this code reusable so i dont have to copy/paste eveything for every person.  I just started playing around with this today. The object is you cilck on a play and the computer moves the pieces, base on your players abilities, more rpg, less playstation.


    function create () {
            var field = game.add.sprite(game.world.centerX, game.world.centerY, 'field');

            var wr1 = game.add.sprite(100,200, 'wr1');

            //  wr1.animations.add('run');
            //  wr1.animations.play('run', 10, true);

             var wr2 = game.add.sprite(100, 250, 'wr2');
              // wr2.animations.add('run',  10, true);
              // game.physics.arcade.enable(wr2);
              // wr2.animations.add('run');
              // wr2.animations.play('run', 150,  true);
              // game.physics.arcade.moveToXY(wr2, 10,50);


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...