This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:tutorials:orxscroll:binding-orxscroll [2024/05/06 18:07 (11 months ago)] – Update to match project rename from binding-of-objects to BindingOfObjects hcarty | en:tutorials:orxscroll:binding-orxscroll [2024/05/06 18:10 (11 months ago)] (current) – Update to match project renaming from binding-of-objects to BindingOfObjects hcarty | ||
---|---|---|---|
Line 204: | Line 204: | ||
{ | { | ||
// Set initial movement direction | // Set initial movement direction | ||
- | m_direction = Direction::SOUTH; | + | m_direction = SOUTH; |
// Get movement speed from config value | // Get movement speed from config value | ||
m_movementSpeed = orxConfig_GetFloat(" | m_movementSpeed = orxConfig_GetFloat(" | ||
Line 261: | Line 261: | ||
m_timeSinceDirectionChange = 0; | m_timeSinceDirectionChange = 0; | ||
// Pick random number between bounds of Direction enum | // Pick random number between bounds of Direction enum | ||
- | orxU32 randomNum = orxMath_GetRandomU32(0, | + | orxU32 randomNum = orxMath_GetRandomU32(0, |
// Update object' | // Update object' | ||
m_direction = static_cast< | m_direction = static_cast< | ||
Line 297: | Line 297: | ||
</ | </ | ||
- | Add the following lines to '' | + | Add the following lines to '' |
<code c> | <code c> | ||
Line 387: | Line 387: | ||
The code should be almost self-explanatory. The hero's movement speed will be pulled from its config value. The update function (called every frame) sets the speed of the character based on what keyboard arrow is pressed. The '' | The code should be almost self-explanatory. The hero's movement speed will be pulled from its config value. The update function (called every frame) sets the speed of the character based on what keyboard arrow is pressed. The '' | ||
- | You have to modify the '' | + | You have to modify the '' |
Try to do those things yourself. If you need help, though, here are the lines to add: | Try to do those things yourself. If you need help, though, here are the lines to add: |