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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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