green-code-initiative / ecoCode-challenge

Emboard in the hackhatons serie for improving ecoCode
3 stars 4 forks source link

[iOS] Use one constant for all your view elements frame rates #17

Open hgroschaus opened 1 year ago

hgroschaus commented 1 year ago

Avoid using multiple frame rates at once on screen. For example, don’t have a character in your game moving at 60 frames per second, while the clouds in the sky are moving at 30 frames per second. Use the same frame rate for both, even if it means raising one of the frame rates.

for instance SpriteKit API using preferredFramesPerSecond:

var preferredFramesPerSecond: Int { get set }
hgroschaus commented 1 year ago

Use one constant for all your view elements frame rates

Platform

OS OS version Langage
IOS - Swift

Main caracteristics

ID Title Category Sub-category
- Use one constant for all your view elements frame rates - -

Severity / Remediation Cost

Severity Remediation Cost
Minor Minor

Rule short description

Avoid using multiple frame rates at once on screen.

Rule complete description

Text

For example, don’t have a character in your game moving at 60 frames per second, while the clouds in the sky are moving at 30 frames per second. Use the same frame rate for both, even if it means raising one of the frame rates.

for instance SpriteKit API using preferredFramesPerSecond:

var preferredFramesPerSecond: Int { get set }

Implementation principle