1 /***************************************************************************
2                           entity_grass.cpp  -  description
3                              -------------------
4     begin                : Mon Oct 1 2001
5     copyright            : (C) 2001 by Giuseppe D'Aqu�
6     email                : kumber@tiscalinet.it
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License, Version 2, as published by  *
13  *   the Free Software Foundation.                                   *
14  *                                                                         *
15  ***************************************************************************/
16 
17 #include "dephine.h"
18 #include "sprite.h"
19 #include "entity.h"
20 #include "entity_grass.h"
21 
Entity_Grass(Level * level,Uint32 x,Uint32 y)22 Entity_Grass::Entity_Grass(Level* level, Uint32 x, Uint32 y)
23 {
24 	current_level=level;
25 	m_position_x=x;
26 	m_position_y=y;
27 	m_type=GRASS;
28 	Surface_Manager* surf_man = Surface_Manager::instance();
29 	m_sprite=Sprite(surf_man->get_surface(Surface_Manager::SRF_GRASS));
30 	m_sprite.set_state(SP_STOP);
31 	m_exists=true;
32 
33 
34 }
35 
pass_on_me(Direction d)36 bool Entity_Grass::pass_on_me(Direction d)
37 {
38 
39 	//DEBOUT("Entering Entity_Grass::pass_on_me()\n");
40 	Sample_Manager::instance()->play(SFX_GRASS_EAT);
41 	kill();
42 	return true;
43 }
44 
45 
player_pressing_up(Entity_Handle down_entity)46 bool Entity_Grass::player_pressing_up(Entity_Handle down_entity)
47 {
48 
49 	Sample_Manager::instance()->play(SFX_GRASS_EAT);
50 	kill();
51 	return true;
52 }
53 
54 
player_pressing_down(Entity_Handle up_entity)55 bool Entity_Grass::player_pressing_down(Entity_Handle up_entity)
56 {
57 
58 	//DEBOUT("Entering Entity_Grass::pass_on_me()\n");
59 	Sample_Manager::instance()->play(SFX_GRASS_EAT);
60 	kill();
61 	return true;
62 }
63 
64 
player_pressing_right(Entity_Handle left_entity)65 bool Entity_Grass::player_pressing_right(Entity_Handle left_entity)
66 {
67 
68 	//DEBOUT("Entering Entity_Grass::pass_on_me()\n");
69 	Sample_Manager::instance()->play(SFX_GRASS_EAT);
70 	kill();
71 	return true;
72 }
73 
74 
player_pressing_left(Entity_Handle right_entity)75 bool Entity_Grass::player_pressing_left(Entity_Handle right_entity)
76 {
77 
78 	//DEBOUT("Entering Entity_Grass::pass_on_me()\n");
79 	Sample_Manager::instance()->play(SFX_GRASS_EAT);
80 	kill();
81 	return true;
82 }
83 
explode()84 bool Entity_Grass::explode()
85 {
86 	kill();
87 	//m_exists=false;
88 	return true;
89 }
90 
91