X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fcamera.h;h=b913ead73421cdded6c6d9e7f75dad8f0f76866b;hb=e8a1d89d3d0f4824d3d906ca67149afec0a75e4b;hp=028671add1613e6d4b9a1fdb4baea0856115a967;hpb=9599042661b468aae7bd34dca05441c0ebc93ad7;p=supertux.git diff --git a/src/object/camera.h b/src/object/camera.h index 028671add..b913ead73 100644 --- a/src/object/camera.h +++ b/src/object/camera.h @@ -27,6 +27,7 @@ #include "special/game_object.h" #include "video/drawing_context.h" #include "serializable.h" +#include "timer.h" using namespace SuperTux; namespace lisp { @@ -58,6 +59,9 @@ public: { } + // shake camera in a direction 1 time + void shake(float speed, float x, float y); + void set_scrolling(int scroll_x, int scroll_y) { translation.x = scroll_x; @@ -74,6 +78,7 @@ private: void scroll_normal(float elapsed_time); void scroll_autoscroll(float elapsed_time); void keep_in_bounds(); + void shake(); enum LeftRightScrollChange { @@ -98,6 +103,12 @@ private: size_t auto_idx; float auto_t; Vector current_dir; + + // shaking + Timer2 shaketimer; + float shakespeed; + float shakedepth_x; + float shakedepth_y; }; #endif /*SUPERTUX_CAMERA_H*/