Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flash object] Add ability to flash color tint, object effect, and opacity (fade) #955

Merged
merged 12 commits into from
Aug 6, 2023

Conversation

tristanbob
Copy link
Contributor

@tristanbob tristanbob commented Aug 5, 2023

New features

  • Flash color tint
  • Flash effect
  • Flash opacity (fade)

Improvements

  • When "Flash object" action is used during a pre-existing flash, simply extend the duration of the flashing
    • Previously, it always performed "hide object", potentially causing the object to be hidden too much

Playable game

https://gd.games/victrisgames/flash-object-extension-example

Project files

GDevelopApp/GDevelop-examples#554

Video

GDevelop_X3P80wkhvN.mp4

@tristanbob tristanbob added the 🔄 Extension update An update for an existing extension label Aug 5, 2023
@tristanbob tristanbob self-assigned this Aug 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

Errors were detected in this submission:


❌ 4 Errors found in extension 'Flash':

  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'IsTinted' misses a dot at the end of the sentence!
  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'Stop' misses a dot at the end of the sentence!
  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the behavior 'FlashOpacity' misses a dot at the end of the sentence!
  ⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'Flash':
{
  allowedProperties: [
    'makeUuid',           'rgbToHex',
    'rgbOrHexToRGBColor', 'rgbToHexNumber',
    'hexNumberToRGB',     'hexToRGBColor',
    'copyArray',          'staticArray',
    'staticArray2',       'staticObject',
    'toDegrees',          'toRad',
    'random',             'randomFloat',
    'randomFloatInRange', 'randomInRange',
    'randomWithStep',     'evtTools',
    'Variable',           'RuntimeObject',
    'Logger'
  ],
  disallowedProperty: 'SpriteRuntimeObject',
  objectName: 'gdjs'
}


❌ 4 Errors found in extensions - please fix them before generating the registry.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

Errors were detected in this submission:


❌ 3 Errors found in extension 'Flash':

  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'Stop' misses a dot at the end of the sentence!
  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the behavior 'FlashOpacity' misses a dot at the end of the sentence!
  ⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'Flash':
{
  allowedProperties: [
    'makeUuid',           'rgbToHex',
    'rgbOrHexToRGBColor', 'rgbToHexNumber',
    'hexNumberToRGB',     'hexToRGBColor',
    'copyArray',          'staticArray',
    'staticArray2',       'staticObject',
    'toDegrees',          'toRad',
    'random',             'randomFloat',
    'randomFloatInRange', 'randomInRange',
    'randomWithStep',     'evtTools',
    'Variable',           'RuntimeObject',
    'Logger'
  ],
  disallowedProperty: 'SpriteRuntimeObject',
  objectName: 'gdjs'
}


❌ 3 Errors found in extensions - please fix them before generating the registry.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

Errors were detected in this submission:


❌ 2 Errors found in extension 'Flash':

  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'Stop' misses a dot at the end of the sentence!
  ⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'Flash':
{
  allowedProperties: [
    'makeUuid',           'rgbToHex',
    'rgbOrHexToRGBColor', 'rgbToHexNumber',
    'hexNumberToRGB',     'hexToRGBColor',
    'copyArray',          'staticArray',
    'staticArray2',       'staticObject',
    'toDegrees',          'toRad',
    'random',             'randomFloat',
    'randomFloatInRange', 'randomInRange',
    'randomWithStep',     'evtTools',
    'Variable',           'RuntimeObject',
    'Logger'
  ],
  disallowedProperty: 'SpriteRuntimeObject',
  objectName: 'gdjs'
}


❌ 2 Errors found in extensions - please fix them before generating the registry.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

Errors were detected in this submission:


❌ 1 Error found in extension 'Flash':

  ⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'Stop' misses a dot at the end of the sentence!


❌ 1 Error found in extensions - please fix it before generating the registry.

@tristanbob
Copy link
Contributor Author

@D8H my only remaining question on this extension is this:
Should we allow users to make flashing repeat forever?

If so, should we:

  • Add a new boolean property "Infinite duration" (or similar)
  • Use "Flash duration = 0" to signal this state

@tristanbob tristanbob marked this pull request as ready for review August 5, 2023 06:17
@tristanbob tristanbob requested review from a team as code owners August 5, 2023 06:17
@tristanbob tristanbob changed the title [Flash object] Added ability to flash color tint, object effect, and opacity (fade) [Flash object] Add ability to flash color tint, object effect, and opacity (fade) Aug 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

Errors were detected in this submission:


❌ 1 Error found in extension 'Flash':

  ⟶ ❌ (🔧) [Dots in sentences]: Field 'shortDescription' of the extension description misses a dot at the end of the sentence!


❌ 1 Error found in extensions - please fix it before generating the registry.

@tristanbob
Copy link
Contributor Author

@D8H my only remaining question on this extension is this: Should we allow users to make flashing repeat forever?

If so, should we:

  • Add a new boolean property "Infinite duration" (or similar)
  • Use "Flash duration = 0" to signal this state

I decide to use the second method. Duration >= 0 will keep flashing until stopped.

@tristanbob tristanbob merged commit 5f11582 into main Aug 6, 2023
1 check passed
@tristanbob tristanbob deleted the flash-update branch August 6, 2023 05:22
@D8H
Copy link
Contributor

D8H commented Aug 6, 2023

Great job, it should be useful.

You copied a deprecated function that was replaced by "onDestroy". But, I bet the extension would work without it. As it only uses object timers and properties which are already destroyed with the object by the engine.
I guess it can be important to remove it to avoid to confuse users who would take this extension as en example.

@D8H
Copy link
Contributor

D8H commented Aug 6, 2023

@D8H my only remaining question on this extension is this: Should we allow users to make flashing repeat forever?
If so, should we:

  • Add a new boolean property "Infinite duration" (or similar)
  • Use "Flash duration = 0" to signal this state

I decide to use the second method. Duration >= 0 will keep flashing until stopped.

I like to make 2 actions in this case:

  • "Start flashing"
  • ""Flash"

I think it's more user-friendly than a field value that must not be used (or set to 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔄 Extension update An update for an existing extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants