X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fcamera.h;h=ac762984fe9c709b065df08519aaaa760af2cb95;hb=ddc3b7ef2077567d368e244a292b41187311e8e3;hp=2294aa964a7cf1804644ee2718ee12082280386c;hpb=6f801c22d97251799740317fb1d0caf2e744b321;p=supertux.git diff --git a/src/object/camera.h b/src/object/camera.h index 2294aa964..ac762984f 100644 --- a/src/object/camera.h +++ b/src/object/camera.h @@ -16,23 +16,20 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - #ifndef SUPERTUX_CAMERA_H #define SUPERTUX_CAMERA_H #include #include -#include "defines.h" #include "math/vector.h" -#include "special/game_object.h" +#include "game_object.h" #include "video/drawing_context.h" #include "serializable.h" +#include "timer.h" -using namespace SuperTux; - -namespace SuperTux { -class LispReader; +namespace lisp { +class Lisp; } class Sector; @@ -44,9 +41,9 @@ public: virtual ~Camera(); /// parse camera mode from lisp file - void parse(LispReader& reader); + void parse(const lisp::Lisp& reader); /// write camera mode to a lisp file - virtual void write(LispWriter& writer); + virtual void write(lisp::Writer& writer); /// reset camera postion virtual void reset(const Vector& tuxpos); @@ -60,6 +57,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; @@ -76,6 +76,7 @@ private: void scroll_normal(float elapsed_time); void scroll_autoscroll(float elapsed_time); void keep_in_bounds(); + void shake(); enum LeftRightScrollChange { @@ -100,6 +101,12 @@ private: size_t auto_idx; float auto_t; Vector current_dir; + + // shaking + Timer shaketimer; + float shakespeed; + float shakedepth_x; + float shakedepth_y; }; #endif /*SUPERTUX_CAMERA_H*/