Jump to content

Is it possible to rotation the body?


Recommended Posts

I would like to create slopes platform and make the player stand on it

I  use rotation method, it is work on sprite , but not work in body.......any idea, thank you very much



game.createScene('Main', {
    init: function() {        
        this.sprite = new game.Sprite('sprite.png');
        this.sprite.anchor.set(50, 50);
        this.sprite.position.set(game.width / 2, game.height / 2);

        var shape = new game.Rectangle();
        shape.width = this.sprite.width;
        shape.height = this.sprite.height-20;

    update: function() {

        this.sprite.rotation = 0.4;
        this.body.rotation = 0.4;  // not work


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...