background animation help

Hey peeps i am new to Gamesalad and i really need help with the background of my game. It will take place in a cave what i need done is a button that when pressed will light up the background making every thing visible but every second it gets darker again. I tried adding an animation of my background at 1fps just putting a slightly darker opacity but its not working properly. Any help would be greatly appreciated.

Answers

  • JarivespaJarivespa The NetherlandsMember Posts: 65
    Hey, are you using Mac or Windows? i will create a little Demo for you
  • JarivespaJarivespa The NetherlandsMember Posts: 65
    well my GS wont work with me right now. But this is what i did:

    have 4 differend layers: 1 the cave. 1 for the image to make it darker(just black) 1 for the button and 1 for the outside (explain later) (in this order)

    make the image for the flash black and the alpha 200

    make a boolean called: flash

    make a integer called: flashspam



    outside image(not on screen)

    drag the image where you want the button go so peeps cant spam the button.

    make 2 boolean attributes called: pos.x and pos.y
    no rule
    consrain attribute: pos.x to self.position.x
    consrain attribute: pos.y to self.position.y

    Flash button:

    Rule: touch is pressed
    change attribute: game.flash to true
    change attribute: game.flashspam +1

    rule:
    attribute: game.flash true
    consrain attribute: self.position.x to pos.x
    consrain attribute: self.position.y to pos.y


    Layer to make it darker:
    rule: attribute game.flash = true AND attribute game.flashspawn >= 1
    interpolate: self.colour.alpha to 0 for 3 seconds in a linair function.


    rule: attribute game.flash = false
    interpolate: self.colour.alpha to 200 for 3 seconds in a linair function

    timer: after [how much seconds do you want to make it dark]
    change attribute: game.flash to false
    change attribute: game.flashspawn to 0


    if this not work i dont know what to do.
    maybe i made some mistakes so i hope someone can make them correct
    im not enlgish so if it is bad im sorry i did what i could do.

    good luck and cheers

    BWG




Sign In or Register to comment.