• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Something's wrong with numbers

V

Vitalii Lukyanov

Guest
Hello, I'm trying to make something like scoreboard for character(maximum of four), scores add up depending on the order of pushed button. So when I'm trying to add 80 for example, it adds 200, 60 - 120, 40 - 60, 20 - 20. I used this switch case over here:

switch (ds_list_find_index(global.ch_s_order, "ch1")) {
case 0: sc += 80;
case 1: sc += 60;
case 2: sc += 40;
case 3: sc += 20;
}​

And to make it easier for me, I created 4 different objects of these scoreboards, for each player. "sc" variable doesn't change anywhere except this switch. And I initialized this variable at create event(initial value is 0), so I don't think that it should change on my own.

To see these numbers I use draw event, these commands:

draw_sprite(Counter, -1, x, y);
draw_set_alpha(1)
draw_text_transformed(x, y - 50, string(sc), 4, 4, 0);

Thanks in advance.
 
Top