fixed butt jump to work even when up-key is not pressed, added a little jump after...
[supertux.git] / src / level.cpp
index e9612b1..ff38e8d 100644 (file)
@@ -233,7 +233,7 @@ Level::init_defaults()
   song_title = "Mortimers_chipdisko.mod";
   bkgd_image = "arctis.png";
   width      = 21;
-  height     = 15;
+  height     = 19;
   start_pos_x = 100;
   start_pos_y = 170;
   time_left  = 100;
@@ -409,14 +409,14 @@ Level::load(const std::string& filename)
                 }
                 else
                 {
-                    if (lisp_symbol(lisp_car(data)) == "trampoline")
+                    if (strcmp(lisp_symbol(lisp_car(data)),"trampoline") == 0)
                     {
                       ObjectData<TrampolineData> _trampoline_data;
 
                       _trampoline_data.type = OBJ_TRAMPOLINE;
                       reader.read_int("x", &_trampoline_data.x);
                       reader.read_int("y", &_trampoline_data.y);
-                      reader.read_int("power", &_trampoline_data.type_specific.power);
+                      reader.read_float("power", &_trampoline_data.type_specific.power);
 
                       trampoline_data.push_back(_trampoline_data);
                     }
@@ -764,10 +764,12 @@ void Level::draw_bg()
 {
   // Tile background horizontally
   int sx = (int)((float)scroll_x * ((float)bkgd_speed/100.0f)) % img_bkgd->w;
-  for (int i = 0; (i-1)*img_bkgd->w <= screen->w; i++)
-    img_bkgd->draw_part(i == 0 ? sx : 0, 0,
-                        i == 0 ? 0 : (img_bkgd->w * i) - sx, 0,
-                        i == 0 ? img_bkgd->w - sx : img_bkgd->w, img_bkgd->h);
+  int sy = (int)((float)scroll_y * ((float)bkgd_speed/100.0f)) % img_bkgd->h;
+  for (int x = 0; (x-1)*img_bkgd->w <= screen->w; x++)
+    for (int y = 0; (y-1)*img_bkgd->h <= screen->h; y++)
+      img_bkgd->draw_part(x == 0 ? sx : 0, y == 0 ? sy : 0,
+                        x == 0 ? 0 : (img_bkgd->w * x) - sx, y == 0 ? 0 : (img_bkgd->h * y) - sy,
+                        x == 0 ? img_bkgd->w - sx : img_bkgd->w, y == 0 ? img_bkgd->h - sy : img_bkgd->h);
 }
 
 void