Flashing (blinking) Walls

lpetrowiczlpetrowicz Member Posts: 12
edited February 2014 in Working with GS (Mac)
I am trying to create a game that will have flashing walls. I want to make the walls flash (blink) at different rates. I also want them to be able to be collided with when visible and fly by when they are not there. Does anyone have any idea how to make this happen? I have searched the net up and down. Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    This thread is for PAID requests. I am going to move this to the Working with GameSalad subforum.

    To answer your question, you would change self.color.alpha which is a value between 0 and 1 that represents 0% to 100% opacity. At 0 (0%), self.color.alpha renders an actor invisible.

    You can use the Timer or Interpolate behaviors to change the value of attributes including self.color.alpha.

    You would then use a rule that says:
    When attribute self.color.alpha > 0
         When actor collides with actor [moving actor]
              [whatever you want to happen when the actor hits a visible wall]

    *You may find that > 0 is not the best condition here because a wall at 0.1 (10%) opacity can also appear to be invisible or too faint to notice. So try it out with different values in the rule condition.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    You could also try shrinking the width to 0 . . . .

    (click anywhere on the screen to spawn a ball)

    Link: https://www.mediafire.com/?vqzjr9p9b9ypd0i
  • lpetrowiczlpetrowicz Member Posts: 12
    I will give the self.color.alpha a try. I just want to make sure I understand. As long as I set it to >0 I will be able to fly by without colliding into it, correct?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    Sorry, I had made a demo but forgot to post it yesterday. I'll add it here in a couple hours when I get the chance.

    Changing the opacity of an actor does not affect its collision properties in any way. But you can use that changed value as a condition for a rules that checks for collision. That's what the demo does and what my rule above does.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You will need a rule that turns off the collide behavior and make sure the collide is only in the walls.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here you go.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • lpetrowiczlpetrowicz Member Posts: 12
    cannot open the game (.zip). It's telling me "unsupported file format. The file is newer than the version of creator". I have downloaded the most current creator tonight.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    I made the demo using Mac Creator version 0.10.4.1. I'm able to open it just fine.

    If you can't open it, you can re-create the rules. The hero actor I made just moves with keyboard controls (left and right) and the wall has these rules:

    (all of the attributes are self.color.alpha... you'd also need to change the physics settings on both actors so that they have fixed rotation and no bounciness)

    image

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.