Optimising Respawning assets.

rexus11rexus11 Member Posts: 11
edited January 2012 in Working with GS (Mac)
Hey guys. I was working on a project yesterday and went for a method to create disappearing tiles (that re-spawn) in a way that i describe as the Ridley Scott method.

Essentially i have a brick. You stand on this brick, after 5 seconds it disappears. then after 8 seconds it comes back.

The formula for this is as follows:
Brick (Face-hugger)
When collides with player, after 5 seconds: destroy actor + spawn invisible brick (Alien) at current location.

Invisible Brick (Alien)
After 8 seconds, destroy this actor + Spawn Brick (face-hugger)


is there anything im doing wrong here or that could be improved?



Either way, the Aliens reference makes sense right?

Right?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited January 2012
    You could do after 5 seconds change color alpha to 0 or have it interpolate down to 0 that way you wont have to spawn or destroy.

    Then have a rule if alpha = 0 after 3 seconds change alpha to 1

    Hope this helps.

    Darren.

    GS Templates
    GS Tools
    Art Packs
    Music Packs
  • rexus11rexus11 Member Posts: 11
    at 0 would it stop colliding with the player though?
  • MotherHooseMotherHoose Member Posts: 2,456
    did this work for you?
    should have the Spawn behavior before the Destroy …
    once an actor is destroyed, the computer doesn't process the code that is after that action.

    (and, without any idea of the your gamePlay)
    suggest much simpler:
    -gameAttribute boolean type collided … leave unchecked

    Actor that collides:
    Rule: When
    Event: overlaps or collides with actor type: brick
    --changeAttribute: game.collided To: true

    Brick actor:
    Rule: when
    Attribute: game.collided is false
    --Timer: After:5 seconds
    ---changeAttribute: self.color.Alpha To: 1
    Otherwise:
    Interpolate: self.Color.Alpha To: 0

    on any actor:
    Rule: when
    Attribute: game.collided To: true
    Timer: After: 8 seconds
    --changeAttribute: game.collided To: false

    trying to help … but it is difficult when I can't visualize your work …

    @};- MH
Sign In or Register to comment.