Skip to content
Snippets Groups Projects
Commit b2bdd29a authored by benjamin.sitbon's avatar benjamin.sitbon
Browse files

On s'amuse

parent a88f6516
No related branches found
No related tags found
No related merge requests found
......@@ -59,11 +59,17 @@ int main()
break;
case SDLK_SPACE:
wait_key_release();
if(wheel_turn <3){
stop_wheel(&mas.wheels[wheel_turn]);
wheel_turn += 1;
}
break;
case SDLK_s:
wait_key_release();
wheel_turn =0;
for(int i = 0; i<3; i++){
mas.wheels[i].speed = 3-i;
}
break;
}
}
......
......@@ -13,11 +13,6 @@ int get_current_px(){
}
void *wheel_func(void *param){
printf("\nwheel_func");
wheel* id = (wheel *) (param);
......@@ -43,7 +38,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
while (this->current_px % 128 != 128-32) { // 32 is the offset to center the item
wheel_spin_1_tick(this);
wait_until(wheel_delay_ms(*this));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment