diff --git a/one_armed_bandit.c b/one_armed_bandit.c index f8a8e3731ea4a631f0a0f6b055967837ea0e4368..f1fa0af55860cec439e82913e85717e91e19e189 100644 --- a/one_armed_bandit.c +++ b/one_armed_bandit.c @@ -60,6 +60,7 @@ int main() case SDLK_SPACE: wait_key_release(); stop_wheel(&mas.wheels[wheel_turn]); + wheel_turn += 1; break; case SDLK_s: wait_key_release(); diff --git a/wheel.c b/wheel.c index 35169063aa4fe34d56c108ef38c2d035af5fac52..020650d7fe6676ae18186236a14c06079dacc550 100644 --- a/wheel.c +++ b/wheel.c @@ -22,7 +22,7 @@ void *wheel_func(void *param){ printf("\nwheel_func"); wheel* id = (wheel *) (param); - while(id->speed > 0){ + while(1){ wheel_spin_1_tick(id); wait_until(wheel_delay_ms(*id)); } @@ -44,7 +44,7 @@ int wheel_delay_ms(wheel this){ int stop_wheel(wheel* this){ while (this->current_px % 128 != 32) { // 32 is the offset to center the item - wheel_spin_1_tick(&this); + wheel_spin_1_tick(this); wait_until(wheel_delay_ms(*this)); } this->speed = 0;