equal
deleted
inserted
replaced
1 #include "Projectile.hh" |
1 #include "Projectile.hh" |
|
2 #include "Graphics.hh" |
2 #include "Timer.hh" |
3 #include "Timer.hh" |
3 |
4 |
4 Projectile::Projectile(GameState &state, Vector position, Vector velocity, bool visible, float radius, TickCount age) : |
5 Projectile::Projectile(GameState &state, Vector position, Vector velocity, bool visible, float radius, TickCount age) : |
5 PhysicsObject(state.world, PLAYER_MASS, position, velocity), state(state), visible(visible), radius(radius), age(age) { |
6 PhysicsObject(state.world, PLAYER_MASS, position, velocity), state(state), visible(visible), radius(radius), age(age) { |
6 birth_tick = world.tick_timer.get_ticks(); |
7 birth_tick = world.tick_timer.get_ticks(); |
40 |
41 |
41 // super |
42 // super |
42 PhysicsObject::tick(dt); |
43 PhysicsObject::tick(dt); |
43 } |
44 } |
44 |
45 |
45 void Projectile::draw(CL_GraphicContext *gc) const { |
46 void Projectile::draw(Graphics *g) const { |
|
47 CL_GraphicContext *gc = g->get_gc(); |
|
48 |
46 if (visible) { |
49 if (visible) { |
47 |
50 |
48 CL_Quad projectile( |
51 CL_Quad projectile( |
49 (int)((position).x+1), (int)((position).y+1), |
52 (int)((position).x+1), (int)((position).y+1), |
50 (int)((position).x-1), (int)((position).y+1), |
53 (int)((position).x-1), (int)((position).y+1), |