Best way to "Flash" character

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
So I'd like to have an enemy flash when the player "selects" him. That way the player knows which enemy he is targeting.

I've been playing with some self.attributes, change attribute (alpha) and some interpolate features, but nothing seems to be working very well.

What's the best way to get the enemy to "flash" or give the player the indication that they've selected them and bullets will fly towards him?

Comments

  • RattleheadRattlehead Member Posts: 485
    I've gone the fade in/out route on some things before but I guess it somewhat depends on the scenario too. If there are not a lot of actors on the screen and the player is only able to target one enemy at a time, then he would probably want to constantly be able to determine which enemy is selected - if that were the case, I'd probably constrain a 'bounding box' (like you typically see in strategy games when selecting units) that is typically hidden off screen to the enemy's position until they are DOA.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    For a quick flash I would use a Change attribute on actual colors something like

    When touch is pressed
    --Change Attribute Self.color.blue to 0
    --Change Attribute self.color.green to 0
    Otherwise
    --Change Attribute Self.color.blue to 1
    --Change Attribute self.color.green to 1

    That particular rule will give your actor image a red color while you are touching it and then go back to normal when released. You can play with the color selector to work out the exact color you attributes you want it to change to. Just remember when changing the colors its a 0 to 1 value so if your setting your color based on the 0-255 settings the actual color selector gives you you need to set those in there and then look at what the actual attribute in the actor is set at to get the correct 0 to 1 value.
  • DrGlickertDrGlickert Member Posts: 1,135
    Those are great ideas. But ideally I'd like the character to continuously "flash." Maybe I can just make another image and have the two exactly the same but just have the "Change Image" behavior and it rotates back and forth. Do you think this would eat up a lot of memory/resources?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You can do that. Have a timer and have it every random(1,6) seconds
    change image to the flash image

    then another rule when attribute self image is (the exact name of the image with.png)
    timer after .2 seconds, change image back to regular image

    that will give u a nice random effect.
  • DrGlickertDrGlickert Member Posts: 1,135
    Thanks JP. I'll give that a shot.
Sign In or Register to comment.