WalkingLeaf Class Reference

#include <walkingleaf.hpp>

Inherits WalkingBadguy.

List of all members.

Public Member Functions

 WalkingLeaf (const Reader &reader)
 WalkingLeaf (const Vector &pos, Direction d)

Protected Member Functions

bool collision_squished (GameObject &object)
 Called when the player hit the badguy from above.


Detailed Description

Definition at line 25 of file walkingleaf.hpp.


Constructor & Destructor Documentation

WalkingLeaf::WalkingLeaf ( const Reader reader  ) 

Definition at line 22 of file walkingleaf.cpp.

References WalkingBadguy::max_drop_height, and WalkingBadguy::walk_speed.

00022                                              :
00023   WalkingBadguy(reader, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
00024 {
00025   walk_speed = 60;
00026   max_drop_height = 16;
00027 }

WalkingLeaf::WalkingLeaf ( const Vector pos,
Direction  d 
)

Definition at line 29 of file walkingleaf.cpp.

References WalkingBadguy::max_drop_height, and WalkingBadguy::walk_speed.

00030   : WalkingBadguy(pos, d, "images/creatures/walkingleaf/walkingleaf.sprite", "left", "right")
00031 {
00032   walk_speed = 60;
00033   max_drop_height = 16;
00034 }


Member Function Documentation

bool WalkingLeaf::collision_squished ( GameObject object  )  [protected, virtual]

Called when the player hit the badguy from above.

You should return true if the badguy was squished, false if squishing wasn't possible

Reimplemented from BadGuy.

Definition at line 37 of file walkingleaf.cpp.

References BadGuy::dir, BadGuy::kill_squished(), LEFT, and MovingSprite::sprite.

00038 {
00039   sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
00040   kill_squished(object);
00041   return true;
00042 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 9 03:38:38 2014 for SuperTux by  doxygen 1.5.1