Another weird rule question

Games4lifeGames4life Member, PRO Posts: 279
edited June 2016 in Working with GS (Mac)

.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Your code (first example) doesn't check for whether '0' is pressed, it checks for whether the actor is pressed and the game.time is not 0.

  • SocksSocks London, UK.Member Posts: 12,822

    Your second example checks for when the actor is pressed and game.time = 0 (i.e. it doesn't check for 0 being pressed [for example, on a keyboard]).

    The first rule will (pretty much) always fire.

    The second rule will (pretty much) never fire.

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:
    Your second example checks for when the actor is pressed and game.time = 0 (i.e. it doesn't check for 0 being pressed [for example, on a keyboard]).

    The first rule will (pretty much) always fire.

    The second rule will (pretty much) never fire.

    Oh, so how can I fix this?

    Thank you by the way!

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    Oh, so how can I fix this?

    Thank you by the way!

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:
    Oh, so how can I fix this?

    Thank you by the way!

    Sorry, I failed to mention this is for the iPhone!

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    Sorry, I failed to mention this is for the iPhone!

    So you'd like to detect when the 'number' 0 is not pressed on an iPhone ?

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:
    Sorry, I failed to mention this is for the iPhone!

    So you'd like to detect when the 'number' 0 is not pressed on an iPhone ?

    Yes this is basically for the timer... if the stop button is pressed when the timer does not 0 then the game should end which it does. I want it to so that when 0 is pressed the normal protocol is proceeded with which is to just reset the timer

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:

    @Socks said:

    @Games4life said:
    Sorry, I failed to mention this is for the iPhone!

    So you'd like to detect when the 'number' 0 is not pressed on an iPhone ?

    Yes this is basically for the timer... if the stop button is pressed when the timer does not 0 then the game should end which it does. I want it to so that when 0 is pressed the normal protocol is proceeded with which is to just reset the timer

    I don't understand any of that ! :) Sorry !

    So you'd like the timer to reset when 0 is pressed ? Is that the basic question ?

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:

    @Socks said:

    @Games4life said:
    Sorry, I failed to mention this is for the iPhone!

    So you'd like to detect when the 'number' 0 is not pressed on an iPhone ?

    Yes this is basically for the timer... if the stop button is pressed when the timer does not 0 then the game should end which it does. I want it to so that when 0 is pressed the normal protocol is proceeded with which is to just reset the timer

    I don't understand any of that ! :) Sorry !

    So you'd like the timer to reset when 0 is pressed ? Is that the basic question ?

    Sorry for not being clear,
    I have the rule set up, so that when the button is pushed when the timer is at 0, the timer is reset and an extra second is added to the timer. I want this to happen when the button is pushed at time 0 and not any time... Does this help?

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    I have the rule set up, so that when the button is pushed when the timer is at 0, the timer is reset and an extra second is added to the timer.

    Is the 'button' the same actor as 'the number 0' (i.e: "if the number 0 IS NOT pressed then. . . ") ? Or are they two separate actors ?

    Is the 'timer' something you've made yourself or are you using the built in 'game.time' ?

  • Games4lifeGames4life Member, PRO Posts: 279
    edited June 2016

    .

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    I have the rule set up, so that when the button is pushed when the timer is at 0, the timer is reset and an extra second is added to the timer. I want this to happen when the button is pushed at time 0 and not any time... Does this help?

    Ok, I think I've got it (apologies for being a bit slow today, need more coffee).

    You have a timer that counts down from 10 to -4.

    If the player hits the Stop button when the timer is at 0 seconds (a 0.2 window of opportunity) they are rewarded with the timer being reset and an extra second* given ? So the timer will now run from 11 to -4 ?

    Is that the basic set up ?

    . . . . . .

    *your code doesn't add an extra second, your code adds +1, the timer subtracting 1 from the remaining time every 0.2 seconds, therefore +1 will give you an extra 0.2 seconds rather than 1 second.

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:
    I have the rule set up, so that when the button is pushed when the timer is at 0, the timer is reset and an extra second is added to the timer. I want this to happen when the button is pushed at time 0 and not any time... Does this help?

    Ok, I think I've got it (apologies for being a bit slow today, need more coffee).

    You have a timer that counts down from 10 to -4.

    If the player hits the Stop button when the timer is at 0 seconds (a 0.2 window of opportunity) they are rewarded with the timer being reset and an extra second* given ? So the timer will now run from 11 to -4 ?

    Is that the basic set up ?

    . . . . . .

    *your code doesn't add an extra second, your code adds +1, the timer subtracting 1 from the remaining time every 0.2 seconds, therefore +1 will give you an extra 0.2 seconds rather than 1 second.

    Yes exactly! However even when I hit it on the 0 it still ends the game! (Even at a slower time control)

    Do you understand that?

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:
    I have the rule set up, so that when the button is pushed when the timer is at 0, the timer is reset and an extra second is added to the timer. I want this to happen when the button is pushed at time 0 and not any time... Does this help?

    Ok, I think I've got it (apologies for being a bit slow today, need more coffee).

    You have a timer that counts down from 10 to -4.

    If the player hits the Stop button when the timer is at 0 seconds (a 0.2 window of opportunity) they are rewarded with the timer being reset and an extra second* given ? So the timer will now run from 11 to -4 ?

    Is that the basic set up ?

    . . . . . .

    *your code doesn't add an extra second, your code adds +1, the timer subtracting 1 from the remaining time every 0.2 seconds, therefore +1 will give you an extra 0.2 seconds rather than 1 second.

    Nevermind I got it!! Thank you!

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    Nevermind I got it!! Thank you!

    Glad you sorted it out ! :)

Sign In or Register to comment.