#include "gameobjs.h"
void
-bouncy_distro_type::init(float x, float y)
+BouncyDistro::init(float x, float y)
{
base.x = x;
base.y = y;
}
void
-bouncy_distro_type::action()
+BouncyDistro::action()
{
base.y = base.y + base.ym * frame_ratio;
base.ym += 0.1 * frame_ratio;
if (base.ym >= 0)
- world.bouncy_distros.erase(static_cast<std::vector<bouncy_distro_type>::iterator>(this));
+ world.bouncy_distros.erase(static_cast<std::vector<BouncyDistro>::iterator>(this));
}
void
-bouncy_distro_type::draw()
+BouncyDistro::draw()
{
texture_draw(&img_distro[0],
base.x - scroll_x,
void
-broken_brick_type::init(Tile* tile_, float x, float y, float xm, float ym)
+BrokenBrick::init(Tile* tile_, float x, float y, float xm, float ym)
{
tile = tile_;
base.x = x;
}
void
-broken_brick_type::action()
+BrokenBrick::action()
{
base.x = base.x + base.xm * frame_ratio;
base.y = base.y + base.ym * frame_ratio;
if (!timer_check(&timer))
- world.broken_bricks.erase(static_cast<std::vector<broken_brick_type>::iterator>(this));
+ world.broken_bricks.erase(static_cast<std::vector<BrokenBrick>::iterator>(this));
}
void
-broken_brick_type::draw()
+BrokenBrick::draw()
{
SDL_Rect src, dest;
src.x = rand() % 16;
}
void
-bouncy_brick_type::init(float x, float y)
+BouncyBrick::init(float x, float y)
{
base.x = x;
base.y = y;
}
void
-bouncy_brick_type::action()
+BouncyBrick::action()
{
offset = (offset +
offset_m * frame_ratio);
/* Stop bouncing? */
if (offset >= 0)
- world.bouncy_bricks.erase(static_cast<std::vector<bouncy_brick_type>::iterator>(this));
+ world.bouncy_bricks.erase(static_cast<std::vector<BouncyBrick>::iterator>(this));
}
void
-bouncy_brick_type::draw()
+BouncyBrick::draw()
{
int s;
SDL_Rect dest;
}
void
-floating_score_type::init(float x, float y, int s)
+FloatingScore::init(float x, float y, int s)
{
base.x = x;
base.y = y - 16;
}
void
-floating_score_type::action()
+FloatingScore::action()
{
base.y = base.y - 2 * frame_ratio;
if(!timer_check(&timer))
- world.floating_scores.erase(static_cast<std::vector<floating_score_type>::iterator>(this));
+ world.floating_scores.erase(static_cast<std::vector<FloatingScore>::iterator>(this));
}
void
-floating_score_type::draw()
+FloatingScore::draw()
{
char str[10];
sprintf(str, "%d", value);
{
score += s;
- floating_score_type new_floating_score;
-new_floating_score.init(x,y,s);
+ FloatingScore new_floating_score;
+ new_floating_score.init(x,y,s);
floating_scores.push_back(new_floating_score);
}
void
World::add_bouncy_distro(float x, float y)
{
- bouncy_distro_type new_bouncy_distro;
+ BouncyDistro new_bouncy_distro;
new_bouncy_distro.init(x,y);
bouncy_distros.push_back(new_bouncy_distro);
}
void
World::add_broken_brick_piece(Tile* tile, float x, float y, float xm, float ym)
{
- broken_brick_type new_broken_brick;
+ BrokenBrick new_broken_brick;
new_broken_brick.init(tile, x, y, xm, ym);
broken_bricks.push_back(new_broken_brick);
}
void
World::add_bouncy_brick(float x, float y)
{
- bouncy_brick_type new_bouncy_brick;
+ BouncyBrick new_bouncy_brick;
new_bouncy_brick.init(x,y);
bouncy_bricks.push_back(new_bouncy_brick);
}
public:
Level* level;
- std::vector<bouncy_distro_type> bouncy_distros;
- std::vector<broken_brick_type> broken_bricks;
- std::vector<bouncy_brick_type> bouncy_bricks;
- std::vector<floating_score_type> floating_scores;
+ std::vector<BouncyDistro> bouncy_distros;
+ std::vector<BrokenBrick> broken_bricks;
+ std::vector<BouncyBrick> bouncy_bricks;
+ std::vector<FloatingScore> floating_scores;
std::vector<BadGuy> bad_guys;
std::vector<upgrade_type> upgrades;