global.score1=0;
global.score2=0;
global.score1+=1;
draw_text(50,50,"Player1 = "+string(global.score1))
draw_text(50,150,"Player2 = "+string(global.score2))
do the same thingIt helped me, but now I need to know what to do with the highscore, it happens that the highscore number increases for both players and is not independent of each one, any help?
global.hscore1 = 0;
global.hscore2 = 0;
Unless it is a state secret it might be beneficial to include all relevant code when saying something does not work. Initialization, updates, drawing. And no pointing to or quoting posts made by others either, because there are no guarantees you are not doing something different or have additional code that affects the result, if it is not a direct copy and paste from your project.it didn't work
global.score1 = 0;//score player1
global.score2 = 0;//score player2
global.hscore1 = 0;//high score player1
global.hscore2 = 0;//high score player2
if global.score1>global.hscore1{global.hscore1=global.score1;}
if global.score2>global.hscore2{global.hscore2=global.score2;}
ini_open("highscore.ini")
ini_write_real("highscore","player1",global.hscore1)//save high score player1
ini_write_real("highscore","player2",global.hscore2)//save high score player2
ini_close()
ini_open("highscore.ini")
global.hscore1=ini_read_real("highscore","player1",0)
global.hscore2=ini_read_real("highscore","player2",0)
ini_close()
I can't be sure as not at dev PC atm, but as far as I'm aware you might need to have it in included files for HTML5 (ie. drag a dummy file called that, or a local copy of the actual ini file called that, that your game has now created), into your project workspace and add it that way?and the ini file can be exported in html5?