|
|
|
@ -982,7 +982,6 @@ void pull_rope(double newtons) {
@@ -982,7 +982,6 @@ void pull_rope(double newtons) {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set force
|
|
|
|
|
set_motor_newtons(player.physics, M_WINCH, 0, newtons); |
|
|
|
|
set_motor_status(player.physics, M_WINCH, true); |
|
|
|
@ -1699,23 +1698,24 @@ void handle_input_event(SDL_Event event) {
@@ -1699,23 +1698,24 @@ void handle_input_event(SDL_Event event) {
|
|
|
|
|
if (sc == input_map.player_pull_rope) { |
|
|
|
|
stop_pull_rope(); |
|
|
|
|
}
|
|
|
|
|
// DEBUGINFO
|
|
|
|
|
if (event.key.keysym.scancode == SDL_SCANCODE_F10) { |
|
|
|
|
next_level(); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case SDL_MOUSEBUTTONDOWN: |
|
|
|
|
add_rope(event.button.x, event.button.y); |
|
|
|
|
if (event.button.button == SDL_BUTTON_LEFT) |
|
|
|
|
if (event.button.button == input_map.mouse_attach_rope) |
|
|
|
|
mouse_down = true; |
|
|
|
|
if (event.button.button == SDL_BUTTON_RIGHT) |
|
|
|
|
if (event.button.button == input_map.mouse_attach_rope_pull) |
|
|
|
|
pull_rope(900); |
|
|
|
|
break; |
|
|
|
|
case SDL_MOUSEBUTTONUP: |
|
|
|
|
if (event.button.button == SDL_BUTTON_LEFT) { |
|
|
|
|
if (event.button.button == input_map.mouse_attach_rope) { |
|
|
|
|
mouse_down = false; |
|
|
|
|
delete_rope(); |
|
|
|
|
} |
|
|
|
|
if (event.button.button == SDL_BUTTON_RIGHT) { |
|
|
|
|
if (event.button.button == input_map.mouse_attach_rope_pull) { |
|
|
|
|
stop_pull_rope(); |
|
|
|
|
if (!mouse_down) { |
|
|
|
|
delete_rope(); |
|
|
|
|