Many actors blinking

themagicboxthemagicbox Member, PRO Posts: 82
In my game I have almost 200 actors in some scenes...only up to about 60 are visible an I wanted to know If I were to put blinking animations on each visible with timers, would it cause a lot of lag? should I change the actor image with another one of the same with the blinck or constrain eyes to each actor....and is there a way to have random blinking animations with timers?

Comments

  • themagicboxthemagicbox Member, PRO Posts: 82
    Without timers*
  • WbokoWboko Tennessee, USAMember, PRO Posts: 621
    If you are asking if 60 timers will cause lag, then the answer is"yes" but I am not really sure what you are asking?

    Can you add a screen shot of what you are looking for?

    WBOKO
  • themagicboxthemagicbox Member, PRO Posts: 82
    I'm cant make a screen until later when I get home but basically there are 60 actors which are like blocks (imagine tetris) and I want to put blicking eyes on all of them so they look more alive
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    Try something like this:

    When [game.Clock.Second] = [random(0,60)]
    ----Change Attribute:[self.Color.Alpha] To: [0.2]
    --Otherwise
    ----Change Attribute:[self.Color.Alpha] To:[1.00]

    You can replace the the change attribute behaviors with anything you want that makes sense for your game.
  • themagicboxthemagicbox Member, PRO Posts: 82
    Wow that looks like just why I need I forgot about game.time...so what exactly is happening here...I have an idea but I dont know of its correct...every second of game.time a random number and when they are equal (the second of game time and the random number) I can set a blinking animation?
  • themagicboxthemagicbox Member, PRO Posts: 82
    A random number is picked*
  • themagicboxthemagicbox Member, PRO Posts: 82
    Or does the random function only choose one random number for that behaviour
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    You could probably get it to work using [game.Time], but it seems easier (to me) to use [game.Clock.Second].

    Your explanation is close. Except its not choosing a new random number every second. Instead it picks a random number (between 0 and 60) and just keeps it stored in memory. Then it constantly compares the seconds to see if it matches the random number. One second in every minute, the two numbers will match up. When they match, then do a blink. Otherwise, just set stuff back to its original state.
  • themagicboxthemagicbox Member, PRO Posts: 82
    ohh I see alright, thank you!! would it be okay if I added more that one random number so that there are more seconds that could match each minute that passes? in stead of just having one blink per minute
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    Yes -- you can add in lots more stuff.

    To get multiple conditions to work in your rule, you change the
    "[All] conditions are valid:"
    to
    "[Any] conditions are valid:"


    Experiment!
    Have Fun!
    Its GameSalad!
Sign In or Register to comment.