1 | <?php |
||
29 | class WASDControlsComponent extends ComponentAbstract implements WASDControlsCMPTIF |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Initialize Component |
||
34 | * |
||
35 | * {@inheritdoc} |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | 9 | public function initializeComponent(): bool |
|
44 | |||
45 | /** |
||
46 | * Entity acceleration |
||
47 | * |
||
48 | * {@inheritdoc} |
||
49 | * |
||
50 | * @param int $acceleration |
||
51 | * @return void |
||
52 | */ |
||
53 | 2 | public function acceleration(int $acceleration = 65) |
|
57 | |||
58 | /** |
||
59 | * AD Axis |
||
60 | * |
||
61 | * {@inheritdoc} |
||
62 | * |
||
63 | * @param string $axis |
||
64 | * @return void |
||
65 | */ |
||
66 | 1 | public function adAxis(string $axis = 'x') |
|
70 | |||
71 | /** |
||
72 | * AD Inverted |
||
73 | * |
||
74 | * {@inheritdoc} |
||
75 | * |
||
76 | * @param bool $inverted |
||
77 | * @return void |
||
78 | */ |
||
79 | 1 | public function adInverted(bool $inverted = false) |
|
83 | |||
84 | /** |
||
85 | * Easing |
||
86 | * |
||
87 | * {@inheritdoc} |
||
88 | * |
||
89 | * @param int $easing |
||
90 | * @return void |
||
91 | */ |
||
92 | 1 | public function easing(int $easing = 20) |
|
96 | |||
97 | /** |
||
98 | * Enaled |
||
99 | * |
||
100 | * {@inheritdoc} |
||
101 | * |
||
102 | * @param bool $enabled |
||
103 | * @return void |
||
104 | */ |
||
105 | 6 | public function enabled(bool $enabled = true) |
|
109 | |||
110 | /** |
||
111 | * Fly |
||
112 | * |
||
113 | * {@inheritdoc} |
||
114 | * |
||
115 | * @param bool $fly |
||
116 | * @return void |
||
117 | */ |
||
118 | 1 | public function fly(bool $fly = false) |
|
122 | |||
123 | /** |
||
124 | * WS Axis |
||
125 | * |
||
126 | * {@inheritdoc} |
||
127 | * |
||
128 | * @param string $axis |
||
129 | * @return void |
||
130 | */ |
||
131 | 1 | public function wsAxis(string $axis = 'z') |
|
135 | |||
136 | /** |
||
137 | * WS Inverted |
||
138 | * |
||
139 | * {@inheritdoc} |
||
140 | * |
||
141 | * @param bool $inverted |
||
142 | * @return void |
||
143 | */ |
||
144 | 1 | public function wsInverted(bool $inverted = false) |
|
148 | } |
||
149 |
Let’s take a look at an example: