Saludos gente , llego con un problemilla y es que estoy intentando hacer mi propia tabla de puntuaciones , uso el siguiente codigo para ver si la puntuacion es mayor a las sacadas anteriormente blablabla ..
[gml]if total>global.hof[1,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=global.hof[2,0] global.hof[2,0]=global.hof[1,0] global.hof[1,0]=total}
else if total>global.hof[2,0] and total<global.hof[1,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=global.hof[2,0] global.hof[2,0]=total}
else if total>global.hof[3,0] and total<global.hof[2,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=total}
else if total>global.hof[4,0] and total<global.hof[3,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=total}
else if total>global.hof[5,0] and total<global.hof[4,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=total}
else if total<global.hof[5,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_global);sound_play(snd_global)}[/gml]
Funciona a la perfeccion hace lo que quiero que haga , pero... como veis creo que es un codigo basto a no poder mas hehe asi que como seguro que hay alguna formula para simplificar semejante codigo (que tengo que poner en muchos objetos) pero siempre se me dieron fatal las formulas o no soy capar de verlas y no doy con nada que haga la misma funcion.
Mas que nada quisiera algo mas simple porque digamos que el array global.hof sera una lista de 100 y no 5 como lo tengo hay ... podeis imaginar el caos hehe
Gracias de antemano a el genio de las mates (o por lo menos no estupido como yo) que me ayude con este caos mental :)
[gml]if total>global.hof[1,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=global.hof[2,0] global.hof[2,0]=global.hof[1,0] global.hof[1,0]=total}
else if total>global.hof[2,0] and total<global.hof[1,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=global.hof[2,0] global.hof[2,0]=total}
else if total>global.hof[3,0] and total<global.hof[2,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=global.hof[3,0] global.hof[3,0]=total}
else if total>global.hof[4,0] and total<global.hof[3,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=global.hof[4,0] global.hof[4,0]=total}
else if total>global.hof[5,0] and total<global.hof[4,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_hof);sound_play(snd_global) global.hof[5,0]=total}
else if total<global.hof[5,0] and total>50 {instance_create(obj_player.x,obj_player.y,obj_global);sound_play(snd_global)}[/gml]
Funciona a la perfeccion hace lo que quiero que haga , pero... como veis creo que es un codigo basto a no poder mas hehe asi que como seguro que hay alguna formula para simplificar semejante codigo (que tengo que poner en muchos objetos) pero siempre se me dieron fatal las formulas o no soy capar de verlas y no doy con nada que haga la misma funcion.
Mas que nada quisiera algo mas simple porque digamos que el array global.hof sera una lista de 100 y no 5 como lo tengo hay ... podeis imaginar el caos hehe
Gracias de antemano a el genio de las mates (o por lo menos no estupido como yo) que me ayude con este caos mental :)