Motion 3. Motion Block Motion blocks allow you to program the Sprite’s movement. You can move it to different location, rotate, move towards the mouse or specify what you want the spike to do when it touched the edge of the stage.
You will learn … Make the Sprite move X, Y co-ordinates Move in position / # of steps Turn the Sprite Point towards mouse Touch the edge Display X, Y, direction Event Block
Display information on stage Motion Block Set turning behavior Go to a location Touch the edge Point to a direction Display information on stage Set/change X,Y position Move steps Turning an angle Motion Block
What is x, y ? Position a Sprite Specific Position - + Positive X Positive Y Negative X Negative Y + - Specific Position The x,y position is (0,0) at the centre of the stage. Right most is 240, left most is -240. Up most is 180 and the down most is -180 Motion Block
Time to Reach a Position goToXY.sb2 You can program the movement to a specific position in number of second. This will slow down the movement of the spike Motion Block
Time to Reach a Position Video goToXY.sb2 Video Clip Motion Block
Define / set x,y = 0,0 Position In Costumes tab, Vector mode , Move the Cross to the Sprite to define the (X,Y)=(0,0) position Zeroing at centre position is done by the Zeroing tool. This will set the location of the Spite at X,Y = 0,0 . This is important as a reference so that You X,Y programming location can be accurate and predictable. Motion Block
Angular Position How ? Turn 0 to 360 deg or 0 to -360 degree 0 deg Motion Block
Angular Position Add the “set rotation style …” to position the Sprite correctly . init_Sptire_To_Specific location.sb2 Motion Block
Touching Edge at 90 Degree Video MoveTouchEdgeCatSprite.sb2 Video Clip Motion Block
Touching Edge at Any Angle Opposite turning @ any angle Use Sensing block and add another 180 deg to direction Rebound when touches edges : top, bottom, right , left Press Key “1” Motion Block
Touching Edge at Any Angle No rebound, stuck inside an edge depending on the starting angle Press Key “Space” Rebounded but stuck at the top edge as the Sprite still touches the top edge. Press Key “2” Move away from the edge Motion Block
Touching Edge at Any Angle Rebound correctly done Press Key “3” MotionBock_cat_angleTurn180.sb2 Video MotionBock_cat_angleTurn180.sb2 Video Clip Motion Block
Point at PC Mouse Point at Mouse – not moving Move towards the Mouse crab_move_towards_PC_mouse.sb2 This simple program make the crap move/turn depending on the movement of your mouse. Motion Block
Point at PC Mouse Video crab_move_towards_PC_mouse.sb2 Video Clip Motion Block
Motion End of Motion Block