void initGameScreen() { draw_clearScreen(); draw_Bunkers(); bunker_init(isNewGame); bullets_init(); aliens_init(); tank_init(isNewGame); buttons_init(); }
void resumeGamePlay() { // unlock the SMs alienBlockSM_unlock(); spaceshipSM_unlock(); controllerSM_unlock(); // restart the tank tank_init(); // reset the timer timeoutSMPeriods = 0; }
int //&L Added function ft_read_program(struct forftank *ftank, struct tank *tank, struct tankdef *tank_def) { ftank->error_pos = forf_parse_string(&ftank->env, tank_def->program); if (ftank->error_pos) { return 0; } forf_stack_copy(&ftank->_prog, &ftank->_cmd); tank_init(tank, (tank_run_func *)ft_run_tank, ftank); return 1; }
int //&L Added function ft_read_tank(struct forftank *ftank, struct tank *tank, struct forf_lexical_env *lenv, struct tankdef *tank_def) { int ret; ftank->path = temp_parse_path(tank_def->name); // No path anymore. /* What is your name? */ strncpy(ftank->name, tank_def->name, sizeof(ftank->name)); /* What is your quest? */ ft_tank_init(ftank, tank, lenv); ret = ft_read_program(ftank, tank, tank_def); if (ret) { ft_read_sensors(tank, tank_def); } else { /* Brick the tank */ tank_init(tank, ft_bricked_tank, NULL); } /* What is your favorite color? */ strncpy(ftank->color, tank_def->color, sizeof(ftank->color)); return 1; }
void warzone_init_tank(warzone *p, int player_rid, intpoint location) { tank_init(p->tanks + player_rid, location.x, location.y, DIRECTION_N, p->rules.TANK_MAX_HP, p->rules.TANK_MAX_EP); }