How to turn the light off ?

0 favourites
  • 6 posts
From the Asset Store
A well commented RPG game template to learn from or use as a base for your own game!
  • Hello World,

    I am trying to get the hang of this program and am stuck on how to change a 2 frame animation back to frame 0 after a left mouse click,

    ie, the light comes on in frame 1 and gets stuck.

    thanks.

  • Condition:

    -On left click on "LightObj".

    Action:

    -Set "LightObj" Animation Frame to (Frame Number).

    --"LightObj" Stop Animation.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Condition:

    -On left click on "LightObj".

    Action:

    -Set "LightObj" Animation Frame to (Frame Number).

    --"LightObj" Stop Animation.

    thanks for helping ,

    this gets me to frame 1 but not back to frame 0 when I click it again,

  • Oh..

    You need to add a instance variable to the "LightObj". Maybe call it "Power"(Type is Number, Default 0).

    So on start of the app, Lights is off (I assume off is frame 0 and on is frame 1)

    So on mouse click,

    check "LightObj" variable "Power" is = 0?

    If yes, set "Power" to 1 and Frame to 1 (its on now).

    else

    If no, set "Power" to 0 and Frame to 0 (its off now).

    something like this.

  • Is your animationspeed set to 0?

    Condition:

    -On left click on "LightObj".

    --subevent:

    -if Lightobj animationframe = 0

    -action:

    --Set "LightObj" Animation Frame to (1).

    --system else

    --Set "LightObj" Animation Frame to (0).

  • Thank you LittleStain n c4sp3r89, #SUBEVENTS not another condation.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)