Adding Achievements October 10, 2012 05:43PM | Registered: 13 years ago Posts: 363 |
Re: Adding Achievements October 24, 2012 01:31PM | Registered: 13 years ago Posts: 58 |
Re: Adding Achievements October 24, 2012 05:38PM | Registered: 13 years ago Posts: 363 |
Re: Adding Achievements October 24, 2012 10:46PM | Registered: 15 years ago Posts: 384 |
Quote
owen
Thanx. I figured it out eventually. I created a big array of int[]. Then I created another array with the relationships between the int[]s. Then I create functions add(), reset(), check(). Whenever an add()/reset() event happens on a value I use the relationships to do a cascading update on the other values. Works like a dream. With no drop in frames.
Re: Adding Achievements October 25, 2012 10:40AM | Registered: 13 years ago Posts: 58 |
Re: Adding Achievements October 26, 2012 05:43PM | Registered: 13 years ago Posts: 363 |
#define STAT_DISTANCE 1 #define STAT_DISTANCE_TOTAL 2 #define STAT_MOVE_FORWARD 5 #define STAT_MOVE_TURN 6 #define STAT_MOVE_BACK 7 #define STAT_SHOT 8 #define STAT_SHOT_TOTAL 9 #define STAT_SHOT_ALT 10 #define STAT_OVERHEAT 11 #define STAT_OVERHEAT_TOTAL 12 #define STAT_HIT 13 #define STAT_HIT_TOTAL 14 #define STAT_SECONDS_WITHOUT_HIT 15 #define STAT_KILLS_WITHOUT_HIT 16 #define STAT_DISTANCE_WITHOUT_HIT 17 #define STAT_DISTANCE_WITHOUT_SHOT 18 #define STAT_SECONDS_WITHOUT_OVERHEAT 19 #define STAT_MINUTES 20 #define STAT_SECONDS 21 #define STAT_GUI_SECONDS 22 #define STAT_SECONDS_TOTAL 23 #define STAT_ACHIEVEMENT_TOTAL 25 #define STAT_ACHIEVEMENT_COMPLETED 26 #define STAT_KILLS 30 #define STAT_KILLS_ASTEROID 31 #define STAT_KILLS_ENEMY 32 #define STAT_KILLS_TOTAL 33 #define STAT_KILLS_ASTEROID_TOTAL 34 #define STAT_KILLS_ENEMY_TOTAL 35 #define STAT_BULLETS_FIRED_TOTAL 36 #define STAT_SECONDS_WITHOUT_KILL 37 #define STAT_CURRENT_GAME 40 #define STAT_DEATH_TOTAL 41 #define STAT_COINS 50 #define STAT_COINS_TOTAL 51 #define STAT_COMBO 52 #define STAT_KILLS_WITH_BULLET_DEF 60 #define STAT_KILLS_WITH_BULLET_MGUN 61 #define STAT_KILLS_WITH_BULLET_LASER 62 #define STAT_KILLS_WITH_BULLET_SPREAD 63 #define STAT_KILLS_WITH_BULLET_BURST 64 #define STAT_KILLS_WITHOUT_OVERHEAT 70
Re: Adding Achievements October 27, 2012 12:32AM | Registered: 15 years ago Posts: 384 |
Re: Adding Achievements October 27, 2012 04:21AM | Registered: 13 years ago Posts: 363 |
Re: Adding Achievements October 30, 2012 09:50AM | Registered: 13 years ago Posts: 58 |
Re: Adding Achievements October 30, 2012 02:33PM | Registered: 13 years ago Posts: 363 |
int statistic_check(int ind){ return statistic_list[ind].int_value; }
if( statistic_check(STAT_DEATH_TOTAL) > 20 ){ //do something }
Re: Adding Achievements November 03, 2012 01:15PM | Registered: 13 years ago Posts: 363 |