Godofdrakes's Forum Posts

  • 1 posts
  • I don't recall where I found it (somewhere on the forums) but for snapping something to a grid I've been using

    On whatever event:

    Player.X = round(Player.X/16)*16

    Player.Y = round(Player.Y/16)*16

    This works for a grid where the spaces are 16x16, you would change it for different sizes.

    As for movement I'd just use keyboard bind WASD (or whatever you prefer) to set the player's sprite however many pixels over.

    W => Player.Y = Player.Y -16

    A => Player.X = Player.X -16

    S => Player.Y = Player.Y +16

    D => Player.X = Player.X +16

    Then just run the snap to grid event to make sure the player stays in it's space.

    I'm not totally familiar with dropbox so I hope this link works.

    Grid-Based Movement

    Sadly, I cannot help with random world generation as I don't really know how to either. There were a couple posts I found but they were rather vague.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 posts