设置固定的方向


描述

This action is used to set a fixed movement direction. The available directions are indicated by the different buttons in the action block, and clicking any of them will set that direction. Note that directions in GameMaker Studio 2 are measured in degrees, with right being 0°, up being 90°, left being 180° and down being 270°.


动作语法:

Set Direction Fixed Syntax


例如:

Set Direction Fixed Example
The above action block code checks for a middle mouse press on the instance and if one is detected it sets the direction to down (270°) and the speed to 1 plus a random value from 0 to 1.