Zho:让物件在卷轴上移动

This article discusses a technique used to make an object slide vertically, horizontally, or both while scrolling. This tutorial explains how to make an object slide in a scroller. Below is the script you will need:

當 @greenflag 被點擊 重複無限次 x 設為 ((scrollX) + (xpos)) end

當 @greenflag 被點擊 重複無限次 重複 (100) 次 變數 [xpos v] 改變 (2.5) end 重複 (100) 次 變數 [xpos v] 改變 (-2.5) end end

Placing this script into a sprite will make it move back and forth while you are scrolling.

How it Works
The xpos 变量 determines how far the sprite should be offset from its original position if it were scrolling normally. This script makes it forever slide back and forth. This is similar to a Mario style platformer.

参见

 * 卷轴滚动
 * 游戏平台
 * 重力的模拟
 * 卷轴平台游戏教程