Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 2D Blocks
  4. Changing X and Y Positions

Changing X and Y Positions

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    Introduction

    You can set the X and Y positions for a sprite using these blocks:

    However, if you just want to move a sprite relative to its current position, there is a simpler way.

     

    The “Change X By” Block

    If you want to move a sprite along the X direction (left or right), you can use the “change x by” block. A positive value would move the sprite to the right, and a negative value would move the sprite to the left.

    Note that if the sprite is already on the left or right edge, then you can not change the X position further away from the center.

     

    The “Change Y By” Block

    If you want to move a sprite along the Y direction (up or down), you can use the “change y by” block. A positive value would move the sprite higher, and a negative value would move the sprite lower.

     

    Changing X and Y Together

    Note that if you want to change both X and Y positions at the same time, you can simply use the “change x by” and “change y by” blocks together. Since both blocks run very very fast, it will look as if both blocks run at the same time:

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode