countdown, show how many moves u got left?

boxyboxy Member Posts: 7

Hi there,

So my game has for every level a X number of moves u can use to complete that level. I got those moves in a table for every level and now i want to show in each level how many moves the player got left. I tryed it but i cant get it to work.

I got a actor called movescounter and put a "display text" in it to display the moves. So far i only got him to show how many moves u get, but no countdown on a move.

i used in the display text: tablecellvalue(game.movetable, game.whatlevel, 1) that 1 is for the row where the moves are in.

any ideas?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2014

    The 1 is actually for the column, but I knew what you meant. You need to do a Change Table Value behavior to decrease the value of that cell each time a move is made. In the value field, you would enter tableCellValue(game.movetable, game.whatlevel, 1)-1

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • boxyboxy Member Posts: 7

    ok, almost got it.

    got now the display text with: tableCellValue(game.movetable, game.whatlevel, 1)

    than rule, when mouse is down: display text: tableCellValue(game.movetable, game.whatlevel, 1)-1

    but than it swaps back to original state, like: 5,4,5,4....
    how can i keep it so it keeps counting down?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2014

    DisplayText will always display the current value of an attribute. There is (almost never) a need to place DisplayTest inside of a mouse is down rule.

    @tatiang said:
    You need to do a Change Table Value behavior to decrease the value of that cell each time a move is made. In the value field, you would enter tableCellValue(game.movetable, game.whatlevel, 1)-1

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • boxyboxy Member Posts: 7

    A i misread the: change table value behavior... Gonna try that one

Sign In or Register to comment.