Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的游戏
我做了一个游戏,其中包含的所有图像都在垂直移动。我想知道如何水平移动它。
您链接的jsbin在我的计算机上不起作用,因此可能还有其他问题。
无论如何,要让背景在您的游戏中水平移动,您需要找到函数function Background(),并将 this.y 分配更改为this.x(例如,this.y += this.speed将变为this.x += this.speed)。
function Background()
this.x
this.y += this.speed
this.x += this.speed